@modelcontextprotocol/inspector-client 0.16.8 → 0.17.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/dist/assets/{OAuthCallback-7gQlGWPl.js → OAuthCallback-C0JXhwud.js} +1 -1
- package/dist/assets/{OAuthDebugCallback-67pOP7RZ.js → OAuthDebugCallback-TZR9iqA_.js} +1 -1
- package/dist/assets/{index-3LzLs-Yz.js → index-BB0Z_sAV.js} +1038 -744
- package/dist/assets/{index-CFrqgd8F.css → index-DJXA50Oy.css} +27 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
|
@@ -7411,8 +7411,8 @@ function getElementRef$1(element) {
|
|
|
7411
7411
|
}
|
|
7412
7412
|
return element.props.ref || element.ref;
|
|
7413
7413
|
}
|
|
7414
|
-
function createCollection(
|
|
7415
|
-
const PROVIDER_NAME2 =
|
|
7414
|
+
function createCollection(name2) {
|
|
7415
|
+
const PROVIDER_NAME2 = name2 + "CollectionProvider";
|
|
7416
7416
|
const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME2);
|
|
7417
7417
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
7418
7418
|
PROVIDER_NAME2,
|
|
@@ -7425,7 +7425,7 @@ function createCollection(name) {
|
|
|
7425
7425
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref2, children });
|
|
7426
7426
|
};
|
|
7427
7427
|
CollectionProvider.displayName = PROVIDER_NAME2;
|
|
7428
|
-
const COLLECTION_SLOT_NAME =
|
|
7428
|
+
const COLLECTION_SLOT_NAME = name2 + "CollectionSlot";
|
|
7429
7429
|
const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
|
|
7430
7430
|
const CollectionSlot = React.forwardRef(
|
|
7431
7431
|
(props, forwardedRef) => {
|
|
@@ -7436,7 +7436,7 @@ function createCollection(name) {
|
|
|
7436
7436
|
}
|
|
7437
7437
|
);
|
|
7438
7438
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
7439
|
-
const ITEM_SLOT_NAME =
|
|
7439
|
+
const ITEM_SLOT_NAME = name2 + "CollectionItemSlot";
|
|
7440
7440
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
7441
7441
|
const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
|
|
7442
7442
|
const CollectionItemSlot = React.forwardRef(
|
|
@@ -7454,7 +7454,7 @@ function createCollection(name) {
|
|
|
7454
7454
|
);
|
|
7455
7455
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
7456
7456
|
function useCollection2(scope) {
|
|
7457
|
-
const context = useCollectionContext(
|
|
7457
|
+
const context = useCollectionContext(name2 + "CollectionConsumer", scope);
|
|
7458
7458
|
const getItems = React.useCallback(() => {
|
|
7459
7459
|
const collectionNode = context.collectionRef.current;
|
|
7460
7460
|
if (!collectionNode) return [];
|
|
@@ -7721,10 +7721,10 @@ function dispatchUpdate() {
|
|
|
7721
7721
|
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
7722
7722
|
document.dispatchEvent(event);
|
|
7723
7723
|
}
|
|
7724
|
-
function handleAndDispatchCustomEvent$1(
|
|
7724
|
+
function handleAndDispatchCustomEvent$1(name2, handler, detail, { discrete }) {
|
|
7725
7725
|
const target = detail.originalEvent.target;
|
|
7726
|
-
const event = new CustomEvent(
|
|
7727
|
-
if (handler) target.addEventListener(
|
|
7726
|
+
const event = new CustomEvent(name2, { bubbles: false, cancelable: true, detail });
|
|
7727
|
+
if (handler) target.addEventListener(name2, handler, { once: true });
|
|
7728
7728
|
if (discrete) {
|
|
7729
7729
|
dispatchDiscreteCustomEvent(target, event);
|
|
7730
7730
|
} else {
|
|
@@ -8512,10 +8512,10 @@ function getAnnounceTextContent(container) {
|
|
|
8512
8512
|
});
|
|
8513
8513
|
return textContent;
|
|
8514
8514
|
}
|
|
8515
|
-
function handleAndDispatchCustomEvent(
|
|
8515
|
+
function handleAndDispatchCustomEvent(name2, handler, detail, { discrete }) {
|
|
8516
8516
|
const currentTarget = detail.originalEvent.currentTarget;
|
|
8517
|
-
const event = new CustomEvent(
|
|
8518
|
-
if (handler) currentTarget.addEventListener(
|
|
8517
|
+
const event = new CustomEvent(name2, { bubbles: true, cancelable: true, detail });
|
|
8518
|
+
if (handler) currentTarget.addEventListener(name2, handler, { once: true });
|
|
8519
8519
|
if (discrete) {
|
|
8520
8520
|
dispatchDiscreteCustomEvent(currentTarget, event);
|
|
8521
8521
|
} else {
|
|
@@ -16246,6 +16246,17 @@ objectType({
|
|
|
16246
16246
|
token: stringType(),
|
|
16247
16247
|
token_type_hint: stringType().optional()
|
|
16248
16248
|
}).strip();
|
|
16249
|
+
const name = "@modelcontextprotocol/inspector-client";
|
|
16250
|
+
const version$1 = "0.17.0";
|
|
16251
|
+
const packageJson = {
|
|
16252
|
+
name,
|
|
16253
|
+
version: version$1
|
|
16254
|
+
};
|
|
16255
|
+
const CLIENT_IDENTITY = (() => {
|
|
16256
|
+
const [, name2 = packageJson.name] = packageJson.name.split("/");
|
|
16257
|
+
const version2 = packageJson.version;
|
|
16258
|
+
return { name: name2, version: version2 };
|
|
16259
|
+
})();
|
|
16249
16260
|
const SESSION_KEYS = {
|
|
16250
16261
|
CODE_VERIFIER: "mcp_code_verifier",
|
|
16251
16262
|
SERVER_URL: "mcp_server_url",
|
|
@@ -17041,14 +17052,9 @@ class InspectorOAuthClientProvider {
|
|
|
17041
17052
|
});
|
|
17042
17053
|
}
|
|
17043
17054
|
saveClientInformation(clientInformation) {
|
|
17044
|
-
const safeInfo = Object.fromEntries(
|
|
17045
|
-
Object.entries(clientInformation).filter(
|
|
17046
|
-
([key]) => key !== "client_secret"
|
|
17047
|
-
)
|
|
17048
|
-
);
|
|
17049
17055
|
saveClientInformationToSessionStorage({
|
|
17050
17056
|
serverUrl: this.serverUrl,
|
|
17051
|
-
clientInformation
|
|
17057
|
+
clientInformation,
|
|
17052
17058
|
isPreregistered: false
|
|
17053
17059
|
});
|
|
17054
17060
|
}
|
|
@@ -18225,9 +18231,9 @@ function requireUri_all() {
|
|
|
18225
18231
|
if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
|
|
18226
18232
|
if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
|
|
18227
18233
|
var fields = [];
|
|
18228
|
-
for (var
|
|
18229
|
-
if (headers[
|
|
18230
|
-
fields.push(
|
|
18234
|
+
for (var name2 in headers) {
|
|
18235
|
+
if (headers[name2] !== O[name2]) {
|
|
18236
|
+
fields.push(name2.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name2].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
|
|
18231
18237
|
}
|
|
18232
18238
|
}
|
|
18233
18239
|
if (fields.length) {
|
|
@@ -23263,9 +23269,9 @@ function requireAjv() {
|
|
|
23263
23269
|
}
|
|
23264
23270
|
return text.slice(0, -separator.length);
|
|
23265
23271
|
}
|
|
23266
|
-
function addFormat(
|
|
23272
|
+
function addFormat(name2, format2) {
|
|
23267
23273
|
if (typeof format2 == "string") format2 = new RegExp(format2);
|
|
23268
|
-
this._formats[
|
|
23274
|
+
this._formats[name2] = format2;
|
|
23269
23275
|
return this;
|
|
23270
23276
|
}
|
|
23271
23277
|
function addDefaultMetaSchema(self2) {
|
|
@@ -23287,15 +23293,15 @@ function requireAjv() {
|
|
|
23287
23293
|
else for (var key in optsSchemas) self2.addSchema(optsSchemas[key], key);
|
|
23288
23294
|
}
|
|
23289
23295
|
function addInitialFormats(self2) {
|
|
23290
|
-
for (var
|
|
23291
|
-
var format2 = self2._opts.formats[
|
|
23292
|
-
self2.addFormat(
|
|
23296
|
+
for (var name2 in self2._opts.formats) {
|
|
23297
|
+
var format2 = self2._opts.formats[name2];
|
|
23298
|
+
self2.addFormat(name2, format2);
|
|
23293
23299
|
}
|
|
23294
23300
|
}
|
|
23295
23301
|
function addInitialKeywords(self2) {
|
|
23296
|
-
for (var
|
|
23297
|
-
var keyword2 = self2._opts.keywords[
|
|
23298
|
-
self2.addKeyword(
|
|
23302
|
+
for (var name2 in self2._opts.keywords) {
|
|
23303
|
+
var keyword2 = self2._opts.keywords[name2];
|
|
23304
|
+
self2.addKeyword(name2, keyword2);
|
|
23299
23305
|
}
|
|
23300
23306
|
}
|
|
23301
23307
|
function checkUnique(self2, id) {
|
|
@@ -23377,9 +23383,9 @@ function generateDefaultValue(schema, propertyName, parentSchema) {
|
|
|
23377
23383
|
case "boolean":
|
|
23378
23384
|
return isRequired ? false : void 0;
|
|
23379
23385
|
case "array":
|
|
23380
|
-
return [];
|
|
23386
|
+
return isRequired ? [] : void 0;
|
|
23381
23387
|
case "object": {
|
|
23382
|
-
if (!schema.properties) return {};
|
|
23388
|
+
if (!schema.properties) return isRequired ? {} : void 0;
|
|
23383
23389
|
const obj = {};
|
|
23384
23390
|
Object.entries(schema.properties).forEach(([key, prop]) => {
|
|
23385
23391
|
if (isPropertyRequired(key, schema)) {
|
|
@@ -23389,7 +23395,7 @@ function generateDefaultValue(schema, propertyName, parentSchema) {
|
|
|
23389
23395
|
}
|
|
23390
23396
|
}
|
|
23391
23397
|
});
|
|
23392
|
-
return obj;
|
|
23398
|
+
return isRequired ? obj : Object.keys(obj).length > 0 ? obj : void 0;
|
|
23393
23399
|
}
|
|
23394
23400
|
case "null":
|
|
23395
23401
|
return null;
|
|
@@ -23428,6 +23434,21 @@ function normalizeUnionType(schema) {
|
|
|
23428
23434
|
}
|
|
23429
23435
|
return schema;
|
|
23430
23436
|
}
|
|
23437
|
+
function cleanParams(params, schema) {
|
|
23438
|
+
const cleaned = {};
|
|
23439
|
+
const required2 = schema.required || [];
|
|
23440
|
+
for (const [key, value] of Object.entries(params)) {
|
|
23441
|
+
const isFieldRequired = required2.includes(key);
|
|
23442
|
+
if (isFieldRequired) {
|
|
23443
|
+
cleaned[key] = value;
|
|
23444
|
+
} else {
|
|
23445
|
+
if (value !== void 0 && value !== "" && value !== null) {
|
|
23446
|
+
cleaned[key] = value;
|
|
23447
|
+
}
|
|
23448
|
+
}
|
|
23449
|
+
}
|
|
23450
|
+
return cleaned;
|
|
23451
|
+
}
|
|
23431
23452
|
const DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
23432
23453
|
class Protocol {
|
|
23433
23454
|
constructor(_options) {
|
|
@@ -24908,10 +24929,6 @@ class StreamableHTTPClientTransport {
|
|
|
24908
24929
|
return this._protocolVersion;
|
|
24909
24930
|
}
|
|
24910
24931
|
}
|
|
24911
|
-
const version$1 = "0.16.8";
|
|
24912
|
-
const packageJson = {
|
|
24913
|
-
version: version$1
|
|
24914
|
-
};
|
|
24915
24932
|
const getSearchParam = (key) => {
|
|
24916
24933
|
try {
|
|
24917
24934
|
const url = new URL(window.location.href);
|
|
@@ -25038,6 +25055,7 @@ function useConnection({
|
|
|
25038
25055
|
oauthClientId,
|
|
25039
25056
|
oauthScope,
|
|
25040
25057
|
config,
|
|
25058
|
+
connectionType = "proxy",
|
|
25041
25059
|
onNotification,
|
|
25042
25060
|
onPendingRequest,
|
|
25043
25061
|
onElicitationRequest,
|
|
@@ -25053,6 +25071,10 @@ function useConnection({
|
|
|
25053
25071
|
);
|
|
25054
25072
|
const [requestHistory, setRequestHistory] = reactExports.useState([]);
|
|
25055
25073
|
const [completionsSupported, setCompletionsSupported] = reactExports.useState(false);
|
|
25074
|
+
const [mcpSessionId, setMcpSessionId] = reactExports.useState(null);
|
|
25075
|
+
const [mcpProtocolVersion, setMcpProtocolVersion] = reactExports.useState(
|
|
25076
|
+
null
|
|
25077
|
+
);
|
|
25056
25078
|
reactExports.useEffect(() => {
|
|
25057
25079
|
if (!oauthClientId) {
|
|
25058
25080
|
clearClientInformationFromSessionStorage({
|
|
@@ -25232,38 +25254,64 @@ function useConnection({
|
|
|
25232
25254
|
}
|
|
25233
25255
|
return false;
|
|
25234
25256
|
};
|
|
25257
|
+
const captureResponseHeaders = (response) => {
|
|
25258
|
+
const sessionId = response.headers.get("mcp-session-id");
|
|
25259
|
+
const protocolVersion = response.headers.get("mcp-protocol-version");
|
|
25260
|
+
if (sessionId && sessionId !== mcpSessionId) {
|
|
25261
|
+
setMcpSessionId(sessionId);
|
|
25262
|
+
}
|
|
25263
|
+
if (protocolVersion && protocolVersion !== mcpProtocolVersion) {
|
|
25264
|
+
setMcpProtocolVersion(protocolVersion);
|
|
25265
|
+
}
|
|
25266
|
+
};
|
|
25235
25267
|
const connect = async (_e2, retryCount = 0) => {
|
|
25236
25268
|
var _a;
|
|
25237
|
-
const
|
|
25238
|
-
{
|
|
25239
|
-
|
|
25240
|
-
|
|
25241
|
-
|
|
25242
|
-
|
|
25243
|
-
capabilities: {
|
|
25244
|
-
sampling: {},
|
|
25245
|
-
elicitation: {},
|
|
25246
|
-
roots: {
|
|
25247
|
-
listChanged: true
|
|
25248
|
-
}
|
|
25269
|
+
const clientCapabilities = {
|
|
25270
|
+
capabilities: {
|
|
25271
|
+
sampling: {},
|
|
25272
|
+
elicitation: {},
|
|
25273
|
+
roots: {
|
|
25274
|
+
listChanged: true
|
|
25249
25275
|
}
|
|
25250
25276
|
}
|
|
25277
|
+
};
|
|
25278
|
+
const client2 = new Client(
|
|
25279
|
+
CLIENT_IDENTITY,
|
|
25280
|
+
clientCapabilities
|
|
25251
25281
|
);
|
|
25252
|
-
|
|
25253
|
-
|
|
25254
|
-
|
|
25255
|
-
|
|
25256
|
-
|
|
25282
|
+
if (connectionType === "proxy") {
|
|
25283
|
+
try {
|
|
25284
|
+
await checkProxyHealth();
|
|
25285
|
+
} catch {
|
|
25286
|
+
setConnectionStatus("error-connecting-to-proxy");
|
|
25287
|
+
return;
|
|
25288
|
+
}
|
|
25257
25289
|
}
|
|
25258
25290
|
let lastRequest = "";
|
|
25259
25291
|
try {
|
|
25260
25292
|
const headers = {};
|
|
25261
25293
|
const serverAuthProvider = new InspectorOAuthClientProvider(sseUrl);
|
|
25262
25294
|
let finalHeaders = customHeaders || [];
|
|
25263
|
-
|
|
25295
|
+
const isEmptyAuthHeader = (header) => header.name.trim().toLowerCase() === "authorization" && header.value.trim().toLowerCase() === "bearer";
|
|
25296
|
+
const hasEmptyAuthHeader = finalHeaders.some(
|
|
25297
|
+
(header) => header.enabled && isEmptyAuthHeader(header)
|
|
25298
|
+
);
|
|
25299
|
+
if (hasEmptyAuthHeader) {
|
|
25300
|
+
toast2({
|
|
25301
|
+
title: "Invalid Authorization Header",
|
|
25302
|
+
description: "Authorization header is enabled but empty. Please add a token or disable the header.",
|
|
25303
|
+
variant: "destructive"
|
|
25304
|
+
});
|
|
25305
|
+
}
|
|
25306
|
+
const needsOAuthToken = !finalHeaders.some(
|
|
25307
|
+
(header) => header.enabled && header.name.trim().toLowerCase() === "authorization"
|
|
25308
|
+
);
|
|
25309
|
+
if (needsOAuthToken) {
|
|
25264
25310
|
const oauthToken = (_a = await serverAuthProvider.tokens()) == null ? void 0 : _a.access_token;
|
|
25265
25311
|
if (oauthToken) {
|
|
25266
25312
|
finalHeaders = [
|
|
25313
|
+
// Remove any existing Authorization headers with empty tokens
|
|
25314
|
+
...finalHeaders.filter((header) => !isEmptyAuthHeader(header)),
|
|
25267
25315
|
{
|
|
25268
25316
|
name: "Authorization",
|
|
25269
25317
|
value: `Bearer ${oauthToken}`,
|
|
@@ -25286,90 +25334,140 @@ function useConnection({
|
|
|
25286
25334
|
if (customHeaderNames.length > 0) {
|
|
25287
25335
|
headers["x-custom-auth-headers"] = JSON.stringify(customHeaderNames);
|
|
25288
25336
|
}
|
|
25289
|
-
const { token: proxyAuthToken, header: proxyAuthTokenHeader } = getMCPProxyAuthToken(config);
|
|
25290
|
-
const proxyHeaders = {};
|
|
25291
|
-
if (proxyAuthToken) {
|
|
25292
|
-
proxyHeaders[proxyAuthTokenHeader] = `Bearer ${proxyAuthToken}`;
|
|
25293
|
-
}
|
|
25294
25337
|
let transportOptions;
|
|
25295
|
-
let
|
|
25296
|
-
|
|
25297
|
-
|
|
25298
|
-
|
|
25299
|
-
|
|
25300
|
-
|
|
25301
|
-
|
|
25302
|
-
|
|
25303
|
-
|
|
25304
|
-
|
|
25305
|
-
|
|
25306
|
-
|
|
25307
|
-
|
|
25308
|
-
|
|
25309
|
-
|
|
25310
|
-
|
|
25311
|
-
|
|
25312
|
-
|
|
25313
|
-
|
|
25338
|
+
let serverUrl;
|
|
25339
|
+
if (connectionType === "direct" && transportType !== "stdio") {
|
|
25340
|
+
serverUrl = new URL(sseUrl);
|
|
25341
|
+
const requestHeaders = { ...headers };
|
|
25342
|
+
if (mcpSessionId) {
|
|
25343
|
+
requestHeaders["mcp-session-id"] = mcpSessionId;
|
|
25344
|
+
}
|
|
25345
|
+
switch (transportType) {
|
|
25346
|
+
case "sse":
|
|
25347
|
+
requestHeaders["Accept"] = "text/event-stream";
|
|
25348
|
+
requestHeaders["content-type"] = "application/json";
|
|
25349
|
+
transportOptions = {
|
|
25350
|
+
fetch: async (url, init) => {
|
|
25351
|
+
const response = await fetch(url, {
|
|
25352
|
+
...init,
|
|
25353
|
+
headers: requestHeaders
|
|
25354
|
+
});
|
|
25355
|
+
captureResponseHeaders(response);
|
|
25356
|
+
return response;
|
|
25357
|
+
},
|
|
25358
|
+
requestInit: {
|
|
25359
|
+
headers: requestHeaders
|
|
25360
|
+
}
|
|
25361
|
+
};
|
|
25362
|
+
break;
|
|
25363
|
+
case "streamable-http":
|
|
25364
|
+
transportOptions = {
|
|
25365
|
+
fetch: async (url, init) => {
|
|
25366
|
+
requestHeaders["Accept"] = "text/event-stream, application/json";
|
|
25367
|
+
requestHeaders["Content-Type"] = "application/json";
|
|
25368
|
+
const response = await fetch(url, {
|
|
25369
|
+
headers: requestHeaders,
|
|
25370
|
+
...init
|
|
25371
|
+
});
|
|
25372
|
+
captureResponseHeaders(response);
|
|
25373
|
+
return response;
|
|
25374
|
+
},
|
|
25375
|
+
requestInit: {
|
|
25376
|
+
headers: requestHeaders
|
|
25377
|
+
},
|
|
25378
|
+
// TODO these should be configurable...
|
|
25379
|
+
reconnectionOptions: {
|
|
25380
|
+
maxReconnectionDelay: 3e4,
|
|
25381
|
+
initialReconnectionDelay: 1e3,
|
|
25382
|
+
reconnectionDelayGrowFactor: 1.5,
|
|
25383
|
+
maxRetries: 2
|
|
25384
|
+
}
|
|
25385
|
+
};
|
|
25386
|
+
break;
|
|
25387
|
+
}
|
|
25388
|
+
} else {
|
|
25389
|
+
const { token: proxyAuthToken, header: proxyAuthTokenHeader } = getMCPProxyAuthToken(config);
|
|
25390
|
+
const proxyHeaders = {};
|
|
25391
|
+
if (proxyAuthToken) {
|
|
25392
|
+
proxyHeaders[proxyAuthTokenHeader] = `Bearer ${proxyAuthToken}`;
|
|
25393
|
+
}
|
|
25394
|
+
let mcpProxyServerUrl;
|
|
25395
|
+
switch (transportType) {
|
|
25396
|
+
case "stdio": {
|
|
25397
|
+
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/stdio`);
|
|
25398
|
+
mcpProxyServerUrl.searchParams.append("command", command);
|
|
25399
|
+
mcpProxyServerUrl.searchParams.append("args", args);
|
|
25400
|
+
mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env));
|
|
25401
|
+
const proxyFullAddress = config.MCP_PROXY_FULL_ADDRESS.value;
|
|
25402
|
+
if (proxyFullAddress) {
|
|
25403
|
+
mcpProxyServerUrl.searchParams.append(
|
|
25404
|
+
"proxyFullAddress",
|
|
25405
|
+
proxyFullAddress
|
|
25406
|
+
);
|
|
25407
|
+
}
|
|
25408
|
+
transportOptions = {
|
|
25409
|
+
authProvider: serverAuthProvider,
|
|
25410
|
+
eventSourceInit: {
|
|
25411
|
+
fetch: (url, init) => fetch(url, {
|
|
25412
|
+
...init,
|
|
25413
|
+
headers: { ...headers, ...proxyHeaders }
|
|
25414
|
+
})
|
|
25415
|
+
},
|
|
25416
|
+
requestInit: {
|
|
25314
25417
|
headers: { ...headers, ...proxyHeaders }
|
|
25315
|
-
}
|
|
25316
|
-
}
|
|
25317
|
-
|
|
25318
|
-
|
|
25418
|
+
}
|
|
25419
|
+
};
|
|
25420
|
+
break;
|
|
25421
|
+
}
|
|
25422
|
+
case "sse": {
|
|
25423
|
+
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/sse`);
|
|
25424
|
+
mcpProxyServerUrl.searchParams.append("url", sseUrl);
|
|
25425
|
+
const proxyFullAddressSSE = config.MCP_PROXY_FULL_ADDRESS.value;
|
|
25426
|
+
if (proxyFullAddressSSE) {
|
|
25427
|
+
mcpProxyServerUrl.searchParams.append(
|
|
25428
|
+
"proxyFullAddress",
|
|
25429
|
+
proxyFullAddressSSE
|
|
25430
|
+
);
|
|
25319
25431
|
}
|
|
25320
|
-
|
|
25321
|
-
|
|
25322
|
-
|
|
25323
|
-
|
|
25324
|
-
|
|
25325
|
-
|
|
25326
|
-
|
|
25327
|
-
|
|
25328
|
-
|
|
25329
|
-
|
|
25330
|
-
|
|
25331
|
-
|
|
25432
|
+
transportOptions = {
|
|
25433
|
+
eventSourceInit: {
|
|
25434
|
+
fetch: (url, init) => fetch(url, {
|
|
25435
|
+
...init,
|
|
25436
|
+
headers: { ...headers, ...proxyHeaders }
|
|
25437
|
+
})
|
|
25438
|
+
},
|
|
25439
|
+
requestInit: {
|
|
25440
|
+
headers: { ...headers, ...proxyHeaders }
|
|
25441
|
+
}
|
|
25442
|
+
};
|
|
25443
|
+
break;
|
|
25332
25444
|
}
|
|
25333
|
-
|
|
25334
|
-
|
|
25335
|
-
|
|
25336
|
-
|
|
25445
|
+
case "streamable-http":
|
|
25446
|
+
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/mcp`);
|
|
25447
|
+
mcpProxyServerUrl.searchParams.append("url", sseUrl);
|
|
25448
|
+
transportOptions = {
|
|
25449
|
+
eventSourceInit: {
|
|
25450
|
+
fetch: (url, init) => fetch(url, {
|
|
25451
|
+
...init,
|
|
25452
|
+
headers: { ...headers, ...proxyHeaders }
|
|
25453
|
+
})
|
|
25454
|
+
},
|
|
25455
|
+
requestInit: {
|
|
25337
25456
|
headers: { ...headers, ...proxyHeaders }
|
|
25338
|
-
}
|
|
25339
|
-
|
|
25340
|
-
|
|
25341
|
-
|
|
25342
|
-
|
|
25343
|
-
|
|
25344
|
-
|
|
25457
|
+
},
|
|
25458
|
+
// TODO these should be configurable...
|
|
25459
|
+
reconnectionOptions: {
|
|
25460
|
+
maxReconnectionDelay: 3e4,
|
|
25461
|
+
initialReconnectionDelay: 1e3,
|
|
25462
|
+
reconnectionDelayGrowFactor: 1.5,
|
|
25463
|
+
maxRetries: 2
|
|
25464
|
+
}
|
|
25465
|
+
};
|
|
25466
|
+
break;
|
|
25345
25467
|
}
|
|
25346
|
-
|
|
25347
|
-
|
|
25348
|
-
mcpProxyServerUrl.searchParams.append("url", sseUrl);
|
|
25349
|
-
transportOptions = {
|
|
25350
|
-
eventSourceInit: {
|
|
25351
|
-
fetch: (url, init) => fetch(url, {
|
|
25352
|
-
...init,
|
|
25353
|
-
headers: { ...headers, ...proxyHeaders }
|
|
25354
|
-
})
|
|
25355
|
-
},
|
|
25356
|
-
requestInit: {
|
|
25357
|
-
headers: { ...headers, ...proxyHeaders }
|
|
25358
|
-
},
|
|
25359
|
-
// TODO these should be configurable...
|
|
25360
|
-
reconnectionOptions: {
|
|
25361
|
-
maxReconnectionDelay: 3e4,
|
|
25362
|
-
initialReconnectionDelay: 1e3,
|
|
25363
|
-
reconnectionDelayGrowFactor: 1.5,
|
|
25364
|
-
maxRetries: 2
|
|
25365
|
-
}
|
|
25366
|
-
};
|
|
25367
|
-
break;
|
|
25468
|
+
serverUrl = mcpProxyServerUrl;
|
|
25469
|
+
serverUrl.searchParams.append("transportType", transportType);
|
|
25368
25470
|
}
|
|
25369
|
-
mcpProxyServerUrl.searchParams.append(
|
|
25370
|
-
"transportType",
|
|
25371
|
-
transportType
|
|
25372
|
-
);
|
|
25373
25471
|
if (onNotification) {
|
|
25374
25472
|
[
|
|
25375
25473
|
CancelledNotificationSchema,
|
|
@@ -25388,13 +25486,10 @@ function useConnection({
|
|
|
25388
25486
|
}
|
|
25389
25487
|
let capabilities;
|
|
25390
25488
|
try {
|
|
25391
|
-
const transport = transportType === "streamable-http" ? new StreamableHTTPClientTransport(
|
|
25489
|
+
const transport = transportType === "streamable-http" ? new StreamableHTTPClientTransport(serverUrl, {
|
|
25392
25490
|
sessionId: void 0,
|
|
25393
25491
|
...transportOptions
|
|
25394
|
-
}) : new SSEClientTransport(
|
|
25395
|
-
mcpProxyServerUrl,
|
|
25396
|
-
transportOptions
|
|
25397
|
-
);
|
|
25492
|
+
}) : new SSEClientTransport(serverUrl, transportOptions);
|
|
25398
25493
|
await client2.connect(transport);
|
|
25399
25494
|
setClientTransport(transport);
|
|
25400
25495
|
capabilities = client2.getServerCapabilities();
|
|
@@ -25408,7 +25503,7 @@ function useConnection({
|
|
|
25408
25503
|
});
|
|
25409
25504
|
} catch (error) {
|
|
25410
25505
|
console.error(
|
|
25411
|
-
`Failed to connect to MCP Server via the MCP Inspector Proxy: ${
|
|
25506
|
+
connectionType === "direct" ? `Failed to connect directly to MCP Server at: ${serverUrl}:` : `Failed to connect to MCP Server via the MCP Inspector Proxy: ${serverUrl}:`,
|
|
25412
25507
|
error
|
|
25413
25508
|
);
|
|
25414
25509
|
if (isProxyAuthError(error)) {
|
|
@@ -25489,6 +25584,8 @@ function useConnection({
|
|
|
25489
25584
|
setConnectionStatus("disconnected");
|
|
25490
25585
|
setCompletionsSupported(false);
|
|
25491
25586
|
setServerCapabilities(null);
|
|
25587
|
+
setMcpSessionId(null);
|
|
25588
|
+
setMcpProtocolVersion(null);
|
|
25492
25589
|
};
|
|
25493
25590
|
const clearRequestHistory = () => {
|
|
25494
25591
|
setRequestHistory([]);
|
|
@@ -26177,7 +26274,7 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
26177
26274
|
* This source code is licensed under the ISC license.
|
|
26178
26275
|
* See the LICENSE file in the root directory of this source tree.
|
|
26179
26276
|
*/
|
|
26180
|
-
const __iconNode$
|
|
26277
|
+
const __iconNode$z = [
|
|
26181
26278
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
|
|
26182
26279
|
[
|
|
26183
26280
|
"path",
|
|
@@ -26187,14 +26284,14 @@ const __iconNode$y = [
|
|
|
26187
26284
|
}
|
|
26188
26285
|
]
|
|
26189
26286
|
];
|
|
26190
|
-
const Bell = createLucideIcon("bell", __iconNode$
|
|
26287
|
+
const Bell = createLucideIcon("bell", __iconNode$z);
|
|
26191
26288
|
/**
|
|
26192
26289
|
* @license lucide-react v0.523.0 - ISC
|
|
26193
26290
|
*
|
|
26194
26291
|
* This source code is licensed under the ISC license.
|
|
26195
26292
|
* See the LICENSE file in the root directory of this source tree.
|
|
26196
26293
|
*/
|
|
26197
|
-
const __iconNode$
|
|
26294
|
+
const __iconNode$y = [
|
|
26198
26295
|
["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
|
|
26199
26296
|
["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
|
|
26200
26297
|
["path", { d: "M9 7.13v-1a3.003 3.003 0 1 1 6 0v1", key: "d7y7pr" }],
|
|
@@ -26213,134 +26310,134 @@ const __iconNode$x = [
|
|
|
26213
26310
|
["path", { d: "M22 13h-4", key: "1jl80f" }],
|
|
26214
26311
|
["path", { d: "M17.2 17c2.1.1 3.8 1.9 3.8 4", key: "k3fwyw" }]
|
|
26215
26312
|
];
|
|
26216
|
-
const Bug = createLucideIcon("bug", __iconNode$
|
|
26313
|
+
const Bug = createLucideIcon("bug", __iconNode$y);
|
|
26217
26314
|
/**
|
|
26218
26315
|
* @license lucide-react v0.523.0 - ISC
|
|
26219
26316
|
*
|
|
26220
26317
|
* This source code is licensed under the ISC license.
|
|
26221
26318
|
* See the LICENSE file in the root directory of this source tree.
|
|
26222
26319
|
*/
|
|
26223
|
-
const __iconNode$
|
|
26320
|
+
const __iconNode$x = [
|
|
26224
26321
|
["path", { d: "M18 6 7 17l-5-5", key: "116fxf" }],
|
|
26225
26322
|
["path", { d: "m22 10-7.5 7.5L13 16", key: "ke71qq" }]
|
|
26226
26323
|
];
|
|
26227
|
-
const CheckCheck = createLucideIcon("check-check", __iconNode$
|
|
26324
|
+
const CheckCheck = createLucideIcon("check-check", __iconNode$x);
|
|
26228
26325
|
/**
|
|
26229
26326
|
* @license lucide-react v0.523.0 - ISC
|
|
26230
26327
|
*
|
|
26231
26328
|
* This source code is licensed under the ISC license.
|
|
26232
26329
|
* See the LICENSE file in the root directory of this source tree.
|
|
26233
26330
|
*/
|
|
26234
|
-
const __iconNode$
|
|
26235
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
26331
|
+
const __iconNode$w = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
26332
|
+
const Check = createLucideIcon("check", __iconNode$w);
|
|
26236
26333
|
/**
|
|
26237
26334
|
* @license lucide-react v0.523.0 - ISC
|
|
26238
26335
|
*
|
|
26239
26336
|
* This source code is licensed under the ISC license.
|
|
26240
26337
|
* See the LICENSE file in the root directory of this source tree.
|
|
26241
26338
|
*/
|
|
26242
|
-
const __iconNode$
|
|
26243
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
26339
|
+
const __iconNode$v = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
26340
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$v);
|
|
26244
26341
|
/**
|
|
26245
26342
|
* @license lucide-react v0.523.0 - ISC
|
|
26246
26343
|
*
|
|
26247
26344
|
* This source code is licensed under the ISC license.
|
|
26248
26345
|
* See the LICENSE file in the root directory of this source tree.
|
|
26249
26346
|
*/
|
|
26250
|
-
const __iconNode$
|
|
26251
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
26347
|
+
const __iconNode$u = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
26348
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$u);
|
|
26252
26349
|
/**
|
|
26253
26350
|
* @license lucide-react v0.523.0 - ISC
|
|
26254
26351
|
*
|
|
26255
26352
|
* This source code is licensed under the ISC license.
|
|
26256
26353
|
* See the LICENSE file in the root directory of this source tree.
|
|
26257
26354
|
*/
|
|
26258
|
-
const __iconNode$
|
|
26259
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode$
|
|
26355
|
+
const __iconNode$t = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
26356
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$t);
|
|
26260
26357
|
/**
|
|
26261
26358
|
* @license lucide-react v0.523.0 - ISC
|
|
26262
26359
|
*
|
|
26263
26360
|
* This source code is licensed under the ISC license.
|
|
26264
26361
|
* See the LICENSE file in the root directory of this source tree.
|
|
26265
26362
|
*/
|
|
26266
|
-
const __iconNode$
|
|
26363
|
+
const __iconNode$s = [
|
|
26267
26364
|
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
26268
26365
|
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
26269
26366
|
];
|
|
26270
|
-
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$
|
|
26367
|
+
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$s);
|
|
26271
26368
|
/**
|
|
26272
26369
|
* @license lucide-react v0.523.0 - ISC
|
|
26273
26370
|
*
|
|
26274
26371
|
* This source code is licensed under the ISC license.
|
|
26275
26372
|
* See the LICENSE file in the root directory of this source tree.
|
|
26276
26373
|
*/
|
|
26277
|
-
const __iconNode$
|
|
26374
|
+
const __iconNode$r = [
|
|
26278
26375
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
26279
26376
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
26280
26377
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
26281
26378
|
];
|
|
26282
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
26379
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$r);
|
|
26283
26380
|
/**
|
|
26284
26381
|
* @license lucide-react v0.523.0 - ISC
|
|
26285
26382
|
*
|
|
26286
26383
|
* This source code is licensed under the ISC license.
|
|
26287
26384
|
* See the LICENSE file in the root directory of this source tree.
|
|
26288
26385
|
*/
|
|
26289
|
-
const __iconNode$
|
|
26386
|
+
const __iconNode$q = [
|
|
26290
26387
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
26291
26388
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
26292
26389
|
];
|
|
26293
|
-
const CircleCheck = createLucideIcon("circle-check", __iconNode$
|
|
26390
|
+
const CircleCheck = createLucideIcon("circle-check", __iconNode$q);
|
|
26294
26391
|
/**
|
|
26295
26392
|
* @license lucide-react v0.523.0 - ISC
|
|
26296
26393
|
*
|
|
26297
26394
|
* This source code is licensed under the ISC license.
|
|
26298
26395
|
* See the LICENSE file in the root directory of this source tree.
|
|
26299
26396
|
*/
|
|
26300
|
-
const __iconNode$
|
|
26397
|
+
const __iconNode$p = [
|
|
26301
26398
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
26302
26399
|
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
26303
26400
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
26304
26401
|
];
|
|
26305
|
-
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$
|
|
26402
|
+
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$p);
|
|
26306
26403
|
/**
|
|
26307
26404
|
* @license lucide-react v0.523.0 - ISC
|
|
26308
26405
|
*
|
|
26309
26406
|
* This source code is licensed under the ISC license.
|
|
26310
26407
|
* See the LICENSE file in the root directory of this source tree.
|
|
26311
26408
|
*/
|
|
26312
|
-
const __iconNode$
|
|
26313
|
-
const Circle = createLucideIcon("circle", __iconNode$
|
|
26409
|
+
const __iconNode$o = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
26410
|
+
const Circle = createLucideIcon("circle", __iconNode$o);
|
|
26314
26411
|
/**
|
|
26315
26412
|
* @license lucide-react v0.523.0 - ISC
|
|
26316
26413
|
*
|
|
26317
26414
|
* This source code is licensed under the ISC license.
|
|
26318
26415
|
* See the LICENSE file in the root directory of this source tree.
|
|
26319
26416
|
*/
|
|
26320
|
-
const __iconNode$
|
|
26417
|
+
const __iconNode$n = [
|
|
26321
26418
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
26322
26419
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
26323
26420
|
];
|
|
26324
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
26421
|
+
const Copy = createLucideIcon("copy", __iconNode$n);
|
|
26325
26422
|
/**
|
|
26326
26423
|
* @license lucide-react v0.523.0 - ISC
|
|
26327
26424
|
*
|
|
26328
26425
|
* This source code is licensed under the ISC license.
|
|
26329
26426
|
* See the LICENSE file in the root directory of this source tree.
|
|
26330
26427
|
*/
|
|
26331
|
-
const __iconNode$
|
|
26428
|
+
const __iconNode$m = [
|
|
26332
26429
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
26333
26430
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
26334
26431
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
26335
26432
|
];
|
|
26336
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
26433
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$m);
|
|
26337
26434
|
/**
|
|
26338
26435
|
* @license lucide-react v0.523.0 - ISC
|
|
26339
26436
|
*
|
|
26340
26437
|
* This source code is licensed under the ISC license.
|
|
26341
26438
|
* See the LICENSE file in the root directory of this source tree.
|
|
26342
26439
|
*/
|
|
26343
|
-
const __iconNode$
|
|
26440
|
+
const __iconNode$l = [
|
|
26344
26441
|
[
|
|
26345
26442
|
"path",
|
|
26346
26443
|
{
|
|
@@ -26358,14 +26455,14 @@ const __iconNode$k = [
|
|
|
26358
26455
|
],
|
|
26359
26456
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
26360
26457
|
];
|
|
26361
|
-
const EyeOff = createLucideIcon("eye-off", __iconNode$
|
|
26458
|
+
const EyeOff = createLucideIcon("eye-off", __iconNode$l);
|
|
26362
26459
|
/**
|
|
26363
26460
|
* @license lucide-react v0.523.0 - ISC
|
|
26364
26461
|
*
|
|
26365
26462
|
* This source code is licensed under the ISC license.
|
|
26366
26463
|
* See the LICENSE file in the root directory of this source tree.
|
|
26367
26464
|
*/
|
|
26368
|
-
const __iconNode$
|
|
26465
|
+
const __iconNode$k = [
|
|
26369
26466
|
[
|
|
26370
26467
|
"path",
|
|
26371
26468
|
{
|
|
@@ -26375,40 +26472,40 @@ const __iconNode$j = [
|
|
|
26375
26472
|
],
|
|
26376
26473
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
26377
26474
|
];
|
|
26378
|
-
const Eye = createLucideIcon("eye", __iconNode$
|
|
26475
|
+
const Eye = createLucideIcon("eye", __iconNode$k);
|
|
26379
26476
|
/**
|
|
26380
26477
|
* @license lucide-react v0.523.0 - ISC
|
|
26381
26478
|
*
|
|
26382
26479
|
* This source code is licensed under the ISC license.
|
|
26383
26480
|
* See the LICENSE file in the root directory of this source tree.
|
|
26384
26481
|
*/
|
|
26385
|
-
const __iconNode$
|
|
26482
|
+
const __iconNode$j = [
|
|
26386
26483
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
26387
26484
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
26388
26485
|
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
26389
26486
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
26390
26487
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
26391
26488
|
];
|
|
26392
|
-
const FileText = createLucideIcon("file-text", __iconNode$
|
|
26489
|
+
const FileText = createLucideIcon("file-text", __iconNode$j);
|
|
26393
26490
|
/**
|
|
26394
26491
|
* @license lucide-react v0.523.0 - ISC
|
|
26395
26492
|
*
|
|
26396
26493
|
* This source code is licensed under the ISC license.
|
|
26397
26494
|
* See the LICENSE file in the root directory of this source tree.
|
|
26398
26495
|
*/
|
|
26399
|
-
const __iconNode$
|
|
26496
|
+
const __iconNode$i = [
|
|
26400
26497
|
["path", { d: "M20 7h-3a2 2 0 0 1-2-2V2", key: "x099mo" }],
|
|
26401
26498
|
["path", { d: "M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z", key: "18t6ie" }],
|
|
26402
26499
|
["path", { d: "M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8", key: "1nja0z" }]
|
|
26403
26500
|
];
|
|
26404
|
-
const Files = createLucideIcon("files", __iconNode$
|
|
26501
|
+
const Files = createLucideIcon("files", __iconNode$i);
|
|
26405
26502
|
/**
|
|
26406
26503
|
* @license lucide-react v0.523.0 - ISC
|
|
26407
26504
|
*
|
|
26408
26505
|
* This source code is licensed under the ISC license.
|
|
26409
26506
|
* See the LICENSE file in the root directory of this source tree.
|
|
26410
26507
|
*/
|
|
26411
|
-
const __iconNode$
|
|
26508
|
+
const __iconNode$h = [
|
|
26412
26509
|
[
|
|
26413
26510
|
"path",
|
|
26414
26511
|
{
|
|
@@ -26426,14 +26523,14 @@ const __iconNode$g = [
|
|
|
26426
26523
|
["path", { d: "M3 5a2 2 0 0 0 2 2h3", key: "f2jnh7" }],
|
|
26427
26524
|
["path", { d: "M3 3v13a2 2 0 0 0 2 2h3", key: "k8epm1" }]
|
|
26428
26525
|
];
|
|
26429
|
-
const FolderTree = createLucideIcon("folder-tree", __iconNode$
|
|
26526
|
+
const FolderTree = createLucideIcon("folder-tree", __iconNode$h);
|
|
26430
26527
|
/**
|
|
26431
26528
|
* @license lucide-react v0.523.0 - ISC
|
|
26432
26529
|
*
|
|
26433
26530
|
* This source code is licensed under the ISC license.
|
|
26434
26531
|
* See the LICENSE file in the root directory of this source tree.
|
|
26435
26532
|
*/
|
|
26436
|
-
const __iconNode$
|
|
26533
|
+
const __iconNode$g = [
|
|
26437
26534
|
[
|
|
26438
26535
|
"path",
|
|
26439
26536
|
{
|
|
@@ -26443,14 +26540,14 @@ const __iconNode$f = [
|
|
|
26443
26540
|
],
|
|
26444
26541
|
["path", { d: "M9 18c-4.51 2-5-2-7-2", key: "9comsn" }]
|
|
26445
26542
|
];
|
|
26446
|
-
const Github = createLucideIcon("github", __iconNode$
|
|
26543
|
+
const Github = createLucideIcon("github", __iconNode$g);
|
|
26447
26544
|
/**
|
|
26448
26545
|
* @license lucide-react v0.523.0 - ISC
|
|
26449
26546
|
*
|
|
26450
26547
|
* This source code is licensed under the ISC license.
|
|
26451
26548
|
* See the LICENSE file in the root directory of this source tree.
|
|
26452
26549
|
*/
|
|
26453
|
-
const __iconNode$
|
|
26550
|
+
const __iconNode$f = [
|
|
26454
26551
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
26455
26552
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
26456
26553
|
[
|
|
@@ -26461,84 +26558,84 @@ const __iconNode$e = [
|
|
|
26461
26558
|
}
|
|
26462
26559
|
]
|
|
26463
26560
|
];
|
|
26464
|
-
const Hammer = createLucideIcon("hammer", __iconNode$
|
|
26561
|
+
const Hammer = createLucideIcon("hammer", __iconNode$f);
|
|
26465
26562
|
/**
|
|
26466
26563
|
* @license lucide-react v0.523.0 - ISC
|
|
26467
26564
|
*
|
|
26468
26565
|
* This source code is licensed under the ISC license.
|
|
26469
26566
|
* See the LICENSE file in the root directory of this source tree.
|
|
26470
26567
|
*/
|
|
26471
|
-
const __iconNode$
|
|
26568
|
+
const __iconNode$e = [
|
|
26472
26569
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
26473
26570
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
26474
26571
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
26475
26572
|
["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
|
|
26476
26573
|
];
|
|
26477
|
-
const Hash = createLucideIcon("hash", __iconNode$
|
|
26574
|
+
const Hash = createLucideIcon("hash", __iconNode$e);
|
|
26478
26575
|
/**
|
|
26479
26576
|
* @license lucide-react v0.523.0 - ISC
|
|
26480
26577
|
*
|
|
26481
26578
|
* This source code is licensed under the ISC license.
|
|
26482
26579
|
* See the LICENSE file in the root directory of this source tree.
|
|
26483
26580
|
*/
|
|
26484
|
-
const __iconNode$
|
|
26581
|
+
const __iconNode$d = [
|
|
26485
26582
|
["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
|
|
26486
26583
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
26487
26584
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
26488
26585
|
];
|
|
26489
|
-
const Key = createLucideIcon("key", __iconNode$
|
|
26586
|
+
const Key = createLucideIcon("key", __iconNode$d);
|
|
26490
26587
|
/**
|
|
26491
26588
|
* @license lucide-react v0.523.0 - ISC
|
|
26492
26589
|
*
|
|
26493
26590
|
* This source code is licensed under the ISC license.
|
|
26494
26591
|
* See the LICENSE file in the root directory of this source tree.
|
|
26495
26592
|
*/
|
|
26496
|
-
const __iconNode$
|
|
26497
|
-
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$
|
|
26593
|
+
const __iconNode$c = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
26594
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$c);
|
|
26498
26595
|
/**
|
|
26499
26596
|
* @license lucide-react v0.523.0 - ISC
|
|
26500
26597
|
*
|
|
26501
26598
|
* This source code is licensed under the ISC license.
|
|
26502
26599
|
* See the LICENSE file in the root directory of this source tree.
|
|
26503
26600
|
*/
|
|
26504
|
-
const __iconNode$
|
|
26601
|
+
const __iconNode$b = [
|
|
26505
26602
|
["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }]
|
|
26506
26603
|
];
|
|
26507
|
-
const MessageSquare = createLucideIcon("message-square", __iconNode$
|
|
26604
|
+
const MessageSquare = createLucideIcon("message-square", __iconNode$b);
|
|
26508
26605
|
/**
|
|
26509
26606
|
* @license lucide-react v0.523.0 - ISC
|
|
26510
26607
|
*
|
|
26511
26608
|
* This source code is licensed under the ISC license.
|
|
26512
26609
|
* See the LICENSE file in the root directory of this source tree.
|
|
26513
26610
|
*/
|
|
26514
|
-
const __iconNode$
|
|
26515
|
-
const Minus = createLucideIcon("minus", __iconNode$
|
|
26611
|
+
const __iconNode$a = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
26612
|
+
const Minus = createLucideIcon("minus", __iconNode$a);
|
|
26516
26613
|
/**
|
|
26517
26614
|
* @license lucide-react v0.523.0 - ISC
|
|
26518
26615
|
*
|
|
26519
26616
|
* This source code is licensed under the ISC license.
|
|
26520
26617
|
* See the LICENSE file in the root directory of this source tree.
|
|
26521
26618
|
*/
|
|
26522
|
-
const __iconNode$
|
|
26523
|
-
const Play = createLucideIcon("play", __iconNode$
|
|
26619
|
+
const __iconNode$9 = [["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]];
|
|
26620
|
+
const Play = createLucideIcon("play", __iconNode$9);
|
|
26524
26621
|
/**
|
|
26525
26622
|
* @license lucide-react v0.523.0 - ISC
|
|
26526
26623
|
*
|
|
26527
26624
|
* This source code is licensed under the ISC license.
|
|
26528
26625
|
* See the LICENSE file in the root directory of this source tree.
|
|
26529
26626
|
*/
|
|
26530
|
-
const __iconNode$
|
|
26627
|
+
const __iconNode$8 = [
|
|
26531
26628
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
26532
26629
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
26533
26630
|
];
|
|
26534
|
-
const Plus = createLucideIcon("plus", __iconNode$
|
|
26631
|
+
const Plus = createLucideIcon("plus", __iconNode$8);
|
|
26535
26632
|
/**
|
|
26536
26633
|
* @license lucide-react v0.523.0 - ISC
|
|
26537
26634
|
*
|
|
26538
26635
|
* This source code is licensed under the ISC license.
|
|
26539
26636
|
* See the LICENSE file in the root directory of this source tree.
|
|
26540
26637
|
*/
|
|
26541
|
-
const __iconNode$
|
|
26638
|
+
const __iconNode$7 = [
|
|
26542
26639
|
["path", { d: "M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47", key: "1krf6h" }],
|
|
26543
26640
|
["path", { d: "M8 16H3v5", key: "1cv678" }],
|
|
26544
26641
|
["path", { d: "M3 12C3 9.51 4 7.26 5.64 5.64", key: "ruvoct" }],
|
|
@@ -26547,38 +26644,38 @@ const __iconNode$6 = [
|
|
|
26547
26644
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
26548
26645
|
["path", { d: "M22 22 2 2", key: "1r8tn9" }]
|
|
26549
26646
|
];
|
|
26550
|
-
const RefreshCwOff = createLucideIcon("refresh-cw-off", __iconNode$
|
|
26647
|
+
const RefreshCwOff = createLucideIcon("refresh-cw-off", __iconNode$7);
|
|
26551
26648
|
/**
|
|
26552
26649
|
* @license lucide-react v0.523.0 - ISC
|
|
26553
26650
|
*
|
|
26554
26651
|
* This source code is licensed under the ISC license.
|
|
26555
26652
|
* See the LICENSE file in the root directory of this source tree.
|
|
26556
26653
|
*/
|
|
26557
|
-
const __iconNode$
|
|
26654
|
+
const __iconNode$6 = [
|
|
26558
26655
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
26559
26656
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
26560
26657
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
26561
26658
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
26562
26659
|
];
|
|
26563
|
-
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$
|
|
26660
|
+
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$6);
|
|
26564
26661
|
/**
|
|
26565
26662
|
* @license lucide-react v0.523.0 - ISC
|
|
26566
26663
|
*
|
|
26567
26664
|
* This source code is licensed under the ISC license.
|
|
26568
26665
|
* See the LICENSE file in the root directory of this source tree.
|
|
26569
26666
|
*/
|
|
26570
|
-
const __iconNode$
|
|
26667
|
+
const __iconNode$5 = [
|
|
26571
26668
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
26572
26669
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
26573
26670
|
];
|
|
26574
|
-
const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$
|
|
26671
|
+
const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$5);
|
|
26575
26672
|
/**
|
|
26576
26673
|
* @license lucide-react v0.523.0 - ISC
|
|
26577
26674
|
*
|
|
26578
26675
|
* This source code is licensed under the ISC license.
|
|
26579
26676
|
* See the LICENSE file in the root directory of this source tree.
|
|
26580
26677
|
*/
|
|
26581
|
-
const __iconNode$
|
|
26678
|
+
const __iconNode$4 = [
|
|
26582
26679
|
[
|
|
26583
26680
|
"path",
|
|
26584
26681
|
{
|
|
@@ -26589,7 +26686,18 @@ const __iconNode$3 = [
|
|
|
26589
26686
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
26590
26687
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
26591
26688
|
];
|
|
26592
|
-
const Save = createLucideIcon("save", __iconNode$
|
|
26689
|
+
const Save = createLucideIcon("save", __iconNode$4);
|
|
26690
|
+
/**
|
|
26691
|
+
* @license lucide-react v0.523.0 - ISC
|
|
26692
|
+
*
|
|
26693
|
+
* This source code is licensed under the ISC license.
|
|
26694
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26695
|
+
*/
|
|
26696
|
+
const __iconNode$3 = [
|
|
26697
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
26698
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
26699
|
+
];
|
|
26700
|
+
const Search = createLucideIcon("search", __iconNode$3);
|
|
26593
26701
|
/**
|
|
26594
26702
|
* @license lucide-react v0.523.0 - ISC
|
|
26595
26703
|
*
|
|
@@ -27267,7 +27375,7 @@ function useCopy({ timeout = 500 } = {}) {
|
|
|
27267
27375
|
const JsonView = reactExports.memo(
|
|
27268
27376
|
({
|
|
27269
27377
|
data: data2,
|
|
27270
|
-
name,
|
|
27378
|
+
name: name2,
|
|
27271
27379
|
initialExpandDepth = 3,
|
|
27272
27380
|
className,
|
|
27273
27381
|
withCopyButton = true,
|
|
@@ -27307,7 +27415,7 @@ const JsonView = reactExports.memo(
|
|
|
27307
27415
|
JsonNode,
|
|
27308
27416
|
{
|
|
27309
27417
|
data: normalizedData,
|
|
27310
|
-
name,
|
|
27418
|
+
name: name2,
|
|
27311
27419
|
depth: 0,
|
|
27312
27420
|
initialExpandDepth,
|
|
27313
27421
|
isError
|
|
@@ -27320,7 +27428,7 @@ JsonView.displayName = "JsonView";
|
|
|
27320
27428
|
const JsonNode = reactExports.memo(
|
|
27321
27429
|
({
|
|
27322
27430
|
data: data2,
|
|
27323
|
-
name,
|
|
27431
|
+
name: name2,
|
|
27324
27432
|
depth = 0,
|
|
27325
27433
|
initialExpandDepth,
|
|
27326
27434
|
isError = false
|
|
@@ -27348,8 +27456,8 @@ const JsonNode = reactExports.memo(
|
|
|
27348
27456
|
};
|
|
27349
27457
|
if (isEmpty) {
|
|
27350
27458
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
|
27351
|
-
|
|
27352
|
-
|
|
27459
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
|
|
27460
|
+
name2,
|
|
27353
27461
|
":"
|
|
27354
27462
|
] }),
|
|
27355
27463
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-500", children: symbolMap.empty })
|
|
@@ -27362,8 +27470,8 @@ const JsonNode = reactExports.memo(
|
|
|
27362
27470
|
className: "flex items-center mr-1 rounded cursor-pointer group hover:bg-gray-800/10 dark:hover:bg-gray-800/20",
|
|
27363
27471
|
onClick: () => setIsExpanded(!isExpanded),
|
|
27364
27472
|
children: [
|
|
27365
|
-
|
|
27366
|
-
|
|
27473
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
|
|
27474
|
+
name2,
|
|
27367
27475
|
":"
|
|
27368
27476
|
] }),
|
|
27369
27477
|
isExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: symbolMap.open }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -27404,8 +27512,8 @@ const JsonNode = reactExports.memo(
|
|
|
27404
27512
|
const isTooLong = value.length > maxLength;
|
|
27405
27513
|
if (!isTooLong) {
|
|
27406
27514
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded hover:bg-gray-800/20", children: [
|
|
27407
|
-
|
|
27408
|
-
|
|
27515
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
|
|
27516
|
+
name2,
|
|
27409
27517
|
":"
|
|
27410
27518
|
] }),
|
|
27411
27519
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -27425,8 +27533,8 @@ const JsonNode = reactExports.memo(
|
|
|
27425
27533
|
] });
|
|
27426
27534
|
}
|
|
27427
27535
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded group hover:bg-gray-800/20", children: [
|
|
27428
|
-
|
|
27429
|
-
|
|
27536
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
|
|
27537
|
+
name2,
|
|
27430
27538
|
":"
|
|
27431
27539
|
] }),
|
|
27432
27540
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -27451,8 +27559,8 @@ const JsonNode = reactExports.memo(
|
|
|
27451
27559
|
return renderString(data2);
|
|
27452
27560
|
default:
|
|
27453
27561
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mr-1 rounded hover:bg-gray-800/20", children: [
|
|
27454
|
-
|
|
27455
|
-
|
|
27562
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
|
|
27563
|
+
name2,
|
|
27456
27564
|
":"
|
|
27457
27565
|
] }),
|
|
27458
27566
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: typeStyleMap[dataType] || typeStyleMap.default, children: data2 === null ? "null" : String(data2) })
|
|
@@ -28476,8 +28584,8 @@ function RemoveScrollSideCar(props) {
|
|
|
28476
28584
|
}
|
|
28477
28585
|
}
|
|
28478
28586
|
}, []);
|
|
28479
|
-
var shouldCancel = reactExports.useCallback(function(
|
|
28480
|
-
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
28587
|
+
var shouldCancel = reactExports.useCallback(function(name2, delta, target, should) {
|
|
28588
|
+
var event = { name: name2, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
28481
28589
|
shouldPreventQueue.current.push(event);
|
|
28482
28590
|
setTimeout(function() {
|
|
28483
28591
|
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
@@ -29596,7 +29704,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
29596
29704
|
let resetCount = 0;
|
|
29597
29705
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
29598
29706
|
const {
|
|
29599
|
-
name,
|
|
29707
|
+
name: name2,
|
|
29600
29708
|
fn
|
|
29601
29709
|
} = validMiddleware[i];
|
|
29602
29710
|
const {
|
|
@@ -29622,8 +29730,8 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
29622
29730
|
y = nextY != null ? nextY : y;
|
|
29623
29731
|
middlewareData = {
|
|
29624
29732
|
...middlewareData,
|
|
29625
|
-
[
|
|
29626
|
-
...middlewareData[
|
|
29733
|
+
[name2]: {
|
|
29734
|
+
...middlewareData[name2],
|
|
29627
29735
|
...data2
|
|
29628
29736
|
}
|
|
29629
29737
|
};
|
|
@@ -31987,6 +32095,23 @@ const Label$1 = reactExports.forwardRef(({ className, ...props }, ref2) => /* @_
|
|
|
31987
32095
|
}
|
|
31988
32096
|
));
|
|
31989
32097
|
Label$1.displayName = Root$1.displayName;
|
|
32098
|
+
const Input = reactExports.forwardRef(
|
|
32099
|
+
({ className, type: type2, ...props }, ref2) => {
|
|
32100
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32101
|
+
"input",
|
|
32102
|
+
{
|
|
32103
|
+
type: type2,
|
|
32104
|
+
className: cn(
|
|
32105
|
+
"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",
|
|
32106
|
+
className
|
|
32107
|
+
),
|
|
32108
|
+
ref: ref2,
|
|
32109
|
+
...props
|
|
32110
|
+
}
|
|
32111
|
+
);
|
|
32112
|
+
}
|
|
32113
|
+
);
|
|
32114
|
+
Input.displayName = "Input";
|
|
31990
32115
|
const ListPane = ({
|
|
31991
32116
|
items: items2,
|
|
31992
32117
|
listItems,
|
|
@@ -31996,40 +32121,101 @@ const ListPane = ({
|
|
|
31996
32121
|
title: title2,
|
|
31997
32122
|
buttonText,
|
|
31998
32123
|
isButtonDisabled
|
|
31999
|
-
}) =>
|
|
32000
|
-
|
|
32001
|
-
|
|
32002
|
-
|
|
32003
|
-
|
|
32004
|
-
|
|
32005
|
-
|
|
32006
|
-
|
|
32007
|
-
|
|
32008
|
-
|
|
32009
|
-
|
|
32010
|
-
|
|
32011
|
-
)
|
|
32012
|
-
|
|
32013
|
-
|
|
32014
|
-
|
|
32015
|
-
|
|
32016
|
-
|
|
32017
|
-
|
|
32018
|
-
|
|
32019
|
-
|
|
32020
|
-
|
|
32021
|
-
)
|
|
32022
|
-
|
|
32023
|
-
|
|
32024
|
-
|
|
32025
|
-
|
|
32026
|
-
|
|
32027
|
-
|
|
32028
|
-
|
|
32029
|
-
|
|
32030
|
-
|
|
32031
|
-
|
|
32032
|
-
|
|
32124
|
+
}) => {
|
|
32125
|
+
const [searchQuery, setSearchQuery] = reactExports.useState("");
|
|
32126
|
+
const [isSearchExpanded, setIsSearchExpanded] = reactExports.useState(false);
|
|
32127
|
+
const searchInputRef = reactExports.useRef(null);
|
|
32128
|
+
const filteredItems = reactExports.useMemo(() => {
|
|
32129
|
+
if (!searchQuery.trim()) return items2;
|
|
32130
|
+
return items2.filter((item) => {
|
|
32131
|
+
const searchableText = [
|
|
32132
|
+
item.name || "",
|
|
32133
|
+
item.description || ""
|
|
32134
|
+
].join(" ").toLowerCase();
|
|
32135
|
+
return searchableText.includes(searchQuery.toLowerCase());
|
|
32136
|
+
});
|
|
32137
|
+
}, [items2, searchQuery]);
|
|
32138
|
+
const handleSearchClick = () => {
|
|
32139
|
+
setIsSearchExpanded(true);
|
|
32140
|
+
setTimeout(() => {
|
|
32141
|
+
var _a;
|
|
32142
|
+
(_a = searchInputRef.current) == null ? void 0 : _a.focus();
|
|
32143
|
+
}, 100);
|
|
32144
|
+
};
|
|
32145
|
+
const handleSearchBlur = () => {
|
|
32146
|
+
if (!searchQuery.trim()) {
|
|
32147
|
+
setIsSearchExpanded(false);
|
|
32148
|
+
}
|
|
32149
|
+
};
|
|
32150
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card border border-border rounded-lg shadow", children: [
|
|
32151
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-border", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
32152
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold dark:text-white flex-shrink-0", children: title2 }),
|
|
32153
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-end min-w-0 flex-1", children: !isSearchExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32154
|
+
"button",
|
|
32155
|
+
{
|
|
32156
|
+
name: "search",
|
|
32157
|
+
"aria-label": "Search",
|
|
32158
|
+
onClick: handleSearchClick,
|
|
32159
|
+
className: "p-2 hover:bg-gray-100 dark:hover:bg-secondary rounded-md transition-all duration-300 ease-in-out",
|
|
32160
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "w-4 h-4 text-muted-foreground" })
|
|
32161
|
+
}
|
|
32162
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center w-full max-w-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-full", children: [
|
|
32163
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none z-10" }),
|
|
32164
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32165
|
+
Input,
|
|
32166
|
+
{
|
|
32167
|
+
ref: searchInputRef,
|
|
32168
|
+
name: "search",
|
|
32169
|
+
type: "text",
|
|
32170
|
+
placeholder: "Search...",
|
|
32171
|
+
value: searchQuery,
|
|
32172
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
32173
|
+
onBlur: handleSearchBlur,
|
|
32174
|
+
className: "pl-10 w-full transition-all duration-300 ease-in-out"
|
|
32175
|
+
}
|
|
32176
|
+
)
|
|
32177
|
+
] }) }) })
|
|
32178
|
+
] }) }),
|
|
32179
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
|
|
32180
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32181
|
+
Button,
|
|
32182
|
+
{
|
|
32183
|
+
variant: "outline",
|
|
32184
|
+
className: "w-full mb-4",
|
|
32185
|
+
onClick: listItems,
|
|
32186
|
+
disabled: isButtonDisabled,
|
|
32187
|
+
children: buttonText
|
|
32188
|
+
}
|
|
32189
|
+
),
|
|
32190
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32191
|
+
Button,
|
|
32192
|
+
{
|
|
32193
|
+
variant: "outline",
|
|
32194
|
+
className: "w-full mb-4",
|
|
32195
|
+
onClick: clearItems,
|
|
32196
|
+
disabled: items2.length === 0,
|
|
32197
|
+
children: "Clear"
|
|
32198
|
+
}
|
|
32199
|
+
),
|
|
32200
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 overflow-y-auto max-h-96", children: [
|
|
32201
|
+
filteredItems.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32202
|
+
"div",
|
|
32203
|
+
{
|
|
32204
|
+
className: "flex items-center py-2 px-4 rounded hover:bg-gray-50 dark:hover:bg-secondary cursor-pointer",
|
|
32205
|
+
onClick: () => setSelectedItem(item),
|
|
32206
|
+
children: renderItem(item)
|
|
32207
|
+
},
|
|
32208
|
+
index2
|
|
32209
|
+
)),
|
|
32210
|
+
filteredItems.length === 0 && searchQuery && items2.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-4 text-muted-foreground", children: [
|
|
32211
|
+
'No items found matching "',
|
|
32212
|
+
searchQuery,
|
|
32213
|
+
'"'
|
|
32214
|
+
] })
|
|
32215
|
+
] })
|
|
32216
|
+
] })
|
|
32217
|
+
] });
|
|
32218
|
+
};
|
|
32033
32219
|
function debounce(func, wait) {
|
|
32034
32220
|
let timeout;
|
|
32035
32221
|
return (...args) => {
|
|
@@ -32265,11 +32451,11 @@ class UriTemplate {
|
|
|
32265
32451
|
const operator = this.getOperator(expr);
|
|
32266
32452
|
const exploded = expr.includes("*");
|
|
32267
32453
|
const names = this.getNames(expr);
|
|
32268
|
-
const
|
|
32269
|
-
for (const
|
|
32270
|
-
UriTemplate.validateLength(
|
|
32454
|
+
const name2 = names[0];
|
|
32455
|
+
for (const name3 of names) {
|
|
32456
|
+
UriTemplate.validateLength(name3, MAX_VARIABLE_LENGTH, "Variable name");
|
|
32271
32457
|
}
|
|
32272
|
-
parts.push({ name, operator, names, exploded });
|
|
32458
|
+
parts.push({ name: name2, operator, names, exploded });
|
|
32273
32459
|
i = end + 1;
|
|
32274
32460
|
} else {
|
|
32275
32461
|
currentText += template[i];
|
|
@@ -32287,7 +32473,7 @@ class UriTemplate {
|
|
|
32287
32473
|
}
|
|
32288
32474
|
getNames(expr) {
|
|
32289
32475
|
const operator = this.getOperator(expr);
|
|
32290
|
-
return expr.slice(operator.length).split(",").map((
|
|
32476
|
+
return expr.slice(operator.length).split(",").map((name2) => name2.replace("*", "").trim()).filter((name2) => name2.length > 0);
|
|
32291
32477
|
}
|
|
32292
32478
|
encodeValue(value, operator) {
|
|
32293
32479
|
UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, "Variable value");
|
|
@@ -32298,12 +32484,12 @@ class UriTemplate {
|
|
|
32298
32484
|
}
|
|
32299
32485
|
expandPart(part, variables) {
|
|
32300
32486
|
if (part.operator === "?" || part.operator === "&") {
|
|
32301
|
-
const pairs = part.names.map((
|
|
32302
|
-
const value2 = variables[
|
|
32487
|
+
const pairs = part.names.map((name2) => {
|
|
32488
|
+
const value2 = variables[name2];
|
|
32303
32489
|
if (value2 === void 0)
|
|
32304
32490
|
return "";
|
|
32305
32491
|
const encoded2 = Array.isArray(value2) ? value2.map((v) => this.encodeValue(v, part.operator)).join(",") : this.encodeValue(value2.toString(), part.operator);
|
|
32306
|
-
return `${
|
|
32492
|
+
return `${name2}=${encoded2}`;
|
|
32307
32493
|
}).filter((pair) => pair.length > 0);
|
|
32308
32494
|
if (pairs.length === 0)
|
|
32309
32495
|
return "";
|
|
@@ -32311,7 +32497,7 @@ class UriTemplate {
|
|
|
32311
32497
|
return separator + pairs.join("&");
|
|
32312
32498
|
}
|
|
32313
32499
|
if (part.names.length > 1) {
|
|
32314
|
-
const values2 = part.names.map((
|
|
32500
|
+
const values2 = part.names.map((name2) => variables[name2]).filter((v) => v !== void 0);
|
|
32315
32501
|
if (values2.length === 0)
|
|
32316
32502
|
return "";
|
|
32317
32503
|
return values2.map((v) => Array.isArray(v) ? v[0] : v).join(",");
|
|
@@ -32363,22 +32549,22 @@ class UriTemplate {
|
|
|
32363
32549
|
}
|
|
32364
32550
|
partToRegExp(part) {
|
|
32365
32551
|
const patterns = [];
|
|
32366
|
-
for (const
|
|
32367
|
-
UriTemplate.validateLength(
|
|
32552
|
+
for (const name3 of part.names) {
|
|
32553
|
+
UriTemplate.validateLength(name3, MAX_VARIABLE_LENGTH, "Variable name");
|
|
32368
32554
|
}
|
|
32369
32555
|
if (part.operator === "?" || part.operator === "&") {
|
|
32370
32556
|
for (let i = 0; i < part.names.length; i++) {
|
|
32371
|
-
const
|
|
32557
|
+
const name3 = part.names[i];
|
|
32372
32558
|
const prefix = i === 0 ? "\\" + part.operator : "&";
|
|
32373
32559
|
patterns.push({
|
|
32374
|
-
pattern: prefix + this.escapeRegExp(
|
|
32375
|
-
name:
|
|
32560
|
+
pattern: prefix + this.escapeRegExp(name3) + "=([^&]+)",
|
|
32561
|
+
name: name3
|
|
32376
32562
|
});
|
|
32377
32563
|
}
|
|
32378
32564
|
return patterns;
|
|
32379
32565
|
}
|
|
32380
32566
|
let pattern2;
|
|
32381
|
-
const
|
|
32567
|
+
const name2 = part.name;
|
|
32382
32568
|
switch (part.operator) {
|
|
32383
32569
|
case "":
|
|
32384
32570
|
pattern2 = part.exploded ? "([^/]+(?:,[^/]+)*)" : "([^/,]+)";
|
|
@@ -32396,7 +32582,7 @@ class UriTemplate {
|
|
|
32396
32582
|
default:
|
|
32397
32583
|
pattern2 = "([^/]+)";
|
|
32398
32584
|
}
|
|
32399
|
-
patterns.push({ pattern: pattern2, name });
|
|
32585
|
+
patterns.push({ pattern: pattern2, name: name2 });
|
|
32400
32586
|
return patterns;
|
|
32401
32587
|
}
|
|
32402
32588
|
match(uri) {
|
|
@@ -32408,9 +32594,9 @@ class UriTemplate {
|
|
|
32408
32594
|
pattern2 += this.escapeRegExp(part);
|
|
32409
32595
|
} else {
|
|
32410
32596
|
const patterns = this.partToRegExp(part);
|
|
32411
|
-
for (const { pattern: partPattern, name } of patterns) {
|
|
32597
|
+
for (const { pattern: partPattern, name: name2 } of patterns) {
|
|
32412
32598
|
pattern2 += partPattern;
|
|
32413
|
-
names.push({ name, exploded: part.exploded });
|
|
32599
|
+
names.push({ name: name2, exploded: part.exploded });
|
|
32414
32600
|
}
|
|
32415
32601
|
}
|
|
32416
32602
|
}
|
|
@@ -32422,9 +32608,9 @@ class UriTemplate {
|
|
|
32422
32608
|
return null;
|
|
32423
32609
|
const result = {};
|
|
32424
32610
|
for (let i = 0; i < names.length; i++) {
|
|
32425
|
-
const { name, exploded } = names[i];
|
|
32611
|
+
const { name: name2, exploded } = names[i];
|
|
32426
32612
|
const value = match[i + 1];
|
|
32427
|
-
const cleanName =
|
|
32613
|
+
const cleanName = name2.replace("*", "");
|
|
32428
32614
|
if (exploded && value.includes(",")) {
|
|
32429
32615
|
result[cleanName] = value.split(",");
|
|
32430
32616
|
} else {
|
|
@@ -32627,23 +32813,6 @@ const ResourcesTab = ({
|
|
|
32627
32813
|
] })
|
|
32628
32814
|
] }) });
|
|
32629
32815
|
};
|
|
32630
|
-
const Input = reactExports.forwardRef(
|
|
32631
|
-
({ className, type: type2, ...props }, ref2) => {
|
|
32632
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32633
|
-
"input",
|
|
32634
|
-
{
|
|
32635
|
-
type: type2,
|
|
32636
|
-
className: cn(
|
|
32637
|
-
"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",
|
|
32638
|
-
className
|
|
32639
|
-
),
|
|
32640
|
-
ref: ref2,
|
|
32641
|
-
...props
|
|
32642
|
-
}
|
|
32643
|
-
);
|
|
32644
|
-
}
|
|
32645
|
-
);
|
|
32646
|
-
Input.displayName = "Input";
|
|
32647
32816
|
const RootsTab = ({
|
|
32648
32817
|
roots,
|
|
32649
32818
|
setRoots,
|
|
@@ -32772,7 +32941,7 @@ function requireLib() {
|
|
|
32772
32941
|
"\n/**\n * Reset the text fill color so that placeholder is visible\n */\n.".concat(className, ":empty {\n -webkit-text-fill-color: inherit !important;\n}\n\n/**\n * Hack to apply on some CSS on IE10 and IE11\n */\n@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n /**\n * IE doesn't support '-webkit-text-fill-color'\n * So we use 'color: transparent' to make the text transparent on IE\n * Unlike other browsers, it doesn't affect caret color in IE\n */\n .").concat(className, " {\n color: transparent !important;\n }\n\n .").concat(className, "::selection {\n background-color: #accef7 !important;\n color: transparent !important;\n }\n}\n")
|
|
32773
32942
|
);
|
|
32774
32943
|
var Editor2 = React2.forwardRef(function Editor3(props, ref2) {
|
|
32775
|
-
var autoFocus = props.autoFocus, disabled = props.disabled, form = props.form, highlight = props.highlight, _a = props.ignoreTabKey, ignoreTabKey = _a === void 0 ? false : _a, _b = props.insertSpaces, insertSpaces = _b === void 0 ? true : _b, maxLength = props.maxLength, minLength = props.minLength,
|
|
32944
|
+
var autoFocus = props.autoFocus, disabled = props.disabled, form = props.form, highlight = props.highlight, _a = props.ignoreTabKey, ignoreTabKey = _a === void 0 ? false : _a, _b = props.insertSpaces, insertSpaces = _b === void 0 ? true : _b, maxLength = props.maxLength, minLength = props.minLength, name2 = props.name, onBlur = props.onBlur, onClick = props.onClick, onFocus = props.onFocus, onKeyDown = props.onKeyDown, onKeyUp = props.onKeyUp, onValueChange = props.onValueChange, _c = props.padding, padding = _c === void 0 ? 0 : _c, placeholder = props.placeholder, preClassName = props.preClassName, readOnly = props.readOnly, required2 = props.required, style = props.style, _d = props.tabSize, tabSize = _d === void 0 ? 2 : _d, textareaClassName = props.textareaClassName, textareaId = props.textareaId, value = props.value, rest = __rest2(props, ["autoFocus", "disabled", "form", "highlight", "ignoreTabKey", "insertSpaces", "maxLength", "minLength", "name", "onBlur", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onValueChange", "padding", "placeholder", "preClassName", "readOnly", "required", "style", "tabSize", "textareaClassName", "textareaId", "value"]);
|
|
32776
32945
|
var historyRef = React2.useRef({
|
|
32777
32946
|
stack: [],
|
|
32778
32947
|
offset: -1
|
|
@@ -33045,7 +33214,7 @@ function requireLib() {
|
|
|
33045
33214
|
React2.createElement("pre", __assign2({ className: preClassName, "aria-hidden": "true", style: __assign2(__assign2(__assign2({}, styles.editor), styles.highlight), contentStyle) }, typeof highlighted === "string" ? { dangerouslySetInnerHTML: { __html: highlighted + "<br />" } } : { children: highlighted })),
|
|
33046
33215
|
React2.createElement("textarea", { ref: function(c) {
|
|
33047
33216
|
return inputRef.current = c;
|
|
33048
|
-
}, style: __assign2(__assign2(__assign2({}, styles.editor), styles.textarea), contentStyle), className: className + (textareaClassName ? " ".concat(textareaClassName) : ""), id: textareaId, value, onChange: handleChange, onKeyDown: handleKeyDown, onClick, onKeyUp, onFocus, onBlur, disabled, form, maxLength, minLength, name, placeholder, readOnly, required: required2, autoFocus, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", spellCheck: false, "data-gramm": false }),
|
|
33217
|
+
}, style: __assign2(__assign2(__assign2({}, styles.editor), styles.textarea), contentStyle), className: className + (textareaClassName ? " ".concat(textareaClassName) : ""), id: textareaId, value, onChange: handleChange, onKeyDown: handleKeyDown, onClick, onKeyUp, onFocus, onBlur, disabled, form, maxLength, minLength, name: name2, placeholder, readOnly, required: required2, autoFocus, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", spellCheck: false, "data-gramm": false }),
|
|
33049
33218
|
React2.createElement("style", { dangerouslySetInnerHTML: { __html: cssText } })
|
|
33050
33219
|
);
|
|
33051
33220
|
});
|
|
@@ -33749,10 +33918,10 @@ function requirePrism() {
|
|
|
33749
33918
|
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
33750
33919
|
* @public
|
|
33751
33920
|
*/
|
|
33752
|
-
add: function(
|
|
33921
|
+
add: function(name2, callback) {
|
|
33753
33922
|
var hooks = _.hooks.all;
|
|
33754
|
-
hooks[
|
|
33755
|
-
hooks[
|
|
33923
|
+
hooks[name2] = hooks[name2] || [];
|
|
33924
|
+
hooks[name2].push(callback);
|
|
33756
33925
|
},
|
|
33757
33926
|
/**
|
|
33758
33927
|
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
@@ -33763,8 +33932,8 @@ function requirePrism() {
|
|
|
33763
33932
|
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
33764
33933
|
* @public
|
|
33765
33934
|
*/
|
|
33766
|
-
run: function(
|
|
33767
|
-
var callbacks = _.hooks.all[
|
|
33935
|
+
run: function(name2, env) {
|
|
33936
|
+
var callbacks = _.hooks.all[name2];
|
|
33768
33937
|
if (!callbacks || !callbacks.length) {
|
|
33769
33938
|
return;
|
|
33770
33939
|
}
|
|
@@ -33811,8 +33980,8 @@ function requirePrism() {
|
|
|
33811
33980
|
}
|
|
33812
33981
|
_.hooks.run("wrap", env);
|
|
33813
33982
|
var attributes = "";
|
|
33814
|
-
for (var
|
|
33815
|
-
attributes += " " +
|
|
33983
|
+
for (var name2 in env.attributes) {
|
|
33984
|
+
attributes += " " + name2 + '="' + (env.attributes[name2] || "").replace(/"/g, """) + '"';
|
|
33816
33985
|
}
|
|
33817
33986
|
return "<" + env.tag + ' class="' + env.classes.join(" ") + '"' + attributes + ">" + env.content + "</" + env.tag + ">";
|
|
33818
33987
|
};
|
|
@@ -34673,259 +34842,391 @@ const getArrayItemDefault = (schema) => {
|
|
|
34673
34842
|
return null;
|
|
34674
34843
|
}
|
|
34675
34844
|
};
|
|
34676
|
-
const DynamicJsonForm = (
|
|
34677
|
-
schema,
|
|
34678
|
-
|
|
34679
|
-
|
|
34680
|
-
|
|
34681
|
-
|
|
34682
|
-
|
|
34683
|
-
|
|
34684
|
-
|
|
34685
|
-
|
|
34686
|
-
|
|
34687
|
-
|
|
34688
|
-
|
|
34689
|
-
|
|
34690
|
-
|
|
34691
|
-
|
|
34692
|
-
|
|
34693
|
-
|
|
34694
|
-
|
|
34845
|
+
const DynamicJsonForm = reactExports.forwardRef(
|
|
34846
|
+
({ schema, value, onChange, maxDepth = 3 }, ref2) => {
|
|
34847
|
+
const isOnlyJSON = !isSimpleObject(schema);
|
|
34848
|
+
const [isJsonMode, setIsJsonMode] = reactExports.useState(isOnlyJSON);
|
|
34849
|
+
const [jsonError, setJsonError] = reactExports.useState();
|
|
34850
|
+
const [copiedJson, setCopiedJson] = reactExports.useState(false);
|
|
34851
|
+
const { toast: toast2 } = useToast();
|
|
34852
|
+
const [rawJsonValue, setRawJsonValue] = reactExports.useState(
|
|
34853
|
+
JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
|
|
34854
|
+
);
|
|
34855
|
+
const timeoutRef = reactExports.useRef();
|
|
34856
|
+
const debouncedUpdateParent = reactExports.useCallback(
|
|
34857
|
+
(jsonString) => {
|
|
34858
|
+
if (timeoutRef.current) {
|
|
34859
|
+
clearTimeout(timeoutRef.current);
|
|
34860
|
+
}
|
|
34861
|
+
timeoutRef.current = setTimeout(() => {
|
|
34862
|
+
try {
|
|
34863
|
+
const parsed = JSON.parse(jsonString);
|
|
34864
|
+
onChange(parsed);
|
|
34865
|
+
setJsonError(void 0);
|
|
34866
|
+
} catch (err) {
|
|
34867
|
+
const errorMessage = err instanceof Error ? err.message : "Invalid JSON";
|
|
34868
|
+
setJsonError(errorMessage);
|
|
34869
|
+
const trimmed = jsonString.trim();
|
|
34870
|
+
if (trimmed.length > 5 && !trimmed.match(/^[\s[{]/)) {
|
|
34871
|
+
onChange(generateDefaultValue(schema));
|
|
34872
|
+
}
|
|
34873
|
+
}
|
|
34874
|
+
}, 300);
|
|
34875
|
+
},
|
|
34876
|
+
[onChange, setJsonError, schema]
|
|
34877
|
+
);
|
|
34878
|
+
reactExports.useEffect(() => {
|
|
34879
|
+
if (!isJsonMode) {
|
|
34880
|
+
setRawJsonValue(
|
|
34881
|
+
JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
|
|
34882
|
+
);
|
|
34695
34883
|
}
|
|
34696
|
-
|
|
34884
|
+
}, [value, schema, isJsonMode]);
|
|
34885
|
+
const handleSwitchToFormMode = () => {
|
|
34886
|
+
if (isJsonMode) {
|
|
34697
34887
|
try {
|
|
34698
|
-
const parsed = JSON.parse(
|
|
34888
|
+
const parsed = JSON.parse(rawJsonValue);
|
|
34699
34889
|
onChange(parsed);
|
|
34700
|
-
|
|
34701
|
-
} catch {
|
|
34890
|
+
setIsJsonMode(false);
|
|
34891
|
+
} catch (err) {
|
|
34892
|
+
setJsonError(err instanceof Error ? err.message : "Invalid JSON");
|
|
34702
34893
|
}
|
|
34703
|
-
}
|
|
34704
|
-
|
|
34705
|
-
|
|
34706
|
-
|
|
34707
|
-
|
|
34708
|
-
|
|
34709
|
-
|
|
34710
|
-
|
|
34711
|
-
|
|
34712
|
-
|
|
34713
|
-
|
|
34714
|
-
|
|
34715
|
-
|
|
34716
|
-
|
|
34717
|
-
|
|
34718
|
-
|
|
34719
|
-
|
|
34720
|
-
} catch (err) {
|
|
34894
|
+
} else {
|
|
34895
|
+
setRawJsonValue(
|
|
34896
|
+
JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
|
|
34897
|
+
);
|
|
34898
|
+
setIsJsonMode(true);
|
|
34899
|
+
}
|
|
34900
|
+
};
|
|
34901
|
+
const formatJson = () => {
|
|
34902
|
+
try {
|
|
34903
|
+
const jsonStr = rawJsonValue.trim();
|
|
34904
|
+
if (!jsonStr) {
|
|
34905
|
+
return;
|
|
34906
|
+
}
|
|
34907
|
+
const formatted = JSON.stringify(JSON.parse(jsonStr), null, 2);
|
|
34908
|
+
setRawJsonValue(formatted);
|
|
34909
|
+
debouncedUpdateParent(formatted);
|
|
34910
|
+
setJsonError(void 0);
|
|
34911
|
+
} catch (err) {
|
|
34721
34912
|
setJsonError(err instanceof Error ? err.message : "Invalid JSON");
|
|
34722
34913
|
}
|
|
34723
|
-
}
|
|
34724
|
-
|
|
34725
|
-
|
|
34726
|
-
|
|
34727
|
-
|
|
34728
|
-
|
|
34729
|
-
|
|
34730
|
-
|
|
34731
|
-
|
|
34732
|
-
|
|
34733
|
-
|
|
34734
|
-
|
|
34914
|
+
};
|
|
34915
|
+
const validateJson = () => {
|
|
34916
|
+
if (!isJsonMode) return { isValid: true, error: null };
|
|
34917
|
+
try {
|
|
34918
|
+
const jsonStr = rawJsonValue.trim();
|
|
34919
|
+
if (!jsonStr) return { isValid: true, error: null };
|
|
34920
|
+
const parsed = JSON.parse(jsonStr);
|
|
34921
|
+
if (timeoutRef.current) {
|
|
34922
|
+
clearTimeout(timeoutRef.current);
|
|
34923
|
+
}
|
|
34924
|
+
onChange(parsed);
|
|
34925
|
+
setJsonError(void 0);
|
|
34926
|
+
return { isValid: true, error: null };
|
|
34927
|
+
} catch (err) {
|
|
34928
|
+
const errorMessage = err instanceof Error ? err.message : "Invalid JSON";
|
|
34929
|
+
setJsonError(errorMessage);
|
|
34930
|
+
return { isValid: false, error: errorMessage };
|
|
34735
34931
|
}
|
|
34736
|
-
|
|
34737
|
-
|
|
34738
|
-
|
|
34739
|
-
|
|
34740
|
-
|
|
34741
|
-
|
|
34742
|
-
|
|
34743
|
-
|
|
34744
|
-
|
|
34745
|
-
|
|
34746
|
-
|
|
34747
|
-
|
|
34748
|
-
|
|
34749
|
-
|
|
34750
|
-
|
|
34751
|
-
|
|
34752
|
-
|
|
34753
|
-
|
|
34754
|
-
|
|
34755
|
-
|
|
34756
|
-
|
|
34757
|
-
|
|
34758
|
-
|
|
34759
|
-
|
|
34760
|
-
|
|
34761
|
-
|
|
34932
|
+
};
|
|
34933
|
+
const handleCopyJson = reactExports.useCallback(async () => {
|
|
34934
|
+
try {
|
|
34935
|
+
await navigator.clipboard.writeText(
|
|
34936
|
+
JSON.stringify(value, null, 2) ?? "[]"
|
|
34937
|
+
);
|
|
34938
|
+
setCopiedJson(true);
|
|
34939
|
+
toast2({
|
|
34940
|
+
title: "JSON copied",
|
|
34941
|
+
description: "The JSON data has been successfully copied to your clipboard."
|
|
34942
|
+
});
|
|
34943
|
+
setTimeout(() => {
|
|
34944
|
+
setCopiedJson(false);
|
|
34945
|
+
}, 2e3);
|
|
34946
|
+
} catch (error) {
|
|
34947
|
+
toast2({
|
|
34948
|
+
title: "Error",
|
|
34949
|
+
description: `Failed to copy JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
34950
|
+
variant: "destructive"
|
|
34951
|
+
});
|
|
34952
|
+
}
|
|
34953
|
+
}, [toast2, value]);
|
|
34954
|
+
reactExports.useImperativeHandle(ref2, () => ({
|
|
34955
|
+
validateJson
|
|
34956
|
+
}));
|
|
34957
|
+
const renderFormFields = (propSchema, currentValue, path = [], depth = 0, parentSchema, propertyName) => {
|
|
34958
|
+
var _a, _b, _c;
|
|
34959
|
+
if (depth >= maxDepth && (propSchema.type === "object" || propSchema.type === "array")) {
|
|
34960
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34961
|
+
JsonEditor,
|
|
34962
|
+
{
|
|
34963
|
+
value: JSON.stringify(
|
|
34964
|
+
currentValue ?? generateDefaultValue(propSchema, propertyName, parentSchema),
|
|
34965
|
+
null,
|
|
34966
|
+
2
|
|
34967
|
+
),
|
|
34968
|
+
onChange: (newValue) => {
|
|
34969
|
+
try {
|
|
34970
|
+
const parsed = JSON.parse(newValue);
|
|
34971
|
+
handleFieldChange(path, parsed);
|
|
34972
|
+
setJsonError(void 0);
|
|
34973
|
+
} catch (err) {
|
|
34974
|
+
setJsonError(
|
|
34975
|
+
err instanceof Error ? err.message : "Invalid JSON"
|
|
34976
|
+
);
|
|
34977
|
+
}
|
|
34978
|
+
},
|
|
34979
|
+
error: jsonError
|
|
34980
|
+
}
|
|
34981
|
+
);
|
|
34982
|
+
}
|
|
34983
|
+
const isRequired = ((_a = parentSchema == null ? void 0 : parentSchema.required) == null ? void 0 : _a.includes(propertyName || "")) ?? false;
|
|
34984
|
+
let fieldType = propSchema.type;
|
|
34985
|
+
if (Array.isArray(fieldType)) {
|
|
34986
|
+
fieldType = fieldType.find((t) => t !== "null") ?? fieldType[0];
|
|
34987
|
+
}
|
|
34988
|
+
switch (fieldType) {
|
|
34989
|
+
case "string": {
|
|
34990
|
+
if (propSchema.oneOf && propSchema.oneOf.every(
|
|
34991
|
+
(option) => typeof option.const === "string" && typeof option.title === "string"
|
|
34992
|
+
)) {
|
|
34993
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
34994
|
+
"select",
|
|
34995
|
+
{
|
|
34996
|
+
value: currentValue ?? "",
|
|
34997
|
+
onChange: (e) => {
|
|
34998
|
+
const val = e.target.value;
|
|
34999
|
+
if (!val && !isRequired) {
|
|
35000
|
+
handleFieldChange(path, void 0);
|
|
35001
|
+
} else {
|
|
35002
|
+
handleFieldChange(path, val);
|
|
35003
|
+
}
|
|
35004
|
+
},
|
|
35005
|
+
required: isRequired,
|
|
35006
|
+
className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800",
|
|
35007
|
+
children: [
|
|
35008
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
|
|
35009
|
+
propSchema.oneOf.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35010
|
+
"option",
|
|
35011
|
+
{
|
|
35012
|
+
value: option.const,
|
|
35013
|
+
children: option.title
|
|
35014
|
+
},
|
|
35015
|
+
option.const
|
|
35016
|
+
))
|
|
35017
|
+
]
|
|
35018
|
+
}
|
|
35019
|
+
);
|
|
35020
|
+
}
|
|
35021
|
+
if (propSchema.enum) {
|
|
35022
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
35023
|
+
"select",
|
|
35024
|
+
{
|
|
35025
|
+
value: currentValue ?? "",
|
|
35026
|
+
onChange: (e) => {
|
|
35027
|
+
const val = e.target.value;
|
|
35028
|
+
if (!val && !isRequired) {
|
|
35029
|
+
handleFieldChange(path, void 0);
|
|
35030
|
+
} else {
|
|
35031
|
+
handleFieldChange(path, val);
|
|
35032
|
+
}
|
|
35033
|
+
},
|
|
35034
|
+
required: isRequired,
|
|
35035
|
+
className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800",
|
|
35036
|
+
children: [
|
|
35037
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
|
|
35038
|
+
propSchema.enum.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option }, option))
|
|
35039
|
+
]
|
|
35040
|
+
}
|
|
35041
|
+
);
|
|
35042
|
+
}
|
|
35043
|
+
let inputType = "text";
|
|
35044
|
+
switch (propSchema.format) {
|
|
35045
|
+
case "email":
|
|
35046
|
+
inputType = "email";
|
|
35047
|
+
break;
|
|
35048
|
+
case "uri":
|
|
35049
|
+
inputType = "url";
|
|
35050
|
+
break;
|
|
35051
|
+
case "date":
|
|
35052
|
+
inputType = "date";
|
|
35053
|
+
break;
|
|
35054
|
+
case "date-time":
|
|
35055
|
+
inputType = "datetime-local";
|
|
35056
|
+
break;
|
|
35057
|
+
default:
|
|
35058
|
+
inputType = "text";
|
|
35059
|
+
break;
|
|
35060
|
+
}
|
|
35061
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35062
|
+
Input,
|
|
35063
|
+
{
|
|
35064
|
+
type: inputType,
|
|
35065
|
+
value: currentValue ?? "",
|
|
35066
|
+
onChange: (e) => {
|
|
35067
|
+
const val = e.target.value;
|
|
35068
|
+
handleFieldChange(path, val);
|
|
35069
|
+
},
|
|
35070
|
+
placeholder: propSchema.description,
|
|
35071
|
+
required: isRequired,
|
|
35072
|
+
minLength: propSchema.minLength,
|
|
35073
|
+
maxLength: propSchema.maxLength,
|
|
35074
|
+
pattern: propSchema.pattern
|
|
34762
35075
|
}
|
|
34763
|
-
|
|
34764
|
-
error: jsonError
|
|
35076
|
+
);
|
|
34765
35077
|
}
|
|
34766
|
-
|
|
34767
|
-
|
|
34768
|
-
|
|
34769
|
-
let fieldType = propSchema.type;
|
|
34770
|
-
if (Array.isArray(fieldType)) {
|
|
34771
|
-
fieldType = fieldType.find((t) => t !== "null") ?? fieldType[0];
|
|
34772
|
-
}
|
|
34773
|
-
switch (fieldType) {
|
|
34774
|
-
case "string": {
|
|
34775
|
-
if (propSchema.oneOf && propSchema.oneOf.every(
|
|
34776
|
-
(option) => typeof option.const === "string" && typeof option.title === "string"
|
|
34777
|
-
)) {
|
|
34778
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
34779
|
-
"select",
|
|
35078
|
+
case "number":
|
|
35079
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35080
|
+
Input,
|
|
34780
35081
|
{
|
|
34781
|
-
|
|
35082
|
+
type: "number",
|
|
35083
|
+
value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
|
|
34782
35084
|
onChange: (e) => {
|
|
34783
35085
|
const val = e.target.value;
|
|
34784
35086
|
if (!val && !isRequired) {
|
|
34785
35087
|
handleFieldChange(path, void 0);
|
|
34786
35088
|
} else {
|
|
34787
|
-
|
|
35089
|
+
const num = Number(val);
|
|
35090
|
+
if (!isNaN(num)) {
|
|
35091
|
+
handleFieldChange(path, num);
|
|
35092
|
+
}
|
|
34788
35093
|
}
|
|
34789
35094
|
},
|
|
35095
|
+
placeholder: propSchema.description,
|
|
34790
35096
|
required: isRequired,
|
|
34791
|
-
|
|
34792
|
-
|
|
34793
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
|
|
34794
|
-
propSchema.oneOf.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34795
|
-
"option",
|
|
34796
|
-
{
|
|
34797
|
-
value: option.const,
|
|
34798
|
-
children: option.title
|
|
34799
|
-
},
|
|
34800
|
-
option.const
|
|
34801
|
-
))
|
|
34802
|
-
]
|
|
35097
|
+
min: propSchema.minimum,
|
|
35098
|
+
max: propSchema.maximum
|
|
34803
35099
|
}
|
|
34804
35100
|
);
|
|
34805
|
-
|
|
34806
|
-
|
|
34807
|
-
|
|
34808
|
-
"select",
|
|
35101
|
+
case "integer":
|
|
35102
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35103
|
+
Input,
|
|
34809
35104
|
{
|
|
34810
|
-
|
|
35105
|
+
type: "number",
|
|
35106
|
+
step: "1",
|
|
35107
|
+
value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
|
|
34811
35108
|
onChange: (e) => {
|
|
34812
35109
|
const val = e.target.value;
|
|
34813
35110
|
if (!val && !isRequired) {
|
|
34814
35111
|
handleFieldChange(path, void 0);
|
|
34815
35112
|
} else {
|
|
34816
|
-
|
|
35113
|
+
const num = Number(val);
|
|
35114
|
+
if (!isNaN(num) && Number.isInteger(num)) {
|
|
35115
|
+
handleFieldChange(path, num);
|
|
35116
|
+
}
|
|
34817
35117
|
}
|
|
34818
35118
|
},
|
|
35119
|
+
placeholder: propSchema.description,
|
|
34819
35120
|
required: isRequired,
|
|
34820
|
-
|
|
34821
|
-
|
|
34822
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
|
|
34823
|
-
propSchema.enum.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option }, option))
|
|
34824
|
-
]
|
|
35121
|
+
min: propSchema.minimum,
|
|
35122
|
+
max: propSchema.maximum
|
|
34825
35123
|
}
|
|
34826
35124
|
);
|
|
34827
|
-
|
|
34828
|
-
|
|
34829
|
-
|
|
34830
|
-
|
|
34831
|
-
|
|
34832
|
-
|
|
34833
|
-
|
|
34834
|
-
|
|
34835
|
-
|
|
34836
|
-
|
|
34837
|
-
|
|
34838
|
-
|
|
34839
|
-
|
|
34840
|
-
|
|
34841
|
-
|
|
34842
|
-
|
|
34843
|
-
|
|
34844
|
-
|
|
34845
|
-
|
|
34846
|
-
|
|
34847
|
-
|
|
34848
|
-
|
|
34849
|
-
|
|
34850
|
-
|
|
34851
|
-
|
|
34852
|
-
|
|
34853
|
-
|
|
34854
|
-
|
|
34855
|
-
|
|
34856
|
-
|
|
34857
|
-
|
|
34858
|
-
maxLength: propSchema.maxLength,
|
|
34859
|
-
pattern: propSchema.pattern
|
|
34860
|
-
}
|
|
34861
|
-
);
|
|
34862
|
-
}
|
|
34863
|
-
case "number":
|
|
34864
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34865
|
-
Input,
|
|
34866
|
-
{
|
|
34867
|
-
type: "number",
|
|
34868
|
-
value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
|
|
34869
|
-
onChange: (e) => {
|
|
34870
|
-
const val = e.target.value;
|
|
34871
|
-
if (!val && !isRequired) {
|
|
34872
|
-
handleFieldChange(path, void 0);
|
|
34873
|
-
} else {
|
|
34874
|
-
const num = Number(val);
|
|
34875
|
-
if (!isNaN(num)) {
|
|
34876
|
-
handleFieldChange(path, num);
|
|
34877
|
-
}
|
|
34878
|
-
}
|
|
34879
|
-
},
|
|
34880
|
-
placeholder: propSchema.description,
|
|
34881
|
-
required: isRequired,
|
|
34882
|
-
min: propSchema.minimum,
|
|
34883
|
-
max: propSchema.maximum
|
|
34884
|
-
}
|
|
34885
|
-
);
|
|
34886
|
-
case "integer":
|
|
34887
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34888
|
-
Input,
|
|
34889
|
-
{
|
|
34890
|
-
type: "number",
|
|
34891
|
-
step: "1",
|
|
34892
|
-
value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
|
|
34893
|
-
onChange: (e) => {
|
|
34894
|
-
const val = e.target.value;
|
|
34895
|
-
if (!val && !isRequired) {
|
|
34896
|
-
handleFieldChange(path, void 0);
|
|
34897
|
-
} else {
|
|
34898
|
-
const num = Number(val);
|
|
34899
|
-
if (!isNaN(num) && Number.isInteger(num)) {
|
|
34900
|
-
handleFieldChange(path, num);
|
|
34901
|
-
}
|
|
35125
|
+
case "boolean":
|
|
35126
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35127
|
+
Input,
|
|
35128
|
+
{
|
|
35129
|
+
type: "checkbox",
|
|
35130
|
+
checked: currentValue ?? false,
|
|
35131
|
+
onChange: (e) => handleFieldChange(path, e.target.checked),
|
|
35132
|
+
className: "w-4 h-4",
|
|
35133
|
+
required: isRequired
|
|
35134
|
+
}
|
|
35135
|
+
);
|
|
35136
|
+
case "null":
|
|
35137
|
+
return null;
|
|
35138
|
+
case "object":
|
|
35139
|
+
if (!propSchema.properties) {
|
|
35140
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35141
|
+
JsonEditor,
|
|
35142
|
+
{
|
|
35143
|
+
value: JSON.stringify(currentValue ?? {}, null, 2),
|
|
35144
|
+
onChange: (newValue) => {
|
|
35145
|
+
try {
|
|
35146
|
+
const parsed = JSON.parse(newValue);
|
|
35147
|
+
handleFieldChange(path, parsed);
|
|
35148
|
+
setJsonError(void 0);
|
|
35149
|
+
} catch (err) {
|
|
35150
|
+
setJsonError(
|
|
35151
|
+
err instanceof Error ? err.message : "Invalid JSON"
|
|
35152
|
+
);
|
|
35153
|
+
}
|
|
35154
|
+
},
|
|
35155
|
+
error: jsonError
|
|
34902
35156
|
}
|
|
34903
|
-
|
|
34904
|
-
placeholder: propSchema.description,
|
|
34905
|
-
required: isRequired,
|
|
34906
|
-
min: propSchema.minimum,
|
|
34907
|
-
max: propSchema.maximum
|
|
35157
|
+
);
|
|
34908
35158
|
}
|
|
34909
|
-
|
|
34910
|
-
|
|
34911
|
-
|
|
34912
|
-
|
|
34913
|
-
|
|
34914
|
-
|
|
34915
|
-
|
|
34916
|
-
|
|
34917
|
-
|
|
34918
|
-
|
|
35159
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 border rounded p-3", children: Object.entries(propSchema.properties).map(([key, subSchema]) => {
|
|
35160
|
+
var _a2;
|
|
35161
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
35162
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium mb-1", children: [
|
|
35163
|
+
key,
|
|
35164
|
+
((_a2 = propSchema.required) == null ? void 0 : _a2.includes(key)) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
35165
|
+
] }),
|
|
35166
|
+
renderFormFields(
|
|
35167
|
+
subSchema,
|
|
35168
|
+
currentValue == null ? void 0 : currentValue[key],
|
|
35169
|
+
[...path, key],
|
|
35170
|
+
depth + 1,
|
|
35171
|
+
propSchema,
|
|
35172
|
+
key
|
|
35173
|
+
)
|
|
35174
|
+
] }, key);
|
|
35175
|
+
}) });
|
|
35176
|
+
case "array": {
|
|
35177
|
+
const arrayValue = Array.isArray(currentValue) ? currentValue : [];
|
|
35178
|
+
if (!propSchema.items) return null;
|
|
35179
|
+
if (isSimpleObject(propSchema.items)) {
|
|
35180
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
35181
|
+
propSchema.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: propSchema.description }),
|
|
35182
|
+
((_b = propSchema.items) == null ? void 0 : _b.description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
|
|
35183
|
+
"Items: ",
|
|
35184
|
+
propSchema.items.description
|
|
35185
|
+
] }),
|
|
35186
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
35187
|
+
arrayValue.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
35188
|
+
renderFormFields(
|
|
35189
|
+
propSchema.items,
|
|
35190
|
+
item,
|
|
35191
|
+
[...path, index2.toString()],
|
|
35192
|
+
depth + 1
|
|
35193
|
+
),
|
|
35194
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35195
|
+
Button,
|
|
35196
|
+
{
|
|
35197
|
+
variant: "outline",
|
|
35198
|
+
size: "sm",
|
|
35199
|
+
onClick: () => {
|
|
35200
|
+
const newArray = [...arrayValue];
|
|
35201
|
+
newArray.splice(index2, 1);
|
|
35202
|
+
handleFieldChange(path, newArray);
|
|
35203
|
+
},
|
|
35204
|
+
children: "Remove"
|
|
35205
|
+
}
|
|
35206
|
+
)
|
|
35207
|
+
] }, index2)),
|
|
35208
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35209
|
+
Button,
|
|
35210
|
+
{
|
|
35211
|
+
variant: "outline",
|
|
35212
|
+
size: "sm",
|
|
35213
|
+
onClick: () => {
|
|
35214
|
+
const defaultValue = getArrayItemDefault(
|
|
35215
|
+
propSchema.items
|
|
35216
|
+
);
|
|
35217
|
+
handleFieldChange(path, [...arrayValue, defaultValue]);
|
|
35218
|
+
},
|
|
35219
|
+
title: ((_c = propSchema.items) == null ? void 0 : _c.description) ? `Add new ${propSchema.items.description}` : "Add new item",
|
|
35220
|
+
children: "Add Item"
|
|
35221
|
+
}
|
|
35222
|
+
)
|
|
35223
|
+
] })
|
|
35224
|
+
] });
|
|
34919
35225
|
}
|
|
34920
|
-
);
|
|
34921
|
-
case "null":
|
|
34922
|
-
return null;
|
|
34923
|
-
case "object":
|
|
34924
|
-
if (!propSchema.properties) {
|
|
34925
35226
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34926
35227
|
JsonEditor,
|
|
34927
35228
|
{
|
|
34928
|
-
value: JSON.stringify(currentValue ??
|
|
35229
|
+
value: JSON.stringify(currentValue ?? [], null, 2),
|
|
34929
35230
|
onChange: (newValue) => {
|
|
34930
35231
|
try {
|
|
34931
35232
|
const parsed = JSON.parse(newValue);
|
|
@@ -34941,189 +35242,88 @@ const DynamicJsonForm = ({
|
|
|
34941
35242
|
}
|
|
34942
35243
|
);
|
|
34943
35244
|
}
|
|
34944
|
-
|
|
34945
|
-
|
|
34946
|
-
|
|
34947
|
-
|
|
34948
|
-
|
|
34949
|
-
|
|
34950
|
-
|
|
34951
|
-
|
|
34952
|
-
subSchema,
|
|
34953
|
-
currentValue == null ? void 0 : currentValue[key],
|
|
34954
|
-
[...path, key],
|
|
34955
|
-
depth + 1,
|
|
34956
|
-
propSchema,
|
|
34957
|
-
key
|
|
34958
|
-
)
|
|
34959
|
-
] }, key);
|
|
34960
|
-
}) });
|
|
34961
|
-
case "array": {
|
|
34962
|
-
const arrayValue = Array.isArray(currentValue) ? currentValue : [];
|
|
34963
|
-
if (!propSchema.items) return null;
|
|
34964
|
-
if (isSimpleObject(propSchema.items)) {
|
|
34965
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
34966
|
-
propSchema.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: propSchema.description }),
|
|
34967
|
-
((_b = propSchema.items) == null ? void 0 : _b.description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
|
|
34968
|
-
"Items: ",
|
|
34969
|
-
propSchema.items.description
|
|
34970
|
-
] }),
|
|
34971
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
34972
|
-
arrayValue.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
34973
|
-
renderFormFields(
|
|
34974
|
-
propSchema.items,
|
|
34975
|
-
item,
|
|
34976
|
-
[...path, index2.toString()],
|
|
34977
|
-
depth + 1
|
|
34978
|
-
),
|
|
34979
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34980
|
-
Button,
|
|
34981
|
-
{
|
|
34982
|
-
variant: "outline",
|
|
34983
|
-
size: "sm",
|
|
34984
|
-
onClick: () => {
|
|
34985
|
-
const newArray = [...arrayValue];
|
|
34986
|
-
newArray.splice(index2, 1);
|
|
34987
|
-
handleFieldChange(path, newArray);
|
|
34988
|
-
},
|
|
34989
|
-
children: "Remove"
|
|
34990
|
-
}
|
|
34991
|
-
)
|
|
34992
|
-
] }, index2)),
|
|
34993
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34994
|
-
Button,
|
|
34995
|
-
{
|
|
34996
|
-
variant: "outline",
|
|
34997
|
-
size: "sm",
|
|
34998
|
-
onClick: () => {
|
|
34999
|
-
const defaultValue = getArrayItemDefault(
|
|
35000
|
-
propSchema.items
|
|
35001
|
-
);
|
|
35002
|
-
handleFieldChange(path, [...arrayValue, defaultValue]);
|
|
35003
|
-
},
|
|
35004
|
-
title: ((_c = propSchema.items) == null ? void 0 : _c.description) ? `Add new ${propSchema.items.description}` : "Add new item",
|
|
35005
|
-
children: "Add Item"
|
|
35006
|
-
}
|
|
35007
|
-
)
|
|
35008
|
-
] })
|
|
35009
|
-
] });
|
|
35010
|
-
}
|
|
35011
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35012
|
-
JsonEditor,
|
|
35013
|
-
{
|
|
35014
|
-
value: JSON.stringify(currentValue ?? [], null, 2),
|
|
35015
|
-
onChange: (newValue) => {
|
|
35016
|
-
try {
|
|
35017
|
-
const parsed = JSON.parse(newValue);
|
|
35018
|
-
handleFieldChange(path, parsed);
|
|
35019
|
-
setJsonError(void 0);
|
|
35020
|
-
} catch (err) {
|
|
35021
|
-
setJsonError(
|
|
35022
|
-
err instanceof Error ? err.message : "Invalid JSON"
|
|
35023
|
-
);
|
|
35024
|
-
}
|
|
35025
|
-
},
|
|
35026
|
-
error: jsonError
|
|
35027
|
-
}
|
|
35028
|
-
);
|
|
35245
|
+
default:
|
|
35246
|
+
return null;
|
|
35247
|
+
}
|
|
35248
|
+
};
|
|
35249
|
+
const handleFieldChange = (path, fieldValue) => {
|
|
35250
|
+
if (path.length === 0) {
|
|
35251
|
+
onChange(fieldValue);
|
|
35252
|
+
return;
|
|
35029
35253
|
}
|
|
35030
|
-
default:
|
|
35031
|
-
return null;
|
|
35032
|
-
}
|
|
35033
|
-
};
|
|
35034
|
-
const handleFieldChange = (path, fieldValue) => {
|
|
35035
|
-
if (path.length === 0) {
|
|
35036
|
-
onChange(fieldValue);
|
|
35037
|
-
return;
|
|
35038
|
-
}
|
|
35039
|
-
try {
|
|
35040
|
-
const newValue = updateValueAtPath(value, path, fieldValue);
|
|
35041
|
-
onChange(newValue);
|
|
35042
|
-
} catch (error) {
|
|
35043
|
-
console.error("Failed to update form value:", error);
|
|
35044
|
-
onChange(value);
|
|
35045
|
-
}
|
|
35046
|
-
};
|
|
35047
|
-
const shouldUseJsonMode = schema.type === "object" && (!schema.properties || Object.keys(schema.properties).length === 0);
|
|
35048
|
-
reactExports.useEffect(() => {
|
|
35049
|
-
if (shouldUseJsonMode && !isJsonMode) {
|
|
35050
|
-
setIsJsonMode(true);
|
|
35051
|
-
}
|
|
35052
|
-
}, [shouldUseJsonMode, isJsonMode]);
|
|
35053
|
-
const handleCopyJson = reactExports.useCallback(() => {
|
|
35054
|
-
const copyToClipboard = async () => {
|
|
35055
35254
|
try {
|
|
35056
|
-
|
|
35057
|
-
|
|
35058
|
-
);
|
|
35059
|
-
setCopiedJson(true);
|
|
35060
|
-
toast2({
|
|
35061
|
-
title: "JSON copied",
|
|
35062
|
-
description: "The JSON data has been successfully copied to your clipboard."
|
|
35063
|
-
});
|
|
35064
|
-
setTimeout(() => {
|
|
35065
|
-
setCopiedJson(false);
|
|
35066
|
-
}, 2e3);
|
|
35255
|
+
const newValue = updateValueAtPath(value, path, fieldValue);
|
|
35256
|
+
onChange(newValue);
|
|
35067
35257
|
} catch (error) {
|
|
35068
|
-
|
|
35069
|
-
|
|
35070
|
-
description: `Failed to copy JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
35071
|
-
variant: "destructive"
|
|
35072
|
-
});
|
|
35258
|
+
console.error("Failed to update form value:", error);
|
|
35259
|
+
onChange(value);
|
|
35073
35260
|
}
|
|
35074
35261
|
};
|
|
35075
|
-
|
|
35076
|
-
|
|
35077
|
-
|
|
35078
|
-
|
|
35079
|
-
|
|
35080
|
-
|
|
35081
|
-
|
|
35082
|
-
|
|
35083
|
-
|
|
35084
|
-
|
|
35085
|
-
|
|
35086
|
-
|
|
35087
|
-
|
|
35088
|
-
|
|
35089
|
-
|
|
35090
|
-
|
|
35091
|
-
|
|
35092
|
-
|
|
35093
|
-
|
|
35262
|
+
const shouldUseJsonMode = schema.type === "object" && (!schema.properties || Object.keys(schema.properties).length === 0);
|
|
35263
|
+
reactExports.useEffect(() => {
|
|
35264
|
+
if (shouldUseJsonMode && !isJsonMode) {
|
|
35265
|
+
setIsJsonMode(true);
|
|
35266
|
+
}
|
|
35267
|
+
}, [shouldUseJsonMode, isJsonMode]);
|
|
35268
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
35269
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end space-x-2", children: [
|
|
35270
|
+
isJsonMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
35271
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
35272
|
+
Button,
|
|
35273
|
+
{
|
|
35274
|
+
type: "button",
|
|
35275
|
+
variant: "outline",
|
|
35276
|
+
size: "sm",
|
|
35277
|
+
onClick: handleCopyJson,
|
|
35278
|
+
children: [
|
|
35279
|
+
copiedJson ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "h-4 w-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-4 w-4 mr-2" }),
|
|
35280
|
+
"Copy JSON"
|
|
35281
|
+
]
|
|
35282
|
+
}
|
|
35283
|
+
),
|
|
35284
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35285
|
+
Button,
|
|
35286
|
+
{
|
|
35287
|
+
type: "button",
|
|
35288
|
+
variant: "outline",
|
|
35289
|
+
size: "sm",
|
|
35290
|
+
onClick: formatJson,
|
|
35291
|
+
children: "Format JSON"
|
|
35292
|
+
}
|
|
35293
|
+
)
|
|
35294
|
+
] }),
|
|
35295
|
+
!isOnlyJSON && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35094
35296
|
Button,
|
|
35095
35297
|
{
|
|
35096
|
-
type: "button",
|
|
35097
35298
|
variant: "outline",
|
|
35098
35299
|
size: "sm",
|
|
35099
|
-
onClick:
|
|
35100
|
-
children: "
|
|
35300
|
+
onClick: handleSwitchToFormMode,
|
|
35301
|
+
children: isJsonMode ? "Switch to Form" : "Switch to JSON"
|
|
35101
35302
|
}
|
|
35102
35303
|
)
|
|
35103
35304
|
] }),
|
|
35104
|
-
|
|
35105
|
-
|
|
35106
|
-
|
|
35107
|
-
|
|
35108
|
-
|
|
35109
|
-
|
|
35110
|
-
|
|
35111
|
-
|
|
35112
|
-
|
|
35113
|
-
}
|
|
35114
|
-
|
|
35115
|
-
|
|
35116
|
-
|
|
35117
|
-
|
|
35118
|
-
|
|
35119
|
-
|
|
35120
|
-
|
|
35121
|
-
|
|
35122
|
-
|
|
35123
|
-
|
|
35124
|
-
|
|
35125
|
-
|
|
35126
|
-
};
|
|
35305
|
+
isJsonMode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35306
|
+
JsonEditor,
|
|
35307
|
+
{
|
|
35308
|
+
value: rawJsonValue,
|
|
35309
|
+
onChange: (newValue) => {
|
|
35310
|
+
setRawJsonValue(newValue);
|
|
35311
|
+
debouncedUpdateParent(newValue);
|
|
35312
|
+
},
|
|
35313
|
+
error: jsonError
|
|
35314
|
+
}
|
|
35315
|
+
) : (
|
|
35316
|
+
// If schema type is object but value is not an object or is empty, and we have actual JSON data,
|
|
35317
|
+
// render a simple representation of the JSON data
|
|
35318
|
+
schema.type === "object" && (typeof value !== "object" || value === null || Object.keys(value).length === 0) && rawJsonValue && rawJsonValue !== "{}" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 border rounded-md p-4", children: [
|
|
35319
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Form view not available for this JSON structure. Using simplified view:" }),
|
|
35320
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "bg-gray-50 dark:bg-gray-800 dark:text-gray-100 p-4 rounded text-sm overflow-auto", children: rawJsonValue }),
|
|
35321
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Use JSON mode for full editing capabilities." })
|
|
35322
|
+
] }) : renderFormFields(schema, value)
|
|
35323
|
+
)
|
|
35324
|
+
] });
|
|
35325
|
+
}
|
|
35326
|
+
);
|
|
35127
35327
|
const SamplingRequest = ({
|
|
35128
35328
|
onApprove,
|
|
35129
35329
|
request,
|
|
@@ -35314,7 +35514,7 @@ var Select$1 = (props) => {
|
|
|
35314
35514
|
defaultValue,
|
|
35315
35515
|
onValueChange,
|
|
35316
35516
|
dir,
|
|
35317
|
-
name,
|
|
35517
|
+
name: name2,
|
|
35318
35518
|
autoComplete,
|
|
35319
35519
|
disabled,
|
|
35320
35520
|
required: required2,
|
|
@@ -35384,7 +35584,7 @@ var Select$1 = (props) => {
|
|
|
35384
35584
|
"aria-hidden": true,
|
|
35385
35585
|
required: required2,
|
|
35386
35586
|
tabIndex: -1,
|
|
35387
|
-
name,
|
|
35587
|
+
name: name2,
|
|
35388
35588
|
autoComplete,
|
|
35389
35589
|
value,
|
|
35390
35590
|
onChange: (event) => setValue(event.target.value),
|
|
@@ -36578,7 +36778,7 @@ const useTheme = () => {
|
|
|
36578
36778
|
[theme, setThemeWithSideEffect]
|
|
36579
36779
|
);
|
|
36580
36780
|
};
|
|
36581
|
-
const version = "0.
|
|
36781
|
+
const version = "0.17.0";
|
|
36582
36782
|
var [createTooltipContext] = createContextScope("Tooltip", [
|
|
36583
36783
|
createPopperScope
|
|
36584
36784
|
]);
|
|
@@ -37084,7 +37284,7 @@ var Switch$1 = reactExports.forwardRef(
|
|
|
37084
37284
|
(props, forwardedRef) => {
|
|
37085
37285
|
const {
|
|
37086
37286
|
__scopeSwitch,
|
|
37087
|
-
name,
|
|
37287
|
+
name: name2,
|
|
37088
37288
|
checked: checkedProp,
|
|
37089
37289
|
defaultChecked,
|
|
37090
37290
|
required: required2,
|
|
@@ -37132,7 +37332,7 @@ var Switch$1 = reactExports.forwardRef(
|
|
|
37132
37332
|
{
|
|
37133
37333
|
control: button,
|
|
37134
37334
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
37135
|
-
name,
|
|
37335
|
+
name: name2,
|
|
37136
37336
|
value,
|
|
37137
37337
|
checked,
|
|
37138
37338
|
required: required2,
|
|
@@ -37299,8 +37499,8 @@ const CustomHeaders = ({
|
|
|
37299
37499
|
return;
|
|
37300
37500
|
}
|
|
37301
37501
|
const newHeaders = Object.entries(parsed).map(
|
|
37302
|
-
([
|
|
37303
|
-
name,
|
|
37502
|
+
([name2, value]) => ({
|
|
37503
|
+
name: name2,
|
|
37304
37504
|
value: String(value),
|
|
37305
37505
|
enabled: true
|
|
37306
37506
|
})
|
|
@@ -37473,7 +37673,9 @@ const Sidebar = ({
|
|
|
37473
37673
|
sendLogLevelRequest,
|
|
37474
37674
|
loggingSupported,
|
|
37475
37675
|
config,
|
|
37476
|
-
setConfig
|
|
37676
|
+
setConfig,
|
|
37677
|
+
connectionType,
|
|
37678
|
+
setConnectionType
|
|
37477
37679
|
}) => {
|
|
37478
37680
|
const [theme, setTheme] = useTheme();
|
|
37479
37681
|
const [showEnvVars, setShowEnvVars] = reactExports.useState(false);
|
|
@@ -37483,6 +37685,7 @@ const Sidebar = ({
|
|
|
37483
37685
|
const [copiedServerEntry, setCopiedServerEntry] = reactExports.useState(false);
|
|
37484
37686
|
const [copiedServerFile, setCopiedServerFile] = reactExports.useState(false);
|
|
37485
37687
|
const { toast: toast2 } = useToast();
|
|
37688
|
+
const connectionTypeTip = "Connect to server directly (requires CORS config on server) or via MCP Inspector Proxy";
|
|
37486
37689
|
const reportError2 = reactExports.useCallback(
|
|
37487
37690
|
(error) => {
|
|
37488
37691
|
toast2({
|
|
@@ -37635,10 +37838,22 @@ const Sidebar = ({
|
|
|
37635
37838
|
}
|
|
37636
37839
|
)
|
|
37637
37840
|
] })
|
|
37638
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.
|
|
37639
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
37640
|
-
|
|
37641
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
37841
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
37842
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
37843
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", htmlFor: "sse-url-input", children: "URL" }),
|
|
37844
|
+
sseUrl ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
|
|
37845
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37846
|
+
Input,
|
|
37847
|
+
{
|
|
37848
|
+
id: "sse-url-input",
|
|
37849
|
+
placeholder: "URL",
|
|
37850
|
+
value: sseUrl,
|
|
37851
|
+
onChange: (e) => setSseUrl(e.target.value),
|
|
37852
|
+
className: "font-mono"
|
|
37853
|
+
}
|
|
37854
|
+
) }),
|
|
37855
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: sseUrl })
|
|
37856
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37642
37857
|
Input,
|
|
37643
37858
|
{
|
|
37644
37859
|
id: "sse-url-input",
|
|
@@ -37647,19 +37862,36 @@ const Sidebar = ({
|
|
|
37647
37862
|
onChange: (e) => setSseUrl(e.target.value),
|
|
37648
37863
|
className: "font-mono"
|
|
37649
37864
|
}
|
|
37650
|
-
)
|
|
37651
|
-
|
|
37652
|
-
|
|
37653
|
-
|
|
37654
|
-
|
|
37655
|
-
|
|
37656
|
-
|
|
37657
|
-
|
|
37658
|
-
|
|
37659
|
-
|
|
37660
|
-
|
|
37661
|
-
|
|
37662
|
-
|
|
37865
|
+
)
|
|
37866
|
+
] }),
|
|
37867
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
|
|
37868
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
37869
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37870
|
+
"label",
|
|
37871
|
+
{
|
|
37872
|
+
className: "text-sm font-medium",
|
|
37873
|
+
htmlFor: "connection-type-select",
|
|
37874
|
+
children: "Connection Type"
|
|
37875
|
+
}
|
|
37876
|
+
),
|
|
37877
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
37878
|
+
Select,
|
|
37879
|
+
{
|
|
37880
|
+
value: connectionType,
|
|
37881
|
+
onValueChange: (value) => setConnectionType(value),
|
|
37882
|
+
children: [
|
|
37883
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: "connection-type-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select connection type" }) }),
|
|
37884
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
37885
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "proxy", children: "Via Proxy" }),
|
|
37886
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "direct", children: "Direct" })
|
|
37887
|
+
] })
|
|
37888
|
+
]
|
|
37889
|
+
}
|
|
37890
|
+
)
|
|
37891
|
+
] }) }),
|
|
37892
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: connectionTypeTip })
|
|
37893
|
+
] })
|
|
37894
|
+
] }),
|
|
37663
37895
|
transportType === "stdio" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
37664
37896
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
37665
37897
|
Button,
|
|
@@ -38121,7 +38353,7 @@ function CheckboxProvider(props) {
|
|
|
38121
38353
|
defaultChecked,
|
|
38122
38354
|
disabled,
|
|
38123
38355
|
form,
|
|
38124
|
-
name,
|
|
38356
|
+
name: name2,
|
|
38125
38357
|
onCheckedChange,
|
|
38126
38358
|
required: required2,
|
|
38127
38359
|
value = "on",
|
|
@@ -38147,7 +38379,7 @@ function CheckboxProvider(props) {
|
|
|
38147
38379
|
setChecked,
|
|
38148
38380
|
control,
|
|
38149
38381
|
setControl,
|
|
38150
|
-
name,
|
|
38382
|
+
name: name2,
|
|
38151
38383
|
form,
|
|
38152
38384
|
value,
|
|
38153
38385
|
hasConsumerStoppedPropagationRef,
|
|
@@ -38223,7 +38455,7 @@ var Checkbox$1 = reactExports.forwardRef(
|
|
|
38223
38455
|
(props, forwardedRef) => {
|
|
38224
38456
|
const {
|
|
38225
38457
|
__scopeCheckbox,
|
|
38226
|
-
name,
|
|
38458
|
+
name: name2,
|
|
38227
38459
|
checked,
|
|
38228
38460
|
defaultChecked,
|
|
38229
38461
|
required: required2,
|
|
@@ -38242,7 +38474,7 @@ var Checkbox$1 = reactExports.forwardRef(
|
|
|
38242
38474
|
disabled,
|
|
38243
38475
|
required: required2,
|
|
38244
38476
|
onCheckedChange,
|
|
38245
|
-
name,
|
|
38477
|
+
name: name2,
|
|
38246
38478
|
form,
|
|
38247
38479
|
value,
|
|
38248
38480
|
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -38300,7 +38532,7 @@ var CheckboxBubbleInput = reactExports.forwardRef(
|
|
|
38300
38532
|
defaultChecked,
|
|
38301
38533
|
required: required2,
|
|
38302
38534
|
disabled,
|
|
38303
|
-
name,
|
|
38535
|
+
name: name2,
|
|
38304
38536
|
value,
|
|
38305
38537
|
form,
|
|
38306
38538
|
bubbleInput,
|
|
@@ -38335,7 +38567,7 @@ var CheckboxBubbleInput = reactExports.forwardRef(
|
|
|
38335
38567
|
defaultChecked: defaultChecked ?? defaultCheckedRef.current,
|
|
38336
38568
|
required: required2,
|
|
38337
38569
|
disabled,
|
|
38338
|
-
name,
|
|
38570
|
+
name: name2,
|
|
38339
38571
|
value,
|
|
38340
38572
|
form,
|
|
38341
38573
|
...props,
|
|
@@ -38389,7 +38621,7 @@ Checkbox.displayName = Checkbox$1.displayName;
|
|
|
38389
38621
|
const ResourceLinkView = reactExports.memo(
|
|
38390
38622
|
({
|
|
38391
38623
|
uri,
|
|
38392
|
-
name,
|
|
38624
|
+
name: name2,
|
|
38393
38625
|
description: description2,
|
|
38394
38626
|
mimeType,
|
|
38395
38627
|
resourceContent,
|
|
@@ -38444,7 +38676,7 @@ const ResourceLinkView = reactExports.memo(
|
|
|
38444
38676
|
onReadResource && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 flex-shrink-0", "aria-hidden": "true", children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: expanded ? "▼" : "▶" }) })
|
|
38445
38677
|
] })
|
|
38446
38678
|
] }),
|
|
38447
|
-
|
|
38679
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-sm text-gray-900 dark:text-gray-100 mb-1", children: name2 }),
|
|
38448
38680
|
description2 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-300 leading-relaxed", children: description2 })
|
|
38449
38681
|
] })
|
|
38450
38682
|
}
|
|
@@ -38626,6 +38858,7 @@ const ToolsTab = ({
|
|
|
38626
38858
|
setSelectedTool,
|
|
38627
38859
|
toolResult,
|
|
38628
38860
|
nextCursor,
|
|
38861
|
+
error,
|
|
38629
38862
|
resourceContent,
|
|
38630
38863
|
onReadResource
|
|
38631
38864
|
}) => {
|
|
@@ -38633,8 +38866,17 @@ const ToolsTab = ({
|
|
|
38633
38866
|
const [isToolRunning, setIsToolRunning] = reactExports.useState(false);
|
|
38634
38867
|
const [isOutputSchemaExpanded, setIsOutputSchemaExpanded] = reactExports.useState(false);
|
|
38635
38868
|
const [isMetaExpanded, setIsMetaExpanded] = reactExports.useState(false);
|
|
38869
|
+
const [hasValidationErrors, setHasValidationErrors] = reactExports.useState(false);
|
|
38870
|
+
const formRefs = reactExports.useRef({});
|
|
38636
38871
|
const { toast: toast2 } = useToast();
|
|
38637
38872
|
const { copied, setCopied } = useCopy();
|
|
38873
|
+
const checkValidationErrors = () => {
|
|
38874
|
+
const errors = Object.values(formRefs.current).some(
|
|
38875
|
+
(ref2) => ref2 && !ref2.validateJson().isValid
|
|
38876
|
+
);
|
|
38877
|
+
setHasValidationErrors(errors);
|
|
38878
|
+
return errors;
|
|
38879
|
+
};
|
|
38638
38880
|
reactExports.useEffect(() => {
|
|
38639
38881
|
const params2 = Object.entries(
|
|
38640
38882
|
(selectedTool == null ? void 0 : selectedTool.inputSchema.properties) ?? []
|
|
@@ -38647,6 +38889,8 @@ const ToolsTab = ({
|
|
|
38647
38889
|
)
|
|
38648
38890
|
]);
|
|
38649
38891
|
setParams(Object.fromEntries(params2));
|
|
38892
|
+
setHasValidationErrors(false);
|
|
38893
|
+
formRefs.current = {};
|
|
38650
38894
|
}, [selectedTool]);
|
|
38651
38895
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "tools", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
38652
38896
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -38671,6 +38915,11 @@ const ToolsTab = ({
|
|
|
38671
38915
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card border border-border rounded-lg shadow", children: [
|
|
38672
38916
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-border", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold", children: selectedTool ? selectedTool.name : "Select a tool" }) }),
|
|
38673
38917
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: selectedTool ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
38918
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
|
|
38919
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
38920
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
|
|
38921
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
|
|
38922
|
+
] }),
|
|
38674
38923
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: selectedTool.description }),
|
|
38675
38924
|
Object.entries(selectedTool.inputSchema.properties ?? []).map(
|
|
38676
38925
|
([key, value]) => {
|
|
@@ -38716,16 +38965,27 @@ const ToolsTab = ({
|
|
|
38716
38965
|
id: key,
|
|
38717
38966
|
name: key,
|
|
38718
38967
|
placeholder: prop.description,
|
|
38719
|
-
value: params[key]
|
|
38720
|
-
onChange: (e) =>
|
|
38721
|
-
|
|
38722
|
-
|
|
38723
|
-
|
|
38968
|
+
value: params[key] === void 0 ? "" : String(params[key]),
|
|
38969
|
+
onChange: (e) => {
|
|
38970
|
+
const value2 = e.target.value;
|
|
38971
|
+
if (value2 === "") {
|
|
38972
|
+
setParams({
|
|
38973
|
+
...params,
|
|
38974
|
+
[key]: void 0
|
|
38975
|
+
});
|
|
38976
|
+
} else {
|
|
38977
|
+
setParams({
|
|
38978
|
+
...params,
|
|
38979
|
+
[key]: value2
|
|
38980
|
+
});
|
|
38981
|
+
}
|
|
38982
|
+
},
|
|
38724
38983
|
className: "mt-1"
|
|
38725
38984
|
}
|
|
38726
38985
|
) : prop.type === "object" || prop.type === "array" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38727
38986
|
DynamicJsonForm,
|
|
38728
38987
|
{
|
|
38988
|
+
ref: (ref2) => formRefs.current[key] = ref2,
|
|
38729
38989
|
schema: {
|
|
38730
38990
|
type: prop.type,
|
|
38731
38991
|
properties: prop.properties,
|
|
@@ -38738,6 +38998,7 @@ const ToolsTab = ({
|
|
|
38738
38998
|
...params,
|
|
38739
38999
|
[key]: newValue
|
|
38740
39000
|
});
|
|
39001
|
+
setTimeout(checkValidationErrors, 100);
|
|
38741
39002
|
}
|
|
38742
39003
|
}
|
|
38743
39004
|
) }) : prop.type === "number" || prop.type === "integer" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -38747,19 +39008,35 @@ const ToolsTab = ({
|
|
|
38747
39008
|
id: key,
|
|
38748
39009
|
name: key,
|
|
38749
39010
|
placeholder: prop.description,
|
|
38750
|
-
value: params[key]
|
|
39011
|
+
value: params[key] === void 0 ? "" : String(params[key]),
|
|
38751
39012
|
onChange: (e) => {
|
|
38752
39013
|
const value2 = e.target.value;
|
|
38753
|
-
|
|
38754
|
-
|
|
38755
|
-
|
|
38756
|
-
|
|
39014
|
+
if (value2 === "") {
|
|
39015
|
+
setParams({
|
|
39016
|
+
...params,
|
|
39017
|
+
[key]: void 0
|
|
39018
|
+
});
|
|
39019
|
+
} else {
|
|
39020
|
+
const num = Number(value2);
|
|
39021
|
+
if (!isNaN(num)) {
|
|
39022
|
+
setParams({
|
|
39023
|
+
...params,
|
|
39024
|
+
[key]: num
|
|
39025
|
+
});
|
|
39026
|
+
} else {
|
|
39027
|
+
setParams({
|
|
39028
|
+
...params,
|
|
39029
|
+
[key]: value2
|
|
39030
|
+
});
|
|
39031
|
+
}
|
|
39032
|
+
}
|
|
38757
39033
|
},
|
|
38758
39034
|
className: "mt-1"
|
|
38759
39035
|
}
|
|
38760
39036
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38761
39037
|
DynamicJsonForm,
|
|
38762
39038
|
{
|
|
39039
|
+
ref: (ref2) => formRefs.current[key] = ref2,
|
|
38763
39040
|
schema: {
|
|
38764
39041
|
type: prop.type,
|
|
38765
39042
|
properties: prop.properties,
|
|
@@ -38772,6 +39049,7 @@ const ToolsTab = ({
|
|
|
38772
39049
|
...params,
|
|
38773
39050
|
[key]: newValue
|
|
38774
39051
|
});
|
|
39052
|
+
setTimeout(checkValidationErrors, 100);
|
|
38775
39053
|
}
|
|
38776
39054
|
}
|
|
38777
39055
|
) })
|
|
@@ -38839,6 +39117,7 @@ const ToolsTab = ({
|
|
|
38839
39117
|
Button,
|
|
38840
39118
|
{
|
|
38841
39119
|
onClick: async () => {
|
|
39120
|
+
if (checkValidationErrors()) return;
|
|
38842
39121
|
try {
|
|
38843
39122
|
setIsToolRunning(true);
|
|
38844
39123
|
await callTool(selectedTool.name, params);
|
|
@@ -38846,7 +39125,7 @@ const ToolsTab = ({
|
|
|
38846
39125
|
setIsToolRunning(false);
|
|
38847
39126
|
}
|
|
38848
39127
|
},
|
|
38849
|
-
disabled: isToolRunning,
|
|
39128
|
+
disabled: isToolRunning || hasValidationErrors,
|
|
38850
39129
|
children: isToolRunning ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
38851
39130
|
/* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-4 h-4 mr-2 animate-spin" }),
|
|
38852
39131
|
"Running..."
|
|
@@ -38865,10 +39144,10 @@ const ToolsTab = ({
|
|
|
38865
39144
|
JSON.stringify(params, null, 2)
|
|
38866
39145
|
);
|
|
38867
39146
|
setCopied(true);
|
|
38868
|
-
} catch (
|
|
39147
|
+
} catch (error2) {
|
|
38869
39148
|
toast2({
|
|
38870
39149
|
title: "Error",
|
|
38871
|
-
description: `There was an error copying input to the clipboard: ${
|
|
39150
|
+
description: `There was an error copying input to the clipboard: ${error2 instanceof Error ? error2.message : String(error2)}`,
|
|
38872
39151
|
variant: "destructive"
|
|
38873
39152
|
});
|
|
38874
39153
|
}
|
|
@@ -39050,6 +39329,11 @@ const App = () => {
|
|
|
39050
39329
|
const [args, setArgs] = reactExports.useState(getInitialArgs);
|
|
39051
39330
|
const [sseUrl, setSseUrl] = reactExports.useState(getInitialSseUrl);
|
|
39052
39331
|
const [transportType, setTransportType] = reactExports.useState(getInitialTransportType);
|
|
39332
|
+
const [connectionType, setConnectionType] = reactExports.useState(
|
|
39333
|
+
() => {
|
|
39334
|
+
return localStorage.getItem("lastConnectionType") || "proxy";
|
|
39335
|
+
}
|
|
39336
|
+
);
|
|
39053
39337
|
const [logLevel, setLogLevel] = reactExports.useState("debug");
|
|
39054
39338
|
const [notifications, setNotifications] = reactExports.useState([]);
|
|
39055
39339
|
const [roots, setRoots] = reactExports.useState([]);
|
|
@@ -39090,7 +39374,7 @@ const App = () => {
|
|
|
39090
39374
|
{
|
|
39091
39375
|
name: "Authorization",
|
|
39092
39376
|
value: "Bearer ",
|
|
39093
|
-
enabled:
|
|
39377
|
+
enabled: false
|
|
39094
39378
|
}
|
|
39095
39379
|
];
|
|
39096
39380
|
});
|
|
@@ -39152,6 +39436,7 @@ const App = () => {
|
|
|
39152
39436
|
oauthClientId,
|
|
39153
39437
|
oauthScope,
|
|
39154
39438
|
config,
|
|
39439
|
+
connectionType,
|
|
39155
39440
|
onNotification: (notification) => {
|
|
39156
39441
|
setNotifications((prev) => [...prev, notification]);
|
|
39157
39442
|
},
|
|
@@ -39218,6 +39503,9 @@ const App = () => {
|
|
|
39218
39503
|
reactExports.useEffect(() => {
|
|
39219
39504
|
localStorage.setItem("lastTransportType", transportType);
|
|
39220
39505
|
}, [transportType]);
|
|
39506
|
+
reactExports.useEffect(() => {
|
|
39507
|
+
localStorage.setItem("lastConnectionType", connectionType);
|
|
39508
|
+
}, [connectionType]);
|
|
39221
39509
|
reactExports.useEffect(() => {
|
|
39222
39510
|
if (bearerToken) {
|
|
39223
39511
|
localStorage.setItem("lastBearerToken", bearerToken);
|
|
@@ -39485,12 +39773,12 @@ const App = () => {
|
|
|
39485
39773
|
);
|
|
39486
39774
|
setNextResourceTemplateCursor(response.nextCursor);
|
|
39487
39775
|
};
|
|
39488
|
-
const getPrompt = async (
|
|
39776
|
+
const getPrompt = async (name2, args2 = {}) => {
|
|
39489
39777
|
lastToolCallOriginTabRef.current = currentTabRef.current;
|
|
39490
39778
|
const response = await sendMCPRequest(
|
|
39491
39779
|
{
|
|
39492
39780
|
method: "prompts/get",
|
|
39493
|
-
params: { name, arguments: args2 }
|
|
39781
|
+
params: { name: name2, arguments: args2 }
|
|
39494
39782
|
},
|
|
39495
39783
|
GetPromptResultSchema,
|
|
39496
39784
|
"prompts"
|
|
@@ -39569,15 +39857,17 @@ const App = () => {
|
|
|
39569
39857
|
setNextToolCursor(response.nextCursor);
|
|
39570
39858
|
cacheToolOutputSchemas(response.tools);
|
|
39571
39859
|
};
|
|
39572
|
-
const callTool = async (
|
|
39860
|
+
const callTool = async (name2, params) => {
|
|
39573
39861
|
lastToolCallOriginTabRef.current = currentTabRef.current;
|
|
39574
39862
|
try {
|
|
39863
|
+
const tool = tools.find((t) => t.name === name2);
|
|
39864
|
+
const cleanedParams = (tool == null ? void 0 : tool.inputSchema) ? cleanParams(params, tool.inputSchema) : params;
|
|
39575
39865
|
const response = await sendMCPRequest(
|
|
39576
39866
|
{
|
|
39577
39867
|
method: "tools/call",
|
|
39578
39868
|
params: {
|
|
39579
|
-
name,
|
|
39580
|
-
arguments:
|
|
39869
|
+
name: name2,
|
|
39870
|
+
arguments: cleanedParams,
|
|
39581
39871
|
_meta: {
|
|
39582
39872
|
progressToken: progressTokenRef.current++
|
|
39583
39873
|
}
|
|
@@ -39587,6 +39877,7 @@ const App = () => {
|
|
|
39587
39877
|
"tools"
|
|
39588
39878
|
);
|
|
39589
39879
|
setToolResult(response);
|
|
39880
|
+
setErrors((prev) => ({ ...prev, tools: null }));
|
|
39590
39881
|
} catch (e) {
|
|
39591
39882
|
const toolResult2 = {
|
|
39592
39883
|
content: [
|
|
@@ -39598,6 +39889,7 @@ const App = () => {
|
|
|
39598
39889
|
isError: true
|
|
39599
39890
|
};
|
|
39600
39891
|
setToolResult(toolResult2);
|
|
39892
|
+
setErrors((prev) => ({ ...prev, tools: null }));
|
|
39601
39893
|
}
|
|
39602
39894
|
};
|
|
39603
39895
|
const handleRootsChange = async () => {
|
|
@@ -39627,13 +39919,13 @@ const App = () => {
|
|
|
39627
39919
|
) });
|
|
39628
39920
|
if (window.location.pathname === "/oauth/callback") {
|
|
39629
39921
|
const OAuthCallback = React.lazy(
|
|
39630
|
-
() => __vitePreload(() => import("./OAuthCallback-
|
|
39922
|
+
() => __vitePreload(() => import("./OAuthCallback-C0JXhwud.js"), true ? [] : void 0)
|
|
39631
39923
|
);
|
|
39632
39924
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
|
|
39633
39925
|
}
|
|
39634
39926
|
if (window.location.pathname === "/oauth/callback/debug") {
|
|
39635
39927
|
const OAuthDebugCallback = React.lazy(
|
|
39636
|
-
() => __vitePreload(() => import("./OAuthDebugCallback-
|
|
39928
|
+
() => __vitePreload(() => import("./OAuthDebugCallback-TZR9iqA_.js"), true ? [] : void 0)
|
|
39637
39929
|
);
|
|
39638
39930
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
|
|
39639
39931
|
}
|
|
@@ -39675,7 +39967,9 @@ const App = () => {
|
|
|
39675
39967
|
onDisconnect: disconnectMcpServer,
|
|
39676
39968
|
logLevel,
|
|
39677
39969
|
sendLogLevelRequest,
|
|
39678
|
-
loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false
|
|
39970
|
+
loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false,
|
|
39971
|
+
connectionType,
|
|
39972
|
+
setConnectionType
|
|
39679
39973
|
}
|
|
39680
39974
|
),
|
|
39681
39975
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -39843,9 +40137,9 @@ const App = () => {
|
|
|
39843
40137
|
setPrompts([]);
|
|
39844
40138
|
setNextPromptCursor(void 0);
|
|
39845
40139
|
},
|
|
39846
|
-
getPrompt: (
|
|
40140
|
+
getPrompt: (name2, args2) => {
|
|
39847
40141
|
clearError("prompts");
|
|
39848
|
-
getPrompt(
|
|
40142
|
+
getPrompt(name2, args2);
|
|
39849
40143
|
},
|
|
39850
40144
|
selectedPrompt,
|
|
39851
40145
|
setSelectedPrompt: (prompt) => {
|
|
@@ -39873,10 +40167,10 @@ const App = () => {
|
|
|
39873
40167
|
setNextToolCursor(void 0);
|
|
39874
40168
|
cacheToolOutputSchemas([]);
|
|
39875
40169
|
},
|
|
39876
|
-
callTool: async (
|
|
40170
|
+
callTool: async (name2, params) => {
|
|
39877
40171
|
clearError("tools");
|
|
39878
40172
|
setToolResult(null);
|
|
39879
|
-
await callTool(
|
|
40173
|
+
await callTool(name2, params);
|
|
39880
40174
|
},
|
|
39881
40175
|
selectedTool,
|
|
39882
40176
|
setSelectedTool: (tool) => {
|