@modelcontextprotocol/inspector-client 0.16.8 → 0.17.1
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-0GeGMxax.js} +1 -1
- package/dist/assets/{OAuthDebugCallback-67pOP7RZ.js → OAuthDebugCallback-DEQBSYMe.js} +1 -1
- package/dist/assets/{index-3LzLs-Yz.js → index-9_nBaufL.js} +1447 -953
- package/dist/assets/{index-CFrqgd8F.css → index-CV-uzqYs.css} +36 -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 {
|
|
@@ -15123,12 +15123,7 @@ const optionalType = ZodOptional.create;
|
|
|
15123
15123
|
ZodNullable.create;
|
|
15124
15124
|
const NEVER = INVALID;
|
|
15125
15125
|
const LATEST_PROTOCOL_VERSION = "2025-06-18";
|
|
15126
|
-
const SUPPORTED_PROTOCOL_VERSIONS = [
|
|
15127
|
-
LATEST_PROTOCOL_VERSION,
|
|
15128
|
-
"2025-03-26",
|
|
15129
|
-
"2024-11-05",
|
|
15130
|
-
"2024-10-07"
|
|
15131
|
-
];
|
|
15126
|
+
const SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
15132
15127
|
const JSONRPC_VERSION = "2.0";
|
|
15133
15128
|
const ProgressTokenSchema = unionType([stringType(), numberType().int()]);
|
|
15134
15129
|
const CursorSchema = stringType();
|
|
@@ -15208,12 +15203,7 @@ const JSONRPCErrorSchema = objectType({
|
|
|
15208
15203
|
})
|
|
15209
15204
|
}).strict();
|
|
15210
15205
|
const isJSONRPCError = (value) => JSONRPCErrorSchema.safeParse(value).success;
|
|
15211
|
-
const JSONRPCMessageSchema = unionType([
|
|
15212
|
-
JSONRPCRequestSchema,
|
|
15213
|
-
JSONRPCNotificationSchema,
|
|
15214
|
-
JSONRPCResponseSchema,
|
|
15215
|
-
JSONRPCErrorSchema
|
|
15216
|
-
]);
|
|
15206
|
+
const JSONRPCMessageSchema = unionType([JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, JSONRPCErrorSchema]);
|
|
15217
15207
|
const EmptyResultSchema = ResultSchema.strict();
|
|
15218
15208
|
const CancelledNotificationSchema = NotificationSchema.extend({
|
|
15219
15209
|
method: literalType("notifications/cancelled"),
|
|
@@ -15240,21 +15230,38 @@ const IconSchema = objectType({
|
|
|
15240
15230
|
*/
|
|
15241
15231
|
mimeType: optionalType(stringType()),
|
|
15242
15232
|
/**
|
|
15243
|
-
* Optional
|
|
15233
|
+
* Optional array of strings that specify sizes at which the icon can be used.
|
|
15234
|
+
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
15235
|
+
*
|
|
15236
|
+
* If not provided, the client should assume that the icon can be used at any size.
|
|
15237
|
+
*/
|
|
15238
|
+
sizes: optionalType(arrayType(stringType()))
|
|
15239
|
+
}).passthrough();
|
|
15240
|
+
const IconsSchema = objectType({
|
|
15241
|
+
/**
|
|
15242
|
+
* Optional set of sized icons that the client can display in a user interface.
|
|
15243
|
+
*
|
|
15244
|
+
* Clients that support rendering icons MUST support at least the following MIME types:
|
|
15245
|
+
* - `image/png` - PNG images (safe, universal compatibility)
|
|
15246
|
+
* - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
|
|
15247
|
+
*
|
|
15248
|
+
* Clients that support rendering icons SHOULD also support:
|
|
15249
|
+
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
15250
|
+
* - `image/webp` - WebP images (modern, efficient format)
|
|
15244
15251
|
*/
|
|
15245
|
-
|
|
15252
|
+
icons: arrayType(IconSchema).optional()
|
|
15246
15253
|
}).passthrough();
|
|
15247
15254
|
const BaseMetadataSchema = objectType({
|
|
15248
15255
|
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
15249
15256
|
name: stringType(),
|
|
15250
15257
|
/**
|
|
15251
|
-
|
|
15252
|
-
|
|
15253
|
-
|
|
15254
|
-
|
|
15255
|
-
|
|
15256
|
-
|
|
15257
|
-
|
|
15258
|
+
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
15259
|
+
* even by those unfamiliar with domain-specific terminology.
|
|
15260
|
+
*
|
|
15261
|
+
* If not provided, the name should be used for display (except for Tool,
|
|
15262
|
+
* where `annotations.title` should be given precedence over using `name`,
|
|
15263
|
+
* if present).
|
|
15264
|
+
*/
|
|
15258
15265
|
title: optionalType(stringType())
|
|
15259
15266
|
}).passthrough();
|
|
15260
15267
|
const ImplementationSchema = BaseMetadataSchema.extend({
|
|
@@ -15262,17 +15269,8 @@ const ImplementationSchema = BaseMetadataSchema.extend({
|
|
|
15262
15269
|
/**
|
|
15263
15270
|
* An optional URL of the website for this implementation.
|
|
15264
15271
|
*/
|
|
15265
|
-
websiteUrl: optionalType(stringType())
|
|
15266
|
-
|
|
15267
|
-
* An optional list of icons for this implementation.
|
|
15268
|
-
* This can be used by clients to display the implementation in a user interface.
|
|
15269
|
-
* Each icon should have a `kind` property that specifies whether it is a data representation or a URL source, a `src` property that points to the icon file or data representation, and may also include a `mimeType` and `sizes` property.
|
|
15270
|
-
* The `mimeType` property should be a valid MIME type for the icon file, such as "image/png" or "image/svg+xml".
|
|
15271
|
-
* The `sizes` property should be a string that specifies one or more sizes at which the icon file can be used, such as "48x48" or "any" for scalable formats like SVG.
|
|
15272
|
-
* The `sizes` property is optional, and if not provided, the client should assume that the icon can be used at any size.
|
|
15273
|
-
*/
|
|
15274
|
-
icons: optionalType(arrayType(IconSchema))
|
|
15275
|
-
});
|
|
15272
|
+
websiteUrl: optionalType(stringType())
|
|
15273
|
+
}).merge(IconsSchema);
|
|
15276
15274
|
const ClientCapabilitiesSchema = objectType({
|
|
15277
15275
|
/**
|
|
15278
15276
|
* Experimental, non-standard capabilities that the client supports.
|
|
@@ -15462,16 +15460,12 @@ const ResourceSchema = BaseMetadataSchema.extend({
|
|
|
15462
15460
|
* The MIME type of this resource, if known.
|
|
15463
15461
|
*/
|
|
15464
15462
|
mimeType: optionalType(stringType()),
|
|
15465
|
-
/**
|
|
15466
|
-
* An optional list of icons for this resource.
|
|
15467
|
-
*/
|
|
15468
|
-
icons: optionalType(arrayType(IconSchema)),
|
|
15469
15463
|
/**
|
|
15470
15464
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
15471
15465
|
* for notes on _meta usage.
|
|
15472
15466
|
*/
|
|
15473
15467
|
_meta: optionalType(objectType({}).passthrough())
|
|
15474
|
-
});
|
|
15468
|
+
}).merge(IconsSchema);
|
|
15475
15469
|
const ResourceTemplateSchema = BaseMetadataSchema.extend({
|
|
15476
15470
|
/**
|
|
15477
15471
|
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
@@ -15492,7 +15486,7 @@ const ResourceTemplateSchema = BaseMetadataSchema.extend({
|
|
|
15492
15486
|
* for notes on _meta usage.
|
|
15493
15487
|
*/
|
|
15494
15488
|
_meta: optionalType(objectType({}).passthrough())
|
|
15495
|
-
});
|
|
15489
|
+
}).merge(IconsSchema);
|
|
15496
15490
|
const ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
15497
15491
|
method: literalType("resources/list")
|
|
15498
15492
|
});
|
|
@@ -15570,16 +15564,12 @@ const PromptSchema = BaseMetadataSchema.extend({
|
|
|
15570
15564
|
* A list of arguments to use for templating the prompt.
|
|
15571
15565
|
*/
|
|
15572
15566
|
arguments: optionalType(arrayType(PromptArgumentSchema)),
|
|
15573
|
-
/**
|
|
15574
|
-
* An optional list of icons for this prompt.
|
|
15575
|
-
*/
|
|
15576
|
-
icons: optionalType(arrayType(IconSchema)),
|
|
15577
15567
|
/**
|
|
15578
15568
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
15579
15569
|
* for notes on _meta usage.
|
|
15580
15570
|
*/
|
|
15581
15571
|
_meta: optionalType(objectType({}).passthrough())
|
|
15582
|
-
});
|
|
15572
|
+
}).merge(IconsSchema);
|
|
15583
15573
|
const ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
15584
15574
|
method: literalType("prompts/list")
|
|
15585
15575
|
});
|
|
@@ -15741,16 +15731,12 @@ const ToolSchema = BaseMetadataSchema.extend({
|
|
|
15741
15731
|
* Optional additional tool information.
|
|
15742
15732
|
*/
|
|
15743
15733
|
annotations: optionalType(ToolAnnotationsSchema),
|
|
15744
|
-
/**
|
|
15745
|
-
* An optional list of icons for this tool.
|
|
15746
|
-
*/
|
|
15747
|
-
icons: optionalType(arrayType(IconSchema)),
|
|
15748
15734
|
/**
|
|
15749
15735
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
15750
15736
|
* for notes on _meta usage.
|
|
15751
15737
|
*/
|
|
15752
15738
|
_meta: optionalType(objectType({}).passthrough())
|
|
15753
|
-
});
|
|
15739
|
+
}).merge(IconsSchema);
|
|
15754
15740
|
const ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
15755
15741
|
method: literalType("tools/list")
|
|
15756
15742
|
});
|
|
@@ -15800,16 +15786,7 @@ const CallToolRequestSchema = RequestSchema.extend({
|
|
|
15800
15786
|
const ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
15801
15787
|
method: literalType("notifications/tools/list_changed")
|
|
15802
15788
|
});
|
|
15803
|
-
const LoggingLevelSchema = enumType([
|
|
15804
|
-
"debug",
|
|
15805
|
-
"info",
|
|
15806
|
-
"notice",
|
|
15807
|
-
"warning",
|
|
15808
|
-
"error",
|
|
15809
|
-
"critical",
|
|
15810
|
-
"alert",
|
|
15811
|
-
"emergency"
|
|
15812
|
-
]);
|
|
15789
|
+
const LoggingLevelSchema = enumType(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
15813
15790
|
const SetLevelRequestSchema = RequestSchema.extend({
|
|
15814
15791
|
method: literalType("logging/setLevel"),
|
|
15815
15792
|
params: BaseRequestParamsSchema.extend({
|
|
@@ -15902,11 +15879,7 @@ const CreateMessageResultSchema = ResultSchema.extend({
|
|
|
15902
15879
|
*/
|
|
15903
15880
|
stopReason: optionalType(enumType(["endTurn", "stopSequence", "maxTokens"]).or(stringType())),
|
|
15904
15881
|
role: enumType(["user", "assistant"]),
|
|
15905
|
-
content: discriminatedUnionType("type", [
|
|
15906
|
-
TextContentSchema,
|
|
15907
|
-
ImageContentSchema,
|
|
15908
|
-
AudioContentSchema
|
|
15909
|
-
])
|
|
15882
|
+
content: discriminatedUnionType("type", [TextContentSchema, ImageContentSchema, AudioContentSchema])
|
|
15910
15883
|
});
|
|
15911
15884
|
const BooleanSchemaSchema = objectType({
|
|
15912
15885
|
type: literalType("boolean"),
|
|
@@ -15936,12 +15909,7 @@ const EnumSchemaSchema = objectType({
|
|
|
15936
15909
|
enum: arrayType(stringType()),
|
|
15937
15910
|
enumNames: optionalType(arrayType(stringType()))
|
|
15938
15911
|
}).passthrough();
|
|
15939
|
-
const PrimitiveSchemaDefinitionSchema = unionType([
|
|
15940
|
-
BooleanSchemaSchema,
|
|
15941
|
-
StringSchemaSchema,
|
|
15942
|
-
NumberSchemaSchema,
|
|
15943
|
-
EnumSchemaSchema
|
|
15944
|
-
]);
|
|
15912
|
+
const PrimitiveSchemaDefinitionSchema = unionType([BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema]);
|
|
15945
15913
|
const ElicitRequestSchema = RequestSchema.extend({
|
|
15946
15914
|
method: literalType("elicitation/create"),
|
|
15947
15915
|
params: BaseRequestParamsSchema.extend({
|
|
@@ -16069,18 +16037,8 @@ unionType([
|
|
|
16069
16037
|
InitializedNotificationSchema,
|
|
16070
16038
|
RootsListChangedNotificationSchema
|
|
16071
16039
|
]);
|
|
16072
|
-
unionType([
|
|
16073
|
-
|
|
16074
|
-
CreateMessageResultSchema,
|
|
16075
|
-
ElicitResultSchema,
|
|
16076
|
-
ListRootsResultSchema
|
|
16077
|
-
]);
|
|
16078
|
-
unionType([
|
|
16079
|
-
PingRequestSchema,
|
|
16080
|
-
CreateMessageRequestSchema,
|
|
16081
|
-
ElicitRequestSchema,
|
|
16082
|
-
ListRootsRequestSchema
|
|
16083
|
-
]);
|
|
16040
|
+
unionType([EmptyResultSchema, CreateMessageResultSchema, ElicitResultSchema, ListRootsResultSchema]);
|
|
16041
|
+
unionType([PingRequestSchema, CreateMessageRequestSchema, ElicitRequestSchema, ListRootsRequestSchema]);
|
|
16084
16042
|
unionType([
|
|
16085
16043
|
CancelledNotificationSchema,
|
|
16086
16044
|
ProgressNotificationSchema,
|
|
@@ -16246,6 +16204,17 @@ objectType({
|
|
|
16246
16204
|
token: stringType(),
|
|
16247
16205
|
token_type_hint: stringType().optional()
|
|
16248
16206
|
}).strip();
|
|
16207
|
+
const name = "@modelcontextprotocol/inspector-client";
|
|
16208
|
+
const version$1 = "0.17.1";
|
|
16209
|
+
const packageJson = {
|
|
16210
|
+
name,
|
|
16211
|
+
version: version$1
|
|
16212
|
+
};
|
|
16213
|
+
const CLIENT_IDENTITY = (() => {
|
|
16214
|
+
const [, name2 = packageJson.name] = packageJson.name.split("/");
|
|
16215
|
+
const version2 = packageJson.version;
|
|
16216
|
+
return { name: name2, version: version2 };
|
|
16217
|
+
})();
|
|
16249
16218
|
const SESSION_KEYS = {
|
|
16250
16219
|
CODE_VERIFIER: "mcp_code_verifier",
|
|
16251
16220
|
SERVER_URL: "mcp_server_url",
|
|
@@ -16455,6 +16424,8 @@ class UnauthorizedError extends Error {
|
|
|
16455
16424
|
super(message !== null && message !== void 0 ? message : "Unauthorized");
|
|
16456
16425
|
}
|
|
16457
16426
|
}
|
|
16427
|
+
const AUTHORIZATION_CODE_RESPONSE_TYPE = "code";
|
|
16428
|
+
const AUTHORIZATION_CODE_CHALLENGE_METHOD = "S256";
|
|
16458
16429
|
function selectClientAuthMethod(clientInformation, supportedMethods) {
|
|
16459
16430
|
const hasClientSecret = clientInformation.client_secret !== void 0;
|
|
16460
16431
|
if (supportedMethods.length === 0) {
|
|
@@ -16744,7 +16715,6 @@ function buildDiscoveryUrls(authorizationServerUrl) {
|
|
|
16744
16715
|
return urlsToTry;
|
|
16745
16716
|
}
|
|
16746
16717
|
async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION } = {}) {
|
|
16747
|
-
var _a;
|
|
16748
16718
|
const headers = { "MCP-Protocol-Version": protocolVersion };
|
|
16749
16719
|
const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);
|
|
16750
16720
|
for (const { url: endpointUrl, type: type2 } of urlsToTry) {
|
|
@@ -16761,26 +16731,20 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
|
|
|
16761
16731
|
if (type2 === "oauth") {
|
|
16762
16732
|
return OAuthMetadataSchema.parse(await response.json());
|
|
16763
16733
|
} else {
|
|
16764
|
-
|
|
16765
|
-
if (!((_a = metadata.code_challenge_methods_supported) === null || _a === void 0 ? void 0 : _a.includes("S256"))) {
|
|
16766
|
-
throw new Error(`Incompatible OIDC provider at ${endpointUrl}: does not support S256 code challenge method required by MCP specification`);
|
|
16767
|
-
}
|
|
16768
|
-
return metadata;
|
|
16734
|
+
return OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
|
|
16769
16735
|
}
|
|
16770
16736
|
}
|
|
16771
16737
|
return void 0;
|
|
16772
16738
|
}
|
|
16773
16739
|
async function startAuthorization(authorizationServerUrl, { metadata, clientInformation, redirectUrl, scope, state, resource }) {
|
|
16774
|
-
const responseType = "code";
|
|
16775
|
-
const codeChallengeMethod = "S256";
|
|
16776
16740
|
let authorizationUrl;
|
|
16777
16741
|
if (metadata) {
|
|
16778
16742
|
authorizationUrl = new URL(metadata.authorization_endpoint);
|
|
16779
|
-
if (!metadata.response_types_supported.includes(
|
|
16780
|
-
throw new Error(`Incompatible auth server: does not support response type ${
|
|
16743
|
+
if (!metadata.response_types_supported.includes(AUTHORIZATION_CODE_RESPONSE_TYPE)) {
|
|
16744
|
+
throw new Error(`Incompatible auth server: does not support response type ${AUTHORIZATION_CODE_RESPONSE_TYPE}`);
|
|
16781
16745
|
}
|
|
16782
|
-
if (
|
|
16783
|
-
throw new Error(`Incompatible auth server: does not support code challenge method ${
|
|
16746
|
+
if (metadata.code_challenge_methods_supported && !metadata.code_challenge_methods_supported.includes(AUTHORIZATION_CODE_CHALLENGE_METHOD)) {
|
|
16747
|
+
throw new Error(`Incompatible auth server: does not support code challenge method ${AUTHORIZATION_CODE_CHALLENGE_METHOD}`);
|
|
16784
16748
|
}
|
|
16785
16749
|
} else {
|
|
16786
16750
|
authorizationUrl = new URL("/authorize", authorizationServerUrl);
|
|
@@ -16788,10 +16752,10 @@ async function startAuthorization(authorizationServerUrl, { metadata, clientInfo
|
|
|
16788
16752
|
const challenge = await pkceChallenge();
|
|
16789
16753
|
const codeVerifier = challenge.code_verifier;
|
|
16790
16754
|
const codeChallenge = challenge.code_challenge;
|
|
16791
|
-
authorizationUrl.searchParams.set("response_type",
|
|
16755
|
+
authorizationUrl.searchParams.set("response_type", AUTHORIZATION_CODE_RESPONSE_TYPE);
|
|
16792
16756
|
authorizationUrl.searchParams.set("client_id", clientInformation.client_id);
|
|
16793
16757
|
authorizationUrl.searchParams.set("code_challenge", codeChallenge);
|
|
16794
|
-
authorizationUrl.searchParams.set("code_challenge_method",
|
|
16758
|
+
authorizationUrl.searchParams.set("code_challenge_method", AUTHORIZATION_CODE_CHALLENGE_METHOD);
|
|
16795
16759
|
authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl));
|
|
16796
16760
|
if (state) {
|
|
16797
16761
|
authorizationUrl.searchParams.set("state", state);
|
|
@@ -16816,7 +16780,7 @@ async function exchangeAuthorization(authorizationServerUrl, { metadata, clientI
|
|
|
16816
16780
|
}
|
|
16817
16781
|
const headers = new Headers({
|
|
16818
16782
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
16819
|
-
|
|
16783
|
+
Accept: "application/json"
|
|
16820
16784
|
});
|
|
16821
16785
|
const params = new URLSearchParams({
|
|
16822
16786
|
grant_type: grantType,
|
|
@@ -17016,9 +16980,12 @@ class InspectorOAuthClientProvider {
|
|
|
17016
16980
|
get debugRedirectUrl() {
|
|
17017
16981
|
return window.location.origin + "/oauth/callback/debug";
|
|
17018
16982
|
}
|
|
16983
|
+
get redirect_uris() {
|
|
16984
|
+
return [.../* @__PURE__ */ new Set([this.redirectUrl, this.debugRedirectUrl])];
|
|
16985
|
+
}
|
|
17019
16986
|
get clientMetadata() {
|
|
17020
16987
|
return {
|
|
17021
|
-
redirect_uris:
|
|
16988
|
+
redirect_uris: this.redirect_uris,
|
|
17022
16989
|
token_endpoint_auth_method: "none",
|
|
17023
16990
|
grant_types: ["authorization_code", "refresh_token"],
|
|
17024
16991
|
response_types: ["code"],
|
|
@@ -17041,14 +17008,9 @@ class InspectorOAuthClientProvider {
|
|
|
17041
17008
|
});
|
|
17042
17009
|
}
|
|
17043
17010
|
saveClientInformation(clientInformation) {
|
|
17044
|
-
const safeInfo = Object.fromEntries(
|
|
17045
|
-
Object.entries(clientInformation).filter(
|
|
17046
|
-
([key]) => key !== "client_secret"
|
|
17047
|
-
)
|
|
17048
|
-
);
|
|
17049
17011
|
saveClientInformationToSessionStorage({
|
|
17050
17012
|
serverUrl: this.serverUrl,
|
|
17051
|
-
clientInformation
|
|
17013
|
+
clientInformation,
|
|
17052
17014
|
isPreregistered: false
|
|
17053
17015
|
});
|
|
17054
17016
|
}
|
|
@@ -18225,9 +18187,9 @@ function requireUri_all() {
|
|
|
18225
18187
|
if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
|
|
18226
18188
|
if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
|
|
18227
18189
|
var fields = [];
|
|
18228
|
-
for (var
|
|
18229
|
-
if (headers[
|
|
18230
|
-
fields.push(
|
|
18190
|
+
for (var name2 in headers) {
|
|
18191
|
+
if (headers[name2] !== O[name2]) {
|
|
18192
|
+
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
18193
|
}
|
|
18232
18194
|
}
|
|
18233
18195
|
if (fields.length) {
|
|
@@ -23263,9 +23225,9 @@ function requireAjv() {
|
|
|
23263
23225
|
}
|
|
23264
23226
|
return text.slice(0, -separator.length);
|
|
23265
23227
|
}
|
|
23266
|
-
function addFormat(
|
|
23228
|
+
function addFormat(name2, format2) {
|
|
23267
23229
|
if (typeof format2 == "string") format2 = new RegExp(format2);
|
|
23268
|
-
this._formats[
|
|
23230
|
+
this._formats[name2] = format2;
|
|
23269
23231
|
return this;
|
|
23270
23232
|
}
|
|
23271
23233
|
function addDefaultMetaSchema(self2) {
|
|
@@ -23287,15 +23249,15 @@ function requireAjv() {
|
|
|
23287
23249
|
else for (var key in optsSchemas) self2.addSchema(optsSchemas[key], key);
|
|
23288
23250
|
}
|
|
23289
23251
|
function addInitialFormats(self2) {
|
|
23290
|
-
for (var
|
|
23291
|
-
var format2 = self2._opts.formats[
|
|
23292
|
-
self2.addFormat(
|
|
23252
|
+
for (var name2 in self2._opts.formats) {
|
|
23253
|
+
var format2 = self2._opts.formats[name2];
|
|
23254
|
+
self2.addFormat(name2, format2);
|
|
23293
23255
|
}
|
|
23294
23256
|
}
|
|
23295
23257
|
function addInitialKeywords(self2) {
|
|
23296
|
-
for (var
|
|
23297
|
-
var keyword2 = self2._opts.keywords[
|
|
23298
|
-
self2.addKeyword(
|
|
23258
|
+
for (var name2 in self2._opts.keywords) {
|
|
23259
|
+
var keyword2 = self2._opts.keywords[name2];
|
|
23260
|
+
self2.addKeyword(name2, keyword2);
|
|
23299
23261
|
}
|
|
23300
23262
|
}
|
|
23301
23263
|
function checkUnique(self2, id) {
|
|
@@ -23377,9 +23339,9 @@ function generateDefaultValue(schema, propertyName, parentSchema) {
|
|
|
23377
23339
|
case "boolean":
|
|
23378
23340
|
return isRequired ? false : void 0;
|
|
23379
23341
|
case "array":
|
|
23380
|
-
return [];
|
|
23342
|
+
return isRequired ? [] : void 0;
|
|
23381
23343
|
case "object": {
|
|
23382
|
-
if (!schema.properties) return {};
|
|
23344
|
+
if (!schema.properties) return isRequired ? {} : void 0;
|
|
23383
23345
|
const obj = {};
|
|
23384
23346
|
Object.entries(schema.properties).forEach(([key, prop]) => {
|
|
23385
23347
|
if (isPropertyRequired(key, schema)) {
|
|
@@ -23389,7 +23351,7 @@ function generateDefaultValue(schema, propertyName, parentSchema) {
|
|
|
23389
23351
|
}
|
|
23390
23352
|
}
|
|
23391
23353
|
});
|
|
23392
|
-
return obj;
|
|
23354
|
+
return isRequired ? obj : Object.keys(obj).length > 0 ? obj : void 0;
|
|
23393
23355
|
}
|
|
23394
23356
|
case "null":
|
|
23395
23357
|
return null;
|
|
@@ -23403,31 +23365,46 @@ function isPropertyRequired(propertyName, schema) {
|
|
|
23403
23365
|
}
|
|
23404
23366
|
function normalizeUnionType(schema) {
|
|
23405
23367
|
if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "string") && schema.anyOf.some((t) => t.type === "null")) {
|
|
23406
|
-
return { ...schema, type: "string", anyOf: void 0 };
|
|
23368
|
+
return { ...schema, type: "string", anyOf: void 0, nullable: true };
|
|
23407
23369
|
}
|
|
23408
23370
|
if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "boolean") && schema.anyOf.some((t) => t.type === "null")) {
|
|
23409
|
-
return { ...schema, type: "boolean", anyOf: void 0 };
|
|
23371
|
+
return { ...schema, type: "boolean", anyOf: void 0, nullable: true };
|
|
23410
23372
|
}
|
|
23411
23373
|
if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "number") && schema.anyOf.some((t) => t.type === "null")) {
|
|
23412
|
-
return { ...schema, type: "number", anyOf: void 0 };
|
|
23374
|
+
return { ...schema, type: "number", anyOf: void 0, nullable: true };
|
|
23413
23375
|
}
|
|
23414
23376
|
if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "integer") && schema.anyOf.some((t) => t.type === "null")) {
|
|
23415
|
-
return { ...schema, type: "integer", anyOf: void 0 };
|
|
23377
|
+
return { ...schema, type: "integer", anyOf: void 0, nullable: true };
|
|
23416
23378
|
}
|
|
23417
23379
|
if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("string") && schema.type.includes("null")) {
|
|
23418
|
-
return { ...schema, type: "string" };
|
|
23380
|
+
return { ...schema, type: "string", nullable: true };
|
|
23419
23381
|
}
|
|
23420
23382
|
if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("boolean") && schema.type.includes("null")) {
|
|
23421
|
-
return { ...schema, type: "boolean" };
|
|
23383
|
+
return { ...schema, type: "boolean", nullable: true };
|
|
23422
23384
|
}
|
|
23423
23385
|
if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("number") && schema.type.includes("null")) {
|
|
23424
|
-
return { ...schema, type: "number" };
|
|
23386
|
+
return { ...schema, type: "number", nullable: true };
|
|
23425
23387
|
}
|
|
23426
23388
|
if (Array.isArray(schema.type) && schema.type.length === 2 && schema.type.includes("integer") && schema.type.includes("null")) {
|
|
23427
|
-
return { ...schema, type: "integer" };
|
|
23389
|
+
return { ...schema, type: "integer", nullable: true };
|
|
23428
23390
|
}
|
|
23429
23391
|
return schema;
|
|
23430
23392
|
}
|
|
23393
|
+
function cleanParams(params, schema) {
|
|
23394
|
+
const cleaned = {};
|
|
23395
|
+
const required2 = schema.required || [];
|
|
23396
|
+
for (const [key, value] of Object.entries(params)) {
|
|
23397
|
+
const isFieldRequired = required2.includes(key);
|
|
23398
|
+
if (isFieldRequired) {
|
|
23399
|
+
cleaned[key] = value;
|
|
23400
|
+
} else {
|
|
23401
|
+
if (value !== void 0 && value !== "" && value !== null) {
|
|
23402
|
+
cleaned[key] = value;
|
|
23403
|
+
}
|
|
23404
|
+
}
|
|
23405
|
+
}
|
|
23406
|
+
return cleaned;
|
|
23407
|
+
}
|
|
23431
23408
|
const DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
23432
23409
|
class Protocol {
|
|
23433
23410
|
constructor(_options) {
|
|
@@ -23470,7 +23447,10 @@ class Protocol {
|
|
|
23470
23447
|
const totalElapsed = Date.now() - info.startTime;
|
|
23471
23448
|
if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {
|
|
23472
23449
|
this._timeoutInfo.delete(messageId);
|
|
23473
|
-
throw new McpError(ErrorCode.RequestTimeout, "Maximum total timeout exceeded", {
|
|
23450
|
+
throw new McpError(ErrorCode.RequestTimeout, "Maximum total timeout exceeded", {
|
|
23451
|
+
maxTotalTimeout: info.maxTotalTimeout,
|
|
23452
|
+
totalElapsed
|
|
23453
|
+
});
|
|
23474
23454
|
}
|
|
23475
23455
|
clearTimeout(info.timeoutId);
|
|
23476
23456
|
info.timeoutId = setTimeout(info.onTimeout, info.timeout);
|
|
@@ -24421,7 +24401,11 @@ class SSEClientTransport {
|
|
|
24421
24401
|
}
|
|
24422
24402
|
let result;
|
|
24423
24403
|
try {
|
|
24424
|
-
result = await auth(this._authProvider, {
|
|
24404
|
+
result = await auth(this._authProvider, {
|
|
24405
|
+
serverUrl: this._url,
|
|
24406
|
+
resourceMetadataUrl: this._resourceMetadataUrl,
|
|
24407
|
+
fetchFn: this._fetch
|
|
24408
|
+
});
|
|
24425
24409
|
} catch (error) {
|
|
24426
24410
|
(_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
24427
24411
|
throw error;
|
|
@@ -24520,7 +24504,12 @@ class SSEClientTransport {
|
|
|
24520
24504
|
if (!this._authProvider) {
|
|
24521
24505
|
throw new UnauthorizedError("No auth provider");
|
|
24522
24506
|
}
|
|
24523
|
-
const result = await auth(this._authProvider, {
|
|
24507
|
+
const result = await auth(this._authProvider, {
|
|
24508
|
+
serverUrl: this._url,
|
|
24509
|
+
authorizationCode,
|
|
24510
|
+
resourceMetadataUrl: this._resourceMetadataUrl,
|
|
24511
|
+
fetchFn: this._fetch
|
|
24512
|
+
});
|
|
24524
24513
|
if (result !== "AUTHORIZED") {
|
|
24525
24514
|
throw new UnauthorizedError("Failed to authorize");
|
|
24526
24515
|
}
|
|
@@ -24550,7 +24539,11 @@ class SSEClientTransport {
|
|
|
24550
24539
|
if (!response.ok) {
|
|
24551
24540
|
if (response.status === 401 && this._authProvider) {
|
|
24552
24541
|
this._resourceMetadataUrl = extractResourceMetadataUrl(response);
|
|
24553
|
-
const result = await auth(this._authProvider, {
|
|
24542
|
+
const result = await auth(this._authProvider, {
|
|
24543
|
+
serverUrl: this._url,
|
|
24544
|
+
resourceMetadataUrl: this._resourceMetadataUrl,
|
|
24545
|
+
fetchFn: this._fetch
|
|
24546
|
+
});
|
|
24554
24547
|
if (result !== "AUTHORIZED") {
|
|
24555
24548
|
throw new UnauthorizedError();
|
|
24556
24549
|
}
|
|
@@ -24605,6 +24598,7 @@ class StreamableHTTPError extends Error {
|
|
|
24605
24598
|
class StreamableHTTPClientTransport {
|
|
24606
24599
|
constructor(url, opts) {
|
|
24607
24600
|
var _a;
|
|
24601
|
+
this._hasCompletedAuthFlow = false;
|
|
24608
24602
|
this._url = url;
|
|
24609
24603
|
this._resourceMetadataUrl = void 0;
|
|
24610
24604
|
this._requestInit = opts === null || opts === void 0 ? void 0 : opts.requestInit;
|
|
@@ -24620,7 +24614,11 @@ class StreamableHTTPClientTransport {
|
|
|
24620
24614
|
}
|
|
24621
24615
|
let result;
|
|
24622
24616
|
try {
|
|
24623
|
-
result = await auth(this._authProvider, {
|
|
24617
|
+
result = await auth(this._authProvider, {
|
|
24618
|
+
serverUrl: this._url,
|
|
24619
|
+
resourceMetadataUrl: this._resourceMetadataUrl,
|
|
24620
|
+
fetchFn: this._fetch
|
|
24621
|
+
});
|
|
24624
24622
|
} catch (error) {
|
|
24625
24623
|
(_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
24626
24624
|
throw error;
|
|
@@ -24786,7 +24784,12 @@ class StreamableHTTPClientTransport {
|
|
|
24786
24784
|
if (!this._authProvider) {
|
|
24787
24785
|
throw new UnauthorizedError("No auth provider");
|
|
24788
24786
|
}
|
|
24789
|
-
const result = await auth(this._authProvider, {
|
|
24787
|
+
const result = await auth(this._authProvider, {
|
|
24788
|
+
serverUrl: this._url,
|
|
24789
|
+
authorizationCode,
|
|
24790
|
+
resourceMetadataUrl: this._resourceMetadataUrl,
|
|
24791
|
+
fetchFn: this._fetch
|
|
24792
|
+
});
|
|
24790
24793
|
if (result !== "AUTHORIZED") {
|
|
24791
24794
|
throw new UnauthorizedError("Failed to authorize");
|
|
24792
24795
|
}
|
|
@@ -24824,16 +24827,25 @@ class StreamableHTTPClientTransport {
|
|
|
24824
24827
|
}
|
|
24825
24828
|
if (!response.ok) {
|
|
24826
24829
|
if (response.status === 401 && this._authProvider) {
|
|
24830
|
+
if (this._hasCompletedAuthFlow) {
|
|
24831
|
+
throw new StreamableHTTPError(401, "Server returned 401 after successful authentication");
|
|
24832
|
+
}
|
|
24827
24833
|
this._resourceMetadataUrl = extractResourceMetadataUrl(response);
|
|
24828
|
-
const result = await auth(this._authProvider, {
|
|
24834
|
+
const result = await auth(this._authProvider, {
|
|
24835
|
+
serverUrl: this._url,
|
|
24836
|
+
resourceMetadataUrl: this._resourceMetadataUrl,
|
|
24837
|
+
fetchFn: this._fetch
|
|
24838
|
+
});
|
|
24829
24839
|
if (result !== "AUTHORIZED") {
|
|
24830
24840
|
throw new UnauthorizedError();
|
|
24831
24841
|
}
|
|
24842
|
+
this._hasCompletedAuthFlow = true;
|
|
24832
24843
|
return this.send(message);
|
|
24833
24844
|
}
|
|
24834
24845
|
const text = await response.text().catch(() => null);
|
|
24835
24846
|
throw new Error(`Error POSTing to endpoint (HTTP ${response.status}): ${text}`);
|
|
24836
24847
|
}
|
|
24848
|
+
this._hasCompletedAuthFlow = false;
|
|
24837
24849
|
if (response.status === 202) {
|
|
24838
24850
|
if (isInitializedNotification(message)) {
|
|
24839
24851
|
this._startOrAuthSse({ resumptionToken: void 0 }).catch((err) => {
|
|
@@ -24908,10 +24920,6 @@ class StreamableHTTPClientTransport {
|
|
|
24908
24920
|
return this._protocolVersion;
|
|
24909
24921
|
}
|
|
24910
24922
|
}
|
|
24911
|
-
const version$1 = "0.16.8";
|
|
24912
|
-
const packageJson = {
|
|
24913
|
-
version: version$1
|
|
24914
|
-
};
|
|
24915
24923
|
const getSearchParam = (key) => {
|
|
24916
24924
|
try {
|
|
24917
24925
|
const url = new URL(window.location.href);
|
|
@@ -25036,8 +25044,10 @@ function useConnection({
|
|
|
25036
25044
|
env,
|
|
25037
25045
|
customHeaders,
|
|
25038
25046
|
oauthClientId,
|
|
25047
|
+
oauthClientSecret,
|
|
25039
25048
|
oauthScope,
|
|
25040
25049
|
config,
|
|
25050
|
+
connectionType = "proxy",
|
|
25041
25051
|
onNotification,
|
|
25042
25052
|
onPendingRequest,
|
|
25043
25053
|
onElicitationRequest,
|
|
@@ -25053,6 +25063,10 @@ function useConnection({
|
|
|
25053
25063
|
);
|
|
25054
25064
|
const [requestHistory, setRequestHistory] = reactExports.useState([]);
|
|
25055
25065
|
const [completionsSupported, setCompletionsSupported] = reactExports.useState(false);
|
|
25066
|
+
const [mcpSessionId, setMcpSessionId] = reactExports.useState(null);
|
|
25067
|
+
const [mcpProtocolVersion, setMcpProtocolVersion] = reactExports.useState(
|
|
25068
|
+
null
|
|
25069
|
+
);
|
|
25056
25070
|
reactExports.useEffect(() => {
|
|
25057
25071
|
if (!oauthClientId) {
|
|
25058
25072
|
clearClientInformationFromSessionStorage({
|
|
@@ -25061,12 +25075,18 @@ function useConnection({
|
|
|
25061
25075
|
});
|
|
25062
25076
|
return;
|
|
25063
25077
|
}
|
|
25078
|
+
const clientInformation = {
|
|
25079
|
+
client_id: oauthClientId
|
|
25080
|
+
};
|
|
25081
|
+
if (oauthClientSecret) {
|
|
25082
|
+
clientInformation.client_secret = oauthClientSecret;
|
|
25083
|
+
}
|
|
25064
25084
|
saveClientInformationToSessionStorage({
|
|
25065
25085
|
serverUrl: sseUrl,
|
|
25066
|
-
clientInformation
|
|
25086
|
+
clientInformation,
|
|
25067
25087
|
isPreregistered: true
|
|
25068
25088
|
});
|
|
25069
|
-
}, [oauthClientId, sseUrl]);
|
|
25089
|
+
}, [oauthClientId, oauthClientSecret, sseUrl]);
|
|
25070
25090
|
const pushHistory = (request, response) => {
|
|
25071
25091
|
setRequestHistory((prev) => [
|
|
25072
25092
|
...prev,
|
|
@@ -25232,38 +25252,64 @@ function useConnection({
|
|
|
25232
25252
|
}
|
|
25233
25253
|
return false;
|
|
25234
25254
|
};
|
|
25255
|
+
const captureResponseHeaders = (response) => {
|
|
25256
|
+
const sessionId = response.headers.get("mcp-session-id");
|
|
25257
|
+
const protocolVersion = response.headers.get("mcp-protocol-version");
|
|
25258
|
+
if (sessionId && sessionId !== mcpSessionId) {
|
|
25259
|
+
setMcpSessionId(sessionId);
|
|
25260
|
+
}
|
|
25261
|
+
if (protocolVersion && protocolVersion !== mcpProtocolVersion) {
|
|
25262
|
+
setMcpProtocolVersion(protocolVersion);
|
|
25263
|
+
}
|
|
25264
|
+
};
|
|
25235
25265
|
const connect = async (_e2, retryCount = 0) => {
|
|
25236
25266
|
var _a;
|
|
25237
|
-
const
|
|
25238
|
-
{
|
|
25239
|
-
|
|
25240
|
-
|
|
25241
|
-
|
|
25242
|
-
|
|
25243
|
-
capabilities: {
|
|
25244
|
-
sampling: {},
|
|
25245
|
-
elicitation: {},
|
|
25246
|
-
roots: {
|
|
25247
|
-
listChanged: true
|
|
25248
|
-
}
|
|
25267
|
+
const clientCapabilities = {
|
|
25268
|
+
capabilities: {
|
|
25269
|
+
sampling: {},
|
|
25270
|
+
elicitation: {},
|
|
25271
|
+
roots: {
|
|
25272
|
+
listChanged: true
|
|
25249
25273
|
}
|
|
25250
25274
|
}
|
|
25275
|
+
};
|
|
25276
|
+
const client2 = new Client(
|
|
25277
|
+
CLIENT_IDENTITY,
|
|
25278
|
+
clientCapabilities
|
|
25251
25279
|
);
|
|
25252
|
-
|
|
25253
|
-
|
|
25254
|
-
|
|
25255
|
-
|
|
25256
|
-
|
|
25280
|
+
if (connectionType === "proxy") {
|
|
25281
|
+
try {
|
|
25282
|
+
await checkProxyHealth();
|
|
25283
|
+
} catch {
|
|
25284
|
+
setConnectionStatus("error-connecting-to-proxy");
|
|
25285
|
+
return;
|
|
25286
|
+
}
|
|
25257
25287
|
}
|
|
25258
25288
|
let lastRequest = "";
|
|
25259
25289
|
try {
|
|
25260
25290
|
const headers = {};
|
|
25261
25291
|
const serverAuthProvider = new InspectorOAuthClientProvider(sseUrl);
|
|
25262
25292
|
let finalHeaders = customHeaders || [];
|
|
25263
|
-
|
|
25293
|
+
const isEmptyAuthHeader = (header) => header.name.trim().toLowerCase() === "authorization" && header.value.trim().toLowerCase() === "bearer";
|
|
25294
|
+
const hasEmptyAuthHeader = finalHeaders.some(
|
|
25295
|
+
(header) => header.enabled && isEmptyAuthHeader(header)
|
|
25296
|
+
);
|
|
25297
|
+
if (hasEmptyAuthHeader) {
|
|
25298
|
+
toast2({
|
|
25299
|
+
title: "Invalid Authorization Header",
|
|
25300
|
+
description: "Authorization header is enabled but empty. Please add a token or disable the header.",
|
|
25301
|
+
variant: "destructive"
|
|
25302
|
+
});
|
|
25303
|
+
}
|
|
25304
|
+
const needsOAuthToken = !finalHeaders.some(
|
|
25305
|
+
(header) => header.enabled && header.name.trim().toLowerCase() === "authorization"
|
|
25306
|
+
);
|
|
25307
|
+
if (needsOAuthToken) {
|
|
25264
25308
|
const oauthToken = (_a = await serverAuthProvider.tokens()) == null ? void 0 : _a.access_token;
|
|
25265
25309
|
if (oauthToken) {
|
|
25266
25310
|
finalHeaders = [
|
|
25311
|
+
// Remove any existing Authorization headers with empty tokens
|
|
25312
|
+
...finalHeaders.filter((header) => !isEmptyAuthHeader(header)),
|
|
25267
25313
|
{
|
|
25268
25314
|
name: "Authorization",
|
|
25269
25315
|
value: `Bearer ${oauthToken}`,
|
|
@@ -25286,90 +25332,140 @@ function useConnection({
|
|
|
25286
25332
|
if (customHeaderNames.length > 0) {
|
|
25287
25333
|
headers["x-custom-auth-headers"] = JSON.stringify(customHeaderNames);
|
|
25288
25334
|
}
|
|
25289
|
-
const { token: proxyAuthToken, header: proxyAuthTokenHeader } = getMCPProxyAuthToken(config);
|
|
25290
|
-
const proxyHeaders = {};
|
|
25291
|
-
if (proxyAuthToken) {
|
|
25292
|
-
proxyHeaders[proxyAuthTokenHeader] = `Bearer ${proxyAuthToken}`;
|
|
25293
|
-
}
|
|
25294
25335
|
let transportOptions;
|
|
25295
|
-
let
|
|
25296
|
-
|
|
25297
|
-
|
|
25298
|
-
|
|
25299
|
-
|
|
25300
|
-
|
|
25301
|
-
|
|
25302
|
-
|
|
25303
|
-
|
|
25304
|
-
|
|
25305
|
-
|
|
25306
|
-
|
|
25307
|
-
|
|
25308
|
-
|
|
25309
|
-
|
|
25310
|
-
|
|
25311
|
-
|
|
25312
|
-
|
|
25313
|
-
|
|
25336
|
+
let serverUrl;
|
|
25337
|
+
if (connectionType === "direct" && transportType !== "stdio") {
|
|
25338
|
+
serverUrl = new URL(sseUrl);
|
|
25339
|
+
const requestHeaders = { ...headers };
|
|
25340
|
+
if (mcpSessionId) {
|
|
25341
|
+
requestHeaders["mcp-session-id"] = mcpSessionId;
|
|
25342
|
+
}
|
|
25343
|
+
switch (transportType) {
|
|
25344
|
+
case "sse":
|
|
25345
|
+
requestHeaders["Accept"] = "text/event-stream";
|
|
25346
|
+
requestHeaders["content-type"] = "application/json";
|
|
25347
|
+
transportOptions = {
|
|
25348
|
+
fetch: async (url, init) => {
|
|
25349
|
+
const response = await fetch(url, {
|
|
25350
|
+
...init,
|
|
25351
|
+
headers: requestHeaders
|
|
25352
|
+
});
|
|
25353
|
+
captureResponseHeaders(response);
|
|
25354
|
+
return response;
|
|
25355
|
+
},
|
|
25356
|
+
requestInit: {
|
|
25357
|
+
headers: requestHeaders
|
|
25358
|
+
}
|
|
25359
|
+
};
|
|
25360
|
+
break;
|
|
25361
|
+
case "streamable-http":
|
|
25362
|
+
transportOptions = {
|
|
25363
|
+
fetch: async (url, init) => {
|
|
25364
|
+
requestHeaders["Accept"] = "text/event-stream, application/json";
|
|
25365
|
+
requestHeaders["Content-Type"] = "application/json";
|
|
25366
|
+
const response = await fetch(url, {
|
|
25367
|
+
headers: requestHeaders,
|
|
25368
|
+
...init
|
|
25369
|
+
});
|
|
25370
|
+
captureResponseHeaders(response);
|
|
25371
|
+
return response;
|
|
25372
|
+
},
|
|
25373
|
+
requestInit: {
|
|
25374
|
+
headers: requestHeaders
|
|
25375
|
+
},
|
|
25376
|
+
// TODO these should be configurable...
|
|
25377
|
+
reconnectionOptions: {
|
|
25378
|
+
maxReconnectionDelay: 3e4,
|
|
25379
|
+
initialReconnectionDelay: 1e3,
|
|
25380
|
+
reconnectionDelayGrowFactor: 1.5,
|
|
25381
|
+
maxRetries: 2
|
|
25382
|
+
}
|
|
25383
|
+
};
|
|
25384
|
+
break;
|
|
25385
|
+
}
|
|
25386
|
+
} else {
|
|
25387
|
+
const { token: proxyAuthToken, header: proxyAuthTokenHeader } = getMCPProxyAuthToken(config);
|
|
25388
|
+
const proxyHeaders = {};
|
|
25389
|
+
if (proxyAuthToken) {
|
|
25390
|
+
proxyHeaders[proxyAuthTokenHeader] = `Bearer ${proxyAuthToken}`;
|
|
25391
|
+
}
|
|
25392
|
+
let mcpProxyServerUrl;
|
|
25393
|
+
switch (transportType) {
|
|
25394
|
+
case "stdio": {
|
|
25395
|
+
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/stdio`);
|
|
25396
|
+
mcpProxyServerUrl.searchParams.append("command", command);
|
|
25397
|
+
mcpProxyServerUrl.searchParams.append("args", args);
|
|
25398
|
+
mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env));
|
|
25399
|
+
const proxyFullAddress = config.MCP_PROXY_FULL_ADDRESS.value;
|
|
25400
|
+
if (proxyFullAddress) {
|
|
25401
|
+
mcpProxyServerUrl.searchParams.append(
|
|
25402
|
+
"proxyFullAddress",
|
|
25403
|
+
proxyFullAddress
|
|
25404
|
+
);
|
|
25405
|
+
}
|
|
25406
|
+
transportOptions = {
|
|
25407
|
+
authProvider: serverAuthProvider,
|
|
25408
|
+
eventSourceInit: {
|
|
25409
|
+
fetch: (url, init) => fetch(url, {
|
|
25410
|
+
...init,
|
|
25411
|
+
headers: { ...headers, ...proxyHeaders }
|
|
25412
|
+
})
|
|
25413
|
+
},
|
|
25414
|
+
requestInit: {
|
|
25314
25415
|
headers: { ...headers, ...proxyHeaders }
|
|
25315
|
-
}
|
|
25316
|
-
}
|
|
25317
|
-
|
|
25318
|
-
|
|
25416
|
+
}
|
|
25417
|
+
};
|
|
25418
|
+
break;
|
|
25419
|
+
}
|
|
25420
|
+
case "sse": {
|
|
25421
|
+
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/sse`);
|
|
25422
|
+
mcpProxyServerUrl.searchParams.append("url", sseUrl);
|
|
25423
|
+
const proxyFullAddressSSE = config.MCP_PROXY_FULL_ADDRESS.value;
|
|
25424
|
+
if (proxyFullAddressSSE) {
|
|
25425
|
+
mcpProxyServerUrl.searchParams.append(
|
|
25426
|
+
"proxyFullAddress",
|
|
25427
|
+
proxyFullAddressSSE
|
|
25428
|
+
);
|
|
25319
25429
|
}
|
|
25320
|
-
|
|
25321
|
-
|
|
25322
|
-
|
|
25323
|
-
|
|
25324
|
-
|
|
25325
|
-
|
|
25326
|
-
|
|
25327
|
-
|
|
25328
|
-
|
|
25329
|
-
|
|
25330
|
-
|
|
25331
|
-
|
|
25430
|
+
transportOptions = {
|
|
25431
|
+
eventSourceInit: {
|
|
25432
|
+
fetch: (url, init) => fetch(url, {
|
|
25433
|
+
...init,
|
|
25434
|
+
headers: { ...headers, ...proxyHeaders }
|
|
25435
|
+
})
|
|
25436
|
+
},
|
|
25437
|
+
requestInit: {
|
|
25438
|
+
headers: { ...headers, ...proxyHeaders }
|
|
25439
|
+
}
|
|
25440
|
+
};
|
|
25441
|
+
break;
|
|
25332
25442
|
}
|
|
25333
|
-
|
|
25334
|
-
|
|
25335
|
-
|
|
25336
|
-
|
|
25443
|
+
case "streamable-http":
|
|
25444
|
+
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/mcp`);
|
|
25445
|
+
mcpProxyServerUrl.searchParams.append("url", sseUrl);
|
|
25446
|
+
transportOptions = {
|
|
25447
|
+
eventSourceInit: {
|
|
25448
|
+
fetch: (url, init) => fetch(url, {
|
|
25449
|
+
...init,
|
|
25450
|
+
headers: { ...headers, ...proxyHeaders }
|
|
25451
|
+
})
|
|
25452
|
+
},
|
|
25453
|
+
requestInit: {
|
|
25337
25454
|
headers: { ...headers, ...proxyHeaders }
|
|
25338
|
-
}
|
|
25339
|
-
|
|
25340
|
-
|
|
25341
|
-
|
|
25342
|
-
|
|
25343
|
-
|
|
25344
|
-
|
|
25455
|
+
},
|
|
25456
|
+
// TODO these should be configurable...
|
|
25457
|
+
reconnectionOptions: {
|
|
25458
|
+
maxReconnectionDelay: 3e4,
|
|
25459
|
+
initialReconnectionDelay: 1e3,
|
|
25460
|
+
reconnectionDelayGrowFactor: 1.5,
|
|
25461
|
+
maxRetries: 2
|
|
25462
|
+
}
|
|
25463
|
+
};
|
|
25464
|
+
break;
|
|
25345
25465
|
}
|
|
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;
|
|
25466
|
+
serverUrl = mcpProxyServerUrl;
|
|
25467
|
+
serverUrl.searchParams.append("transportType", transportType);
|
|
25368
25468
|
}
|
|
25369
|
-
mcpProxyServerUrl.searchParams.append(
|
|
25370
|
-
"transportType",
|
|
25371
|
-
transportType
|
|
25372
|
-
);
|
|
25373
25469
|
if (onNotification) {
|
|
25374
25470
|
[
|
|
25375
25471
|
CancelledNotificationSchema,
|
|
@@ -25388,13 +25484,10 @@ function useConnection({
|
|
|
25388
25484
|
}
|
|
25389
25485
|
let capabilities;
|
|
25390
25486
|
try {
|
|
25391
|
-
const transport = transportType === "streamable-http" ? new StreamableHTTPClientTransport(
|
|
25487
|
+
const transport = transportType === "streamable-http" ? new StreamableHTTPClientTransport(serverUrl, {
|
|
25392
25488
|
sessionId: void 0,
|
|
25393
25489
|
...transportOptions
|
|
25394
|
-
}) : new SSEClientTransport(
|
|
25395
|
-
mcpProxyServerUrl,
|
|
25396
|
-
transportOptions
|
|
25397
|
-
);
|
|
25490
|
+
}) : new SSEClientTransport(serverUrl, transportOptions);
|
|
25398
25491
|
await client2.connect(transport);
|
|
25399
25492
|
setClientTransport(transport);
|
|
25400
25493
|
capabilities = client2.getServerCapabilities();
|
|
@@ -25408,7 +25501,7 @@ function useConnection({
|
|
|
25408
25501
|
});
|
|
25409
25502
|
} catch (error) {
|
|
25410
25503
|
console.error(
|
|
25411
|
-
`Failed to connect to MCP Server via the MCP Inspector Proxy: ${
|
|
25504
|
+
connectionType === "direct" ? `Failed to connect directly to MCP Server at: ${serverUrl}:` : `Failed to connect to MCP Server via the MCP Inspector Proxy: ${serverUrl}:`,
|
|
25412
25505
|
error
|
|
25413
25506
|
);
|
|
25414
25507
|
if (isProxyAuthError(error)) {
|
|
@@ -25489,6 +25582,8 @@ function useConnection({
|
|
|
25489
25582
|
setConnectionStatus("disconnected");
|
|
25490
25583
|
setCompletionsSupported(false);
|
|
25491
25584
|
setServerCapabilities(null);
|
|
25585
|
+
setMcpSessionId(null);
|
|
25586
|
+
setMcpProtocolVersion(null);
|
|
25492
25587
|
};
|
|
25493
25588
|
const clearRequestHistory = () => {
|
|
25494
25589
|
setRequestHistory([]);
|
|
@@ -26177,7 +26272,7 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
26177
26272
|
* This source code is licensed under the ISC license.
|
|
26178
26273
|
* See the LICENSE file in the root directory of this source tree.
|
|
26179
26274
|
*/
|
|
26180
|
-
const __iconNode$
|
|
26275
|
+
const __iconNode$z = [
|
|
26181
26276
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
|
|
26182
26277
|
[
|
|
26183
26278
|
"path",
|
|
@@ -26187,14 +26282,14 @@ const __iconNode$y = [
|
|
|
26187
26282
|
}
|
|
26188
26283
|
]
|
|
26189
26284
|
];
|
|
26190
|
-
const Bell = createLucideIcon("bell", __iconNode$
|
|
26285
|
+
const Bell = createLucideIcon("bell", __iconNode$z);
|
|
26191
26286
|
/**
|
|
26192
26287
|
* @license lucide-react v0.523.0 - ISC
|
|
26193
26288
|
*
|
|
26194
26289
|
* This source code is licensed under the ISC license.
|
|
26195
26290
|
* See the LICENSE file in the root directory of this source tree.
|
|
26196
26291
|
*/
|
|
26197
|
-
const __iconNode$
|
|
26292
|
+
const __iconNode$y = [
|
|
26198
26293
|
["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
|
|
26199
26294
|
["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
|
|
26200
26295
|
["path", { d: "M9 7.13v-1a3.003 3.003 0 1 1 6 0v1", key: "d7y7pr" }],
|
|
@@ -26213,134 +26308,134 @@ const __iconNode$x = [
|
|
|
26213
26308
|
["path", { d: "M22 13h-4", key: "1jl80f" }],
|
|
26214
26309
|
["path", { d: "M17.2 17c2.1.1 3.8 1.9 3.8 4", key: "k3fwyw" }]
|
|
26215
26310
|
];
|
|
26216
|
-
const Bug = createLucideIcon("bug", __iconNode$
|
|
26311
|
+
const Bug = createLucideIcon("bug", __iconNode$y);
|
|
26217
26312
|
/**
|
|
26218
26313
|
* @license lucide-react v0.523.0 - ISC
|
|
26219
26314
|
*
|
|
26220
26315
|
* This source code is licensed under the ISC license.
|
|
26221
26316
|
* See the LICENSE file in the root directory of this source tree.
|
|
26222
26317
|
*/
|
|
26223
|
-
const __iconNode$
|
|
26318
|
+
const __iconNode$x = [
|
|
26224
26319
|
["path", { d: "M18 6 7 17l-5-5", key: "116fxf" }],
|
|
26225
26320
|
["path", { d: "m22 10-7.5 7.5L13 16", key: "ke71qq" }]
|
|
26226
26321
|
];
|
|
26227
|
-
const CheckCheck = createLucideIcon("check-check", __iconNode$
|
|
26322
|
+
const CheckCheck = createLucideIcon("check-check", __iconNode$x);
|
|
26228
26323
|
/**
|
|
26229
26324
|
* @license lucide-react v0.523.0 - ISC
|
|
26230
26325
|
*
|
|
26231
26326
|
* This source code is licensed under the ISC license.
|
|
26232
26327
|
* See the LICENSE file in the root directory of this source tree.
|
|
26233
26328
|
*/
|
|
26234
|
-
const __iconNode$
|
|
26235
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
26329
|
+
const __iconNode$w = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
26330
|
+
const Check = createLucideIcon("check", __iconNode$w);
|
|
26236
26331
|
/**
|
|
26237
26332
|
* @license lucide-react v0.523.0 - ISC
|
|
26238
26333
|
*
|
|
26239
26334
|
* This source code is licensed under the ISC license.
|
|
26240
26335
|
* See the LICENSE file in the root directory of this source tree.
|
|
26241
26336
|
*/
|
|
26242
|
-
const __iconNode$
|
|
26243
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
26337
|
+
const __iconNode$v = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
26338
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$v);
|
|
26244
26339
|
/**
|
|
26245
26340
|
* @license lucide-react v0.523.0 - ISC
|
|
26246
26341
|
*
|
|
26247
26342
|
* This source code is licensed under the ISC license.
|
|
26248
26343
|
* See the LICENSE file in the root directory of this source tree.
|
|
26249
26344
|
*/
|
|
26250
|
-
const __iconNode$
|
|
26251
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
26345
|
+
const __iconNode$u = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
26346
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$u);
|
|
26252
26347
|
/**
|
|
26253
26348
|
* @license lucide-react v0.523.0 - ISC
|
|
26254
26349
|
*
|
|
26255
26350
|
* This source code is licensed under the ISC license.
|
|
26256
26351
|
* See the LICENSE file in the root directory of this source tree.
|
|
26257
26352
|
*/
|
|
26258
|
-
const __iconNode$
|
|
26259
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode$
|
|
26353
|
+
const __iconNode$t = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
26354
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$t);
|
|
26260
26355
|
/**
|
|
26261
26356
|
* @license lucide-react v0.523.0 - ISC
|
|
26262
26357
|
*
|
|
26263
26358
|
* This source code is licensed under the ISC license.
|
|
26264
26359
|
* See the LICENSE file in the root directory of this source tree.
|
|
26265
26360
|
*/
|
|
26266
|
-
const __iconNode$
|
|
26361
|
+
const __iconNode$s = [
|
|
26267
26362
|
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
26268
26363
|
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
26269
26364
|
];
|
|
26270
|
-
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$
|
|
26365
|
+
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$s);
|
|
26271
26366
|
/**
|
|
26272
26367
|
* @license lucide-react v0.523.0 - ISC
|
|
26273
26368
|
*
|
|
26274
26369
|
* This source code is licensed under the ISC license.
|
|
26275
26370
|
* See the LICENSE file in the root directory of this source tree.
|
|
26276
26371
|
*/
|
|
26277
|
-
const __iconNode$
|
|
26372
|
+
const __iconNode$r = [
|
|
26278
26373
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
26279
26374
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
26280
26375
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
26281
26376
|
];
|
|
26282
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
26377
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$r);
|
|
26283
26378
|
/**
|
|
26284
26379
|
* @license lucide-react v0.523.0 - ISC
|
|
26285
26380
|
*
|
|
26286
26381
|
* This source code is licensed under the ISC license.
|
|
26287
26382
|
* See the LICENSE file in the root directory of this source tree.
|
|
26288
26383
|
*/
|
|
26289
|
-
const __iconNode$
|
|
26384
|
+
const __iconNode$q = [
|
|
26290
26385
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
26291
26386
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
26292
26387
|
];
|
|
26293
|
-
const CircleCheck = createLucideIcon("circle-check", __iconNode$
|
|
26388
|
+
const CircleCheck = createLucideIcon("circle-check", __iconNode$q);
|
|
26294
26389
|
/**
|
|
26295
26390
|
* @license lucide-react v0.523.0 - ISC
|
|
26296
26391
|
*
|
|
26297
26392
|
* This source code is licensed under the ISC license.
|
|
26298
26393
|
* See the LICENSE file in the root directory of this source tree.
|
|
26299
26394
|
*/
|
|
26300
|
-
const __iconNode$
|
|
26395
|
+
const __iconNode$p = [
|
|
26301
26396
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
26302
26397
|
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
26303
26398
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
26304
26399
|
];
|
|
26305
|
-
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$
|
|
26400
|
+
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$p);
|
|
26306
26401
|
/**
|
|
26307
26402
|
* @license lucide-react v0.523.0 - ISC
|
|
26308
26403
|
*
|
|
26309
26404
|
* This source code is licensed under the ISC license.
|
|
26310
26405
|
* See the LICENSE file in the root directory of this source tree.
|
|
26311
26406
|
*/
|
|
26312
|
-
const __iconNode$
|
|
26313
|
-
const Circle = createLucideIcon("circle", __iconNode$
|
|
26407
|
+
const __iconNode$o = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
26408
|
+
const Circle = createLucideIcon("circle", __iconNode$o);
|
|
26314
26409
|
/**
|
|
26315
26410
|
* @license lucide-react v0.523.0 - ISC
|
|
26316
26411
|
*
|
|
26317
26412
|
* This source code is licensed under the ISC license.
|
|
26318
26413
|
* See the LICENSE file in the root directory of this source tree.
|
|
26319
26414
|
*/
|
|
26320
|
-
const __iconNode$
|
|
26415
|
+
const __iconNode$n = [
|
|
26321
26416
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
26322
26417
|
["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
26418
|
];
|
|
26324
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
26419
|
+
const Copy = createLucideIcon("copy", __iconNode$n);
|
|
26325
26420
|
/**
|
|
26326
26421
|
* @license lucide-react v0.523.0 - ISC
|
|
26327
26422
|
*
|
|
26328
26423
|
* This source code is licensed under the ISC license.
|
|
26329
26424
|
* See the LICENSE file in the root directory of this source tree.
|
|
26330
26425
|
*/
|
|
26331
|
-
const __iconNode$
|
|
26426
|
+
const __iconNode$m = [
|
|
26332
26427
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
26333
26428
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
26334
26429
|
["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
26430
|
];
|
|
26336
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
26431
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$m);
|
|
26337
26432
|
/**
|
|
26338
26433
|
* @license lucide-react v0.523.0 - ISC
|
|
26339
26434
|
*
|
|
26340
26435
|
* This source code is licensed under the ISC license.
|
|
26341
26436
|
* See the LICENSE file in the root directory of this source tree.
|
|
26342
26437
|
*/
|
|
26343
|
-
const __iconNode$
|
|
26438
|
+
const __iconNode$l = [
|
|
26344
26439
|
[
|
|
26345
26440
|
"path",
|
|
26346
26441
|
{
|
|
@@ -26358,14 +26453,14 @@ const __iconNode$k = [
|
|
|
26358
26453
|
],
|
|
26359
26454
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
26360
26455
|
];
|
|
26361
|
-
const EyeOff = createLucideIcon("eye-off", __iconNode$
|
|
26456
|
+
const EyeOff = createLucideIcon("eye-off", __iconNode$l);
|
|
26362
26457
|
/**
|
|
26363
26458
|
* @license lucide-react v0.523.0 - ISC
|
|
26364
26459
|
*
|
|
26365
26460
|
* This source code is licensed under the ISC license.
|
|
26366
26461
|
* See the LICENSE file in the root directory of this source tree.
|
|
26367
26462
|
*/
|
|
26368
|
-
const __iconNode$
|
|
26463
|
+
const __iconNode$k = [
|
|
26369
26464
|
[
|
|
26370
26465
|
"path",
|
|
26371
26466
|
{
|
|
@@ -26375,40 +26470,40 @@ const __iconNode$j = [
|
|
|
26375
26470
|
],
|
|
26376
26471
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
26377
26472
|
];
|
|
26378
|
-
const Eye = createLucideIcon("eye", __iconNode$
|
|
26473
|
+
const Eye = createLucideIcon("eye", __iconNode$k);
|
|
26379
26474
|
/**
|
|
26380
26475
|
* @license lucide-react v0.523.0 - ISC
|
|
26381
26476
|
*
|
|
26382
26477
|
* This source code is licensed under the ISC license.
|
|
26383
26478
|
* See the LICENSE file in the root directory of this source tree.
|
|
26384
26479
|
*/
|
|
26385
|
-
const __iconNode$
|
|
26480
|
+
const __iconNode$j = [
|
|
26386
26481
|
["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
26482
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
26388
26483
|
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
26389
26484
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
26390
26485
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
26391
26486
|
];
|
|
26392
|
-
const FileText = createLucideIcon("file-text", __iconNode$
|
|
26487
|
+
const FileText = createLucideIcon("file-text", __iconNode$j);
|
|
26393
26488
|
/**
|
|
26394
26489
|
* @license lucide-react v0.523.0 - ISC
|
|
26395
26490
|
*
|
|
26396
26491
|
* This source code is licensed under the ISC license.
|
|
26397
26492
|
* See the LICENSE file in the root directory of this source tree.
|
|
26398
26493
|
*/
|
|
26399
|
-
const __iconNode$
|
|
26494
|
+
const __iconNode$i = [
|
|
26400
26495
|
["path", { d: "M20 7h-3a2 2 0 0 1-2-2V2", key: "x099mo" }],
|
|
26401
26496
|
["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
26497
|
["path", { d: "M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8", key: "1nja0z" }]
|
|
26403
26498
|
];
|
|
26404
|
-
const Files = createLucideIcon("files", __iconNode$
|
|
26499
|
+
const Files = createLucideIcon("files", __iconNode$i);
|
|
26405
26500
|
/**
|
|
26406
26501
|
* @license lucide-react v0.523.0 - ISC
|
|
26407
26502
|
*
|
|
26408
26503
|
* This source code is licensed under the ISC license.
|
|
26409
26504
|
* See the LICENSE file in the root directory of this source tree.
|
|
26410
26505
|
*/
|
|
26411
|
-
const __iconNode$
|
|
26506
|
+
const __iconNode$h = [
|
|
26412
26507
|
[
|
|
26413
26508
|
"path",
|
|
26414
26509
|
{
|
|
@@ -26426,14 +26521,14 @@ const __iconNode$g = [
|
|
|
26426
26521
|
["path", { d: "M3 5a2 2 0 0 0 2 2h3", key: "f2jnh7" }],
|
|
26427
26522
|
["path", { d: "M3 3v13a2 2 0 0 0 2 2h3", key: "k8epm1" }]
|
|
26428
26523
|
];
|
|
26429
|
-
const FolderTree = createLucideIcon("folder-tree", __iconNode$
|
|
26524
|
+
const FolderTree = createLucideIcon("folder-tree", __iconNode$h);
|
|
26430
26525
|
/**
|
|
26431
26526
|
* @license lucide-react v0.523.0 - ISC
|
|
26432
26527
|
*
|
|
26433
26528
|
* This source code is licensed under the ISC license.
|
|
26434
26529
|
* See the LICENSE file in the root directory of this source tree.
|
|
26435
26530
|
*/
|
|
26436
|
-
const __iconNode$
|
|
26531
|
+
const __iconNode$g = [
|
|
26437
26532
|
[
|
|
26438
26533
|
"path",
|
|
26439
26534
|
{
|
|
@@ -26443,14 +26538,14 @@ const __iconNode$f = [
|
|
|
26443
26538
|
],
|
|
26444
26539
|
["path", { d: "M9 18c-4.51 2-5-2-7-2", key: "9comsn" }]
|
|
26445
26540
|
];
|
|
26446
|
-
const Github = createLucideIcon("github", __iconNode$
|
|
26541
|
+
const Github = createLucideIcon("github", __iconNode$g);
|
|
26447
26542
|
/**
|
|
26448
26543
|
* @license lucide-react v0.523.0 - ISC
|
|
26449
26544
|
*
|
|
26450
26545
|
* This source code is licensed under the ISC license.
|
|
26451
26546
|
* See the LICENSE file in the root directory of this source tree.
|
|
26452
26547
|
*/
|
|
26453
|
-
const __iconNode$
|
|
26548
|
+
const __iconNode$f = [
|
|
26454
26549
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
26455
26550
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
26456
26551
|
[
|
|
@@ -26461,84 +26556,84 @@ const __iconNode$e = [
|
|
|
26461
26556
|
}
|
|
26462
26557
|
]
|
|
26463
26558
|
];
|
|
26464
|
-
const Hammer = createLucideIcon("hammer", __iconNode$
|
|
26559
|
+
const Hammer = createLucideIcon("hammer", __iconNode$f);
|
|
26465
26560
|
/**
|
|
26466
26561
|
* @license lucide-react v0.523.0 - ISC
|
|
26467
26562
|
*
|
|
26468
26563
|
* This source code is licensed under the ISC license.
|
|
26469
26564
|
* See the LICENSE file in the root directory of this source tree.
|
|
26470
26565
|
*/
|
|
26471
|
-
const __iconNode$
|
|
26566
|
+
const __iconNode$e = [
|
|
26472
26567
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
26473
26568
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
26474
26569
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
26475
26570
|
["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
|
|
26476
26571
|
];
|
|
26477
|
-
const Hash = createLucideIcon("hash", __iconNode$
|
|
26572
|
+
const Hash = createLucideIcon("hash", __iconNode$e);
|
|
26478
26573
|
/**
|
|
26479
26574
|
* @license lucide-react v0.523.0 - ISC
|
|
26480
26575
|
*
|
|
26481
26576
|
* This source code is licensed under the ISC license.
|
|
26482
26577
|
* See the LICENSE file in the root directory of this source tree.
|
|
26483
26578
|
*/
|
|
26484
|
-
const __iconNode$
|
|
26579
|
+
const __iconNode$d = [
|
|
26485
26580
|
["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
26581
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
26487
26582
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
26488
26583
|
];
|
|
26489
|
-
const Key = createLucideIcon("key", __iconNode$
|
|
26584
|
+
const Key = createLucideIcon("key", __iconNode$d);
|
|
26490
26585
|
/**
|
|
26491
26586
|
* @license lucide-react v0.523.0 - ISC
|
|
26492
26587
|
*
|
|
26493
26588
|
* This source code is licensed under the ISC license.
|
|
26494
26589
|
* See the LICENSE file in the root directory of this source tree.
|
|
26495
26590
|
*/
|
|
26496
|
-
const __iconNode$
|
|
26497
|
-
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$
|
|
26591
|
+
const __iconNode$c = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
26592
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$c);
|
|
26498
26593
|
/**
|
|
26499
26594
|
* @license lucide-react v0.523.0 - ISC
|
|
26500
26595
|
*
|
|
26501
26596
|
* This source code is licensed under the ISC license.
|
|
26502
26597
|
* See the LICENSE file in the root directory of this source tree.
|
|
26503
26598
|
*/
|
|
26504
|
-
const __iconNode$
|
|
26599
|
+
const __iconNode$b = [
|
|
26505
26600
|
["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
26601
|
];
|
|
26507
|
-
const MessageSquare = createLucideIcon("message-square", __iconNode$
|
|
26602
|
+
const MessageSquare = createLucideIcon("message-square", __iconNode$b);
|
|
26508
26603
|
/**
|
|
26509
26604
|
* @license lucide-react v0.523.0 - ISC
|
|
26510
26605
|
*
|
|
26511
26606
|
* This source code is licensed under the ISC license.
|
|
26512
26607
|
* See the LICENSE file in the root directory of this source tree.
|
|
26513
26608
|
*/
|
|
26514
|
-
const __iconNode$
|
|
26515
|
-
const Minus = createLucideIcon("minus", __iconNode$
|
|
26609
|
+
const __iconNode$a = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
26610
|
+
const Minus = createLucideIcon("minus", __iconNode$a);
|
|
26516
26611
|
/**
|
|
26517
26612
|
* @license lucide-react v0.523.0 - ISC
|
|
26518
26613
|
*
|
|
26519
26614
|
* This source code is licensed under the ISC license.
|
|
26520
26615
|
* See the LICENSE file in the root directory of this source tree.
|
|
26521
26616
|
*/
|
|
26522
|
-
const __iconNode$
|
|
26523
|
-
const Play = createLucideIcon("play", __iconNode$
|
|
26617
|
+
const __iconNode$9 = [["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]];
|
|
26618
|
+
const Play = createLucideIcon("play", __iconNode$9);
|
|
26524
26619
|
/**
|
|
26525
26620
|
* @license lucide-react v0.523.0 - ISC
|
|
26526
26621
|
*
|
|
26527
26622
|
* This source code is licensed under the ISC license.
|
|
26528
26623
|
* See the LICENSE file in the root directory of this source tree.
|
|
26529
26624
|
*/
|
|
26530
|
-
const __iconNode$
|
|
26625
|
+
const __iconNode$8 = [
|
|
26531
26626
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
26532
26627
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
26533
26628
|
];
|
|
26534
|
-
const Plus = createLucideIcon("plus", __iconNode$
|
|
26629
|
+
const Plus = createLucideIcon("plus", __iconNode$8);
|
|
26535
26630
|
/**
|
|
26536
26631
|
* @license lucide-react v0.523.0 - ISC
|
|
26537
26632
|
*
|
|
26538
26633
|
* This source code is licensed under the ISC license.
|
|
26539
26634
|
* See the LICENSE file in the root directory of this source tree.
|
|
26540
26635
|
*/
|
|
26541
|
-
const __iconNode$
|
|
26636
|
+
const __iconNode$7 = [
|
|
26542
26637
|
["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
26638
|
["path", { d: "M8 16H3v5", key: "1cv678" }],
|
|
26544
26639
|
["path", { d: "M3 12C3 9.51 4 7.26 5.64 5.64", key: "ruvoct" }],
|
|
@@ -26547,38 +26642,38 @@ const __iconNode$6 = [
|
|
|
26547
26642
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
26548
26643
|
["path", { d: "M22 22 2 2", key: "1r8tn9" }]
|
|
26549
26644
|
];
|
|
26550
|
-
const RefreshCwOff = createLucideIcon("refresh-cw-off", __iconNode$
|
|
26645
|
+
const RefreshCwOff = createLucideIcon("refresh-cw-off", __iconNode$7);
|
|
26551
26646
|
/**
|
|
26552
26647
|
* @license lucide-react v0.523.0 - ISC
|
|
26553
26648
|
*
|
|
26554
26649
|
* This source code is licensed under the ISC license.
|
|
26555
26650
|
* See the LICENSE file in the root directory of this source tree.
|
|
26556
26651
|
*/
|
|
26557
|
-
const __iconNode$
|
|
26652
|
+
const __iconNode$6 = [
|
|
26558
26653
|
["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
26654
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
26560
26655
|
["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
26656
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
26562
26657
|
];
|
|
26563
|
-
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$
|
|
26658
|
+
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$6);
|
|
26564
26659
|
/**
|
|
26565
26660
|
* @license lucide-react v0.523.0 - ISC
|
|
26566
26661
|
*
|
|
26567
26662
|
* This source code is licensed under the ISC license.
|
|
26568
26663
|
* See the LICENSE file in the root directory of this source tree.
|
|
26569
26664
|
*/
|
|
26570
|
-
const __iconNode$
|
|
26665
|
+
const __iconNode$5 = [
|
|
26571
26666
|
["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
26667
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
26573
26668
|
];
|
|
26574
|
-
const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$
|
|
26669
|
+
const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$5);
|
|
26575
26670
|
/**
|
|
26576
26671
|
* @license lucide-react v0.523.0 - ISC
|
|
26577
26672
|
*
|
|
26578
26673
|
* This source code is licensed under the ISC license.
|
|
26579
26674
|
* See the LICENSE file in the root directory of this source tree.
|
|
26580
26675
|
*/
|
|
26581
|
-
const __iconNode$
|
|
26676
|
+
const __iconNode$4 = [
|
|
26582
26677
|
[
|
|
26583
26678
|
"path",
|
|
26584
26679
|
{
|
|
@@ -26589,7 +26684,18 @@ const __iconNode$3 = [
|
|
|
26589
26684
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
26590
26685
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
26591
26686
|
];
|
|
26592
|
-
const Save = createLucideIcon("save", __iconNode$
|
|
26687
|
+
const Save = createLucideIcon("save", __iconNode$4);
|
|
26688
|
+
/**
|
|
26689
|
+
* @license lucide-react v0.523.0 - ISC
|
|
26690
|
+
*
|
|
26691
|
+
* This source code is licensed under the ISC license.
|
|
26692
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26693
|
+
*/
|
|
26694
|
+
const __iconNode$3 = [
|
|
26695
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
26696
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
26697
|
+
];
|
|
26698
|
+
const Search = createLucideIcon("search", __iconNode$3);
|
|
26593
26699
|
/**
|
|
26594
26700
|
* @license lucide-react v0.523.0 - ISC
|
|
26595
26701
|
*
|
|
@@ -26766,7 +26872,7 @@ const OAuthFlowProgress = ({
|
|
|
26766
26872
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-blue-600 mt-1", children: [
|
|
26767
26873
|
"Resource metadata was added in the",
|
|
26768
26874
|
" ",
|
|
26769
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://modelcontextprotocol.io/specification/
|
|
26875
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#authorization-server-location", children: "2025-06-18 specification update" }),
|
|
26770
26876
|
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
26771
26877
|
authState.resourceMetadataError.message,
|
|
26772
26878
|
authState.resourceMetadataError instanceof TypeError && " (This could indicate the endpoint doesn't exist or does not have CORS configured)"
|
|
@@ -27261,13 +27367,13 @@ function useCopy({ timeout = 500 } = {}) {
|
|
|
27261
27367
|
clearTimeout(timeoutId);
|
|
27262
27368
|
}
|
|
27263
27369
|
};
|
|
27264
|
-
}, [copied]);
|
|
27370
|
+
}, [copied, timeout]);
|
|
27265
27371
|
return { copied, setCopied };
|
|
27266
27372
|
}
|
|
27267
27373
|
const JsonView = reactExports.memo(
|
|
27268
27374
|
({
|
|
27269
27375
|
data: data2,
|
|
27270
|
-
name,
|
|
27376
|
+
name: name2,
|
|
27271
27377
|
initialExpandDepth = 3,
|
|
27272
27378
|
className,
|
|
27273
27379
|
withCopyButton = true,
|
|
@@ -27291,7 +27397,7 @@ const JsonView = reactExports.memo(
|
|
|
27291
27397
|
variant: "destructive"
|
|
27292
27398
|
});
|
|
27293
27399
|
}
|
|
27294
|
-
}, [toast2, normalizedData]);
|
|
27400
|
+
}, [toast2, normalizedData, setCopied]);
|
|
27295
27401
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("p-4 border rounded relative", className), children: [
|
|
27296
27402
|
withCopyButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27297
27403
|
Button,
|
|
@@ -27307,7 +27413,7 @@ const JsonView = reactExports.memo(
|
|
|
27307
27413
|
JsonNode,
|
|
27308
27414
|
{
|
|
27309
27415
|
data: normalizedData,
|
|
27310
|
-
name,
|
|
27416
|
+
name: name2,
|
|
27311
27417
|
depth: 0,
|
|
27312
27418
|
initialExpandDepth,
|
|
27313
27419
|
isError
|
|
@@ -27320,11 +27426,12 @@ JsonView.displayName = "JsonView";
|
|
|
27320
27426
|
const JsonNode = reactExports.memo(
|
|
27321
27427
|
({
|
|
27322
27428
|
data: data2,
|
|
27323
|
-
name,
|
|
27429
|
+
name: name2,
|
|
27324
27430
|
depth = 0,
|
|
27325
27431
|
initialExpandDepth,
|
|
27326
27432
|
isError = false
|
|
27327
27433
|
}) => {
|
|
27434
|
+
const { toast: toast2 } = useToast();
|
|
27328
27435
|
const [isExpanded, setIsExpanded] = reactExports.useState(depth < initialExpandDepth);
|
|
27329
27436
|
const [typeStyleMap] = reactExports.useState({
|
|
27330
27437
|
number: "text-blue-600",
|
|
@@ -27336,6 +27443,50 @@ const JsonNode = reactExports.memo(
|
|
|
27336
27443
|
default: "text-gray-700"
|
|
27337
27444
|
});
|
|
27338
27445
|
const dataType = getDataType(data2);
|
|
27446
|
+
const [copied, setCopied] = reactExports.useState(false);
|
|
27447
|
+
reactExports.useEffect(() => {
|
|
27448
|
+
let timeoutId;
|
|
27449
|
+
if (copied) {
|
|
27450
|
+
timeoutId = setTimeout(() => setCopied(false), 500);
|
|
27451
|
+
}
|
|
27452
|
+
return () => {
|
|
27453
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
27454
|
+
};
|
|
27455
|
+
}, [copied]);
|
|
27456
|
+
const handleCopyValue = reactExports.useCallback(
|
|
27457
|
+
(value) => {
|
|
27458
|
+
try {
|
|
27459
|
+
let text;
|
|
27460
|
+
const valueType = getDataType(value);
|
|
27461
|
+
switch (valueType) {
|
|
27462
|
+
case "string":
|
|
27463
|
+
text = value;
|
|
27464
|
+
break;
|
|
27465
|
+
case "number":
|
|
27466
|
+
case "boolean":
|
|
27467
|
+
text = String(value);
|
|
27468
|
+
break;
|
|
27469
|
+
case "null":
|
|
27470
|
+
text = "null";
|
|
27471
|
+
break;
|
|
27472
|
+
case "undefined":
|
|
27473
|
+
text = "undefined";
|
|
27474
|
+
break;
|
|
27475
|
+
default:
|
|
27476
|
+
text = JSON.stringify(value);
|
|
27477
|
+
}
|
|
27478
|
+
navigator.clipboard.writeText(text);
|
|
27479
|
+
setCopied(true);
|
|
27480
|
+
} catch (error) {
|
|
27481
|
+
toast2({
|
|
27482
|
+
title: "Error",
|
|
27483
|
+
description: `There was an error coping result into the clipboard: ${error instanceof Error ? error.message : String(error)}`,
|
|
27484
|
+
variant: "destructive"
|
|
27485
|
+
});
|
|
27486
|
+
}
|
|
27487
|
+
},
|
|
27488
|
+
[toast2]
|
|
27489
|
+
);
|
|
27339
27490
|
const renderCollapsible = (isArray) => {
|
|
27340
27491
|
const items2 = isArray ? data2 : Object.entries(data2);
|
|
27341
27492
|
const itemCount = items2.length;
|
|
@@ -27348,8 +27499,8 @@ const JsonNode = reactExports.memo(
|
|
|
27348
27499
|
};
|
|
27349
27500
|
if (isEmpty) {
|
|
27350
27501
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
|
27351
|
-
|
|
27352
|
-
|
|
27502
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
|
|
27503
|
+
name2,
|
|
27353
27504
|
":"
|
|
27354
27505
|
] }),
|
|
27355
27506
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-500", children: symbolMap.empty })
|
|
@@ -27362,8 +27513,8 @@ const JsonNode = reactExports.memo(
|
|
|
27362
27513
|
className: "flex items-center mr-1 rounded cursor-pointer group hover:bg-gray-800/10 dark:hover:bg-gray-800/20",
|
|
27363
27514
|
onClick: () => setIsExpanded(!isExpanded),
|
|
27364
27515
|
children: [
|
|
27365
|
-
|
|
27366
|
-
|
|
27516
|
+
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: [
|
|
27517
|
+
name2,
|
|
27367
27518
|
":"
|
|
27368
27519
|
] }),
|
|
27369
27520
|
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: [
|
|
@@ -27403,9 +27554,9 @@ const JsonNode = reactExports.memo(
|
|
|
27403
27554
|
const maxLength = 100;
|
|
27404
27555
|
const isTooLong = value.length > maxLength;
|
|
27405
27556
|
if (!isTooLong) {
|
|
27406
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded hover:bg-gray-800/20", children: [
|
|
27407
|
-
|
|
27408
|
-
|
|
27557
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded hover:bg-gray-800/20 group items-start", children: [
|
|
27558
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
|
|
27559
|
+
name2,
|
|
27409
27560
|
":"
|
|
27410
27561
|
] }),
|
|
27411
27562
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -27421,12 +27572,26 @@ const JsonNode = reactExports.memo(
|
|
|
27421
27572
|
'"'
|
|
27422
27573
|
]
|
|
27423
27574
|
}
|
|
27575
|
+
),
|
|
27576
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27577
|
+
Button,
|
|
27578
|
+
{
|
|
27579
|
+
variant: "ghost",
|
|
27580
|
+
className: "ml-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100",
|
|
27581
|
+
onClick: (e) => {
|
|
27582
|
+
e.stopPropagation();
|
|
27583
|
+
handleCopyValue(value);
|
|
27584
|
+
},
|
|
27585
|
+
"aria-label": name2 ? `Copy value of ${name2}` : "Copy value",
|
|
27586
|
+
title: name2 ? `Copy value of ${name2}` : "Copy value",
|
|
27587
|
+
children: copied ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "size-4 dark:text-green-700 text-green-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "size-4 text-foreground" })
|
|
27588
|
+
}
|
|
27424
27589
|
)
|
|
27425
27590
|
] });
|
|
27426
27591
|
}
|
|
27427
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded group hover:bg-gray-800/20", children: [
|
|
27428
|
-
|
|
27429
|
-
|
|
27592
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded group hover:bg-gray-800/20 items-start", children: [
|
|
27593
|
+
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: [
|
|
27594
|
+
name2,
|
|
27430
27595
|
":"
|
|
27431
27596
|
] }),
|
|
27432
27597
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -27440,6 +27605,20 @@ const JsonNode = reactExports.memo(
|
|
|
27440
27605
|
title: isExpanded ? "Click to collapse" : "Click to expand",
|
|
27441
27606
|
children: isExpanded ? `"${value}"` : `"${value.slice(0, maxLength)}..."`
|
|
27442
27607
|
}
|
|
27608
|
+
),
|
|
27609
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27610
|
+
Button,
|
|
27611
|
+
{
|
|
27612
|
+
variant: "ghost",
|
|
27613
|
+
className: "ml-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100",
|
|
27614
|
+
onClick: (e) => {
|
|
27615
|
+
e.stopPropagation();
|
|
27616
|
+
handleCopyValue(value);
|
|
27617
|
+
},
|
|
27618
|
+
"aria-label": name2 ? `Copy value of ${name2}` : "Copy value",
|
|
27619
|
+
title: name2 ? `Copy value of ${name2}` : "Copy value",
|
|
27620
|
+
children: copied ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "size-4 dark:text-green-700 text-green-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "size-4 text-foreground" })
|
|
27621
|
+
}
|
|
27443
27622
|
)
|
|
27444
27623
|
] });
|
|
27445
27624
|
};
|
|
@@ -27450,12 +27629,26 @@ const JsonNode = reactExports.memo(
|
|
|
27450
27629
|
case "string":
|
|
27451
27630
|
return renderString(data2);
|
|
27452
27631
|
default:
|
|
27453
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mr-1 rounded hover:bg-gray-800/20", children: [
|
|
27454
|
-
|
|
27455
|
-
|
|
27632
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mr-1 rounded hover:bg-gray-800/20 group", children: [
|
|
27633
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
|
|
27634
|
+
name2,
|
|
27456
27635
|
":"
|
|
27457
27636
|
] }),
|
|
27458
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: typeStyleMap[dataType] || typeStyleMap.default, children: data2 === null ? "null" : String(data2) })
|
|
27637
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: typeStyleMap[dataType] || typeStyleMap.default, children: data2 === null ? "null" : String(data2) }),
|
|
27638
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27639
|
+
Button,
|
|
27640
|
+
{
|
|
27641
|
+
variant: "ghost",
|
|
27642
|
+
className: "ml-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100",
|
|
27643
|
+
onClick: (e) => {
|
|
27644
|
+
e.stopPropagation();
|
|
27645
|
+
handleCopyValue(data2);
|
|
27646
|
+
},
|
|
27647
|
+
"aria-label": name2 ? `Copy value of ${name2}` : "Copy value",
|
|
27648
|
+
title: name2 ? `Copy value of ${name2}` : "Copy value",
|
|
27649
|
+
children: copied ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "size-4 dark:text-green-700 text-green-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "size-4 text-foreground" })
|
|
27650
|
+
}
|
|
27651
|
+
)
|
|
27459
27652
|
] });
|
|
27460
27653
|
}
|
|
27461
27654
|
}
|
|
@@ -28476,8 +28669,8 @@ function RemoveScrollSideCar(props) {
|
|
|
28476
28669
|
}
|
|
28477
28670
|
}
|
|
28478
28671
|
}, []);
|
|
28479
|
-
var shouldCancel = reactExports.useCallback(function(
|
|
28480
|
-
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
28672
|
+
var shouldCancel = reactExports.useCallback(function(name2, delta, target, should) {
|
|
28673
|
+
var event = { name: name2, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
28481
28674
|
shouldPreventQueue.current.push(event);
|
|
28482
28675
|
setTimeout(function() {
|
|
28483
28676
|
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
@@ -29596,7 +29789,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
29596
29789
|
let resetCount = 0;
|
|
29597
29790
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
29598
29791
|
const {
|
|
29599
|
-
name,
|
|
29792
|
+
name: name2,
|
|
29600
29793
|
fn
|
|
29601
29794
|
} = validMiddleware[i];
|
|
29602
29795
|
const {
|
|
@@ -29622,8 +29815,8 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
29622
29815
|
y = nextY != null ? nextY : y;
|
|
29623
29816
|
middlewareData = {
|
|
29624
29817
|
...middlewareData,
|
|
29625
|
-
[
|
|
29626
|
-
...middlewareData[
|
|
29818
|
+
[name2]: {
|
|
29819
|
+
...middlewareData[name2],
|
|
29627
29820
|
...data2
|
|
29628
29821
|
}
|
|
29629
29822
|
};
|
|
@@ -31889,12 +32082,22 @@ function Combobox({
|
|
|
31889
32082
|
value,
|
|
31890
32083
|
onChange,
|
|
31891
32084
|
onInputChange,
|
|
32085
|
+
onFocus,
|
|
31892
32086
|
options = [],
|
|
31893
32087
|
placeholder = "Select...",
|
|
31894
32088
|
emptyMessage = "No results found.",
|
|
31895
32089
|
id
|
|
31896
32090
|
}) {
|
|
31897
32091
|
const [open, setOpen] = React.useState(false);
|
|
32092
|
+
const handleOpenChange = React.useCallback(
|
|
32093
|
+
(newOpen) => {
|
|
32094
|
+
setOpen(newOpen);
|
|
32095
|
+
if (newOpen && onFocus) {
|
|
32096
|
+
onFocus();
|
|
32097
|
+
}
|
|
32098
|
+
},
|
|
32099
|
+
[onFocus]
|
|
32100
|
+
);
|
|
31898
32101
|
const handleSelect = React.useCallback(
|
|
31899
32102
|
(option) => {
|
|
31900
32103
|
onChange(option);
|
|
@@ -31908,7 +32111,7 @@ function Combobox({
|
|
|
31908
32111
|
},
|
|
31909
32112
|
[onInputChange]
|
|
31910
32113
|
);
|
|
31911
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover, { open, onOpenChange:
|
|
32114
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
31912
32115
|
/* @__PURE__ */ jsxRuntimeExports.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
31913
32116
|
Button,
|
|
31914
32117
|
{
|
|
@@ -31987,6 +32190,23 @@ const Label$1 = reactExports.forwardRef(({ className, ...props }, ref2) => /* @_
|
|
|
31987
32190
|
}
|
|
31988
32191
|
));
|
|
31989
32192
|
Label$1.displayName = Root$1.displayName;
|
|
32193
|
+
const Input = reactExports.forwardRef(
|
|
32194
|
+
({ className, type: type2, ...props }, ref2) => {
|
|
32195
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32196
|
+
"input",
|
|
32197
|
+
{
|
|
32198
|
+
type: type2,
|
|
32199
|
+
className: cn(
|
|
32200
|
+
"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",
|
|
32201
|
+
className
|
|
32202
|
+
),
|
|
32203
|
+
ref: ref2,
|
|
32204
|
+
...props
|
|
32205
|
+
}
|
|
32206
|
+
);
|
|
32207
|
+
}
|
|
32208
|
+
);
|
|
32209
|
+
Input.displayName = "Input";
|
|
31990
32210
|
const ListPane = ({
|
|
31991
32211
|
items: items2,
|
|
31992
32212
|
listItems,
|
|
@@ -31996,40 +32216,101 @@ const ListPane = ({
|
|
|
31996
32216
|
title: title2,
|
|
31997
32217
|
buttonText,
|
|
31998
32218
|
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
|
-
|
|
32219
|
+
}) => {
|
|
32220
|
+
const [searchQuery, setSearchQuery] = reactExports.useState("");
|
|
32221
|
+
const [isSearchExpanded, setIsSearchExpanded] = reactExports.useState(false);
|
|
32222
|
+
const searchInputRef = reactExports.useRef(null);
|
|
32223
|
+
const filteredItems = reactExports.useMemo(() => {
|
|
32224
|
+
if (!searchQuery.trim()) return items2;
|
|
32225
|
+
return items2.filter((item) => {
|
|
32226
|
+
const searchableText = [
|
|
32227
|
+
item.name || "",
|
|
32228
|
+
item.description || ""
|
|
32229
|
+
].join(" ").toLowerCase();
|
|
32230
|
+
return searchableText.includes(searchQuery.toLowerCase());
|
|
32231
|
+
});
|
|
32232
|
+
}, [items2, searchQuery]);
|
|
32233
|
+
const handleSearchClick = () => {
|
|
32234
|
+
setIsSearchExpanded(true);
|
|
32235
|
+
setTimeout(() => {
|
|
32236
|
+
var _a;
|
|
32237
|
+
(_a = searchInputRef.current) == null ? void 0 : _a.focus();
|
|
32238
|
+
}, 100);
|
|
32239
|
+
};
|
|
32240
|
+
const handleSearchBlur = () => {
|
|
32241
|
+
if (!searchQuery.trim()) {
|
|
32242
|
+
setIsSearchExpanded(false);
|
|
32243
|
+
}
|
|
32244
|
+
};
|
|
32245
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card border border-border rounded-lg shadow", children: [
|
|
32246
|
+
/* @__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: [
|
|
32247
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold dark:text-white flex-shrink-0", children: title2 }),
|
|
32248
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-end min-w-0 flex-1", children: !isSearchExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32249
|
+
"button",
|
|
32250
|
+
{
|
|
32251
|
+
name: "search",
|
|
32252
|
+
"aria-label": "Search",
|
|
32253
|
+
onClick: handleSearchClick,
|
|
32254
|
+
className: "p-2 hover:bg-gray-100 dark:hover:bg-secondary rounded-md transition-all duration-300 ease-in-out",
|
|
32255
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "w-4 h-4 text-muted-foreground" })
|
|
32256
|
+
}
|
|
32257
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center w-full max-w-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-full", children: [
|
|
32258
|
+
/* @__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" }),
|
|
32259
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32260
|
+
Input,
|
|
32261
|
+
{
|
|
32262
|
+
ref: searchInputRef,
|
|
32263
|
+
name: "search",
|
|
32264
|
+
type: "text",
|
|
32265
|
+
placeholder: "Search...",
|
|
32266
|
+
value: searchQuery,
|
|
32267
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
32268
|
+
onBlur: handleSearchBlur,
|
|
32269
|
+
className: "pl-10 w-full transition-all duration-300 ease-in-out"
|
|
32270
|
+
}
|
|
32271
|
+
)
|
|
32272
|
+
] }) }) })
|
|
32273
|
+
] }) }),
|
|
32274
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
|
|
32275
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32276
|
+
Button,
|
|
32277
|
+
{
|
|
32278
|
+
variant: "outline",
|
|
32279
|
+
className: "w-full mb-4",
|
|
32280
|
+
onClick: listItems,
|
|
32281
|
+
disabled: isButtonDisabled,
|
|
32282
|
+
children: buttonText
|
|
32283
|
+
}
|
|
32284
|
+
),
|
|
32285
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32286
|
+
Button,
|
|
32287
|
+
{
|
|
32288
|
+
variant: "outline",
|
|
32289
|
+
className: "w-full mb-4",
|
|
32290
|
+
onClick: clearItems,
|
|
32291
|
+
disabled: items2.length === 0,
|
|
32292
|
+
children: "Clear"
|
|
32293
|
+
}
|
|
32294
|
+
),
|
|
32295
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 overflow-y-auto max-h-96", children: [
|
|
32296
|
+
filteredItems.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32297
|
+
"div",
|
|
32298
|
+
{
|
|
32299
|
+
className: "flex items-center py-2 px-4 rounded hover:bg-gray-50 dark:hover:bg-secondary cursor-pointer",
|
|
32300
|
+
onClick: () => setSelectedItem(item),
|
|
32301
|
+
children: renderItem(item)
|
|
32302
|
+
},
|
|
32303
|
+
index2
|
|
32304
|
+
)),
|
|
32305
|
+
filteredItems.length === 0 && searchQuery && items2.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-4 text-muted-foreground", children: [
|
|
32306
|
+
'No items found matching "',
|
|
32307
|
+
searchQuery,
|
|
32308
|
+
'"'
|
|
32309
|
+
] })
|
|
32310
|
+
] })
|
|
32311
|
+
] })
|
|
32312
|
+
] });
|
|
32313
|
+
};
|
|
32033
32314
|
function debounce(func, wait) {
|
|
32034
32315
|
let timeout;
|
|
32035
32316
|
return (...args) => {
|
|
@@ -32140,8 +32421,7 @@ const PromptsTab = ({
|
|
|
32140
32421
|
reactExports.useEffect(() => {
|
|
32141
32422
|
clearCompletions();
|
|
32142
32423
|
}, [clearCompletions, selectedPrompt]);
|
|
32143
|
-
const
|
|
32144
|
-
setPromptArgs((prev) => ({ ...prev, [argName]: value }));
|
|
32424
|
+
const triggerCompletions = (argName, value) => {
|
|
32145
32425
|
if (selectedPrompt) {
|
|
32146
32426
|
requestCompletions(
|
|
32147
32427
|
{
|
|
@@ -32154,6 +32434,14 @@ const PromptsTab = ({
|
|
|
32154
32434
|
);
|
|
32155
32435
|
}
|
|
32156
32436
|
};
|
|
32437
|
+
const handleInputChange = async (argName, value) => {
|
|
32438
|
+
setPromptArgs((prev) => ({ ...prev, [argName]: value }));
|
|
32439
|
+
triggerCompletions(argName, value);
|
|
32440
|
+
};
|
|
32441
|
+
const handleFocus = async (argName) => {
|
|
32442
|
+
const currentValue = promptArgs[argName] || "";
|
|
32443
|
+
triggerCompletions(argName, currentValue);
|
|
32444
|
+
};
|
|
32157
32445
|
const handleGetPrompt = () => {
|
|
32158
32446
|
if (selectedPrompt) {
|
|
32159
32447
|
getPrompt(selectedPrompt.name, promptArgs);
|
|
@@ -32187,7 +32475,7 @@ const PromptsTab = ({
|
|
|
32187
32475
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: error ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
|
|
32188
32476
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
32189
32477
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
|
|
32190
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
|
|
32478
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "break-all", children: error })
|
|
32191
32479
|
] }) : selectedPrompt ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
32192
32480
|
selectedPrompt.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: selectedPrompt.description }),
|
|
32193
32481
|
(_a = selectedPrompt.arguments) == null ? void 0 : _a.map((arg) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -32200,6 +32488,7 @@ const PromptsTab = ({
|
|
|
32200
32488
|
value: promptArgs[arg.name] || "",
|
|
32201
32489
|
onChange: (value) => handleInputChange(arg.name, value),
|
|
32202
32490
|
onInputChange: (value) => handleInputChange(arg.name, value),
|
|
32491
|
+
onFocus: () => handleFocus(arg.name),
|
|
32203
32492
|
options: completions[arg.name] || []
|
|
32204
32493
|
}
|
|
32205
32494
|
),
|
|
@@ -32265,11 +32554,11 @@ class UriTemplate {
|
|
|
32265
32554
|
const operator = this.getOperator(expr);
|
|
32266
32555
|
const exploded = expr.includes("*");
|
|
32267
32556
|
const names = this.getNames(expr);
|
|
32268
|
-
const
|
|
32269
|
-
for (const
|
|
32270
|
-
UriTemplate.validateLength(
|
|
32557
|
+
const name2 = names[0];
|
|
32558
|
+
for (const name3 of names) {
|
|
32559
|
+
UriTemplate.validateLength(name3, MAX_VARIABLE_LENGTH, "Variable name");
|
|
32271
32560
|
}
|
|
32272
|
-
parts.push({ name, operator, names, exploded });
|
|
32561
|
+
parts.push({ name: name2, operator, names, exploded });
|
|
32273
32562
|
i = end + 1;
|
|
32274
32563
|
} else {
|
|
32275
32564
|
currentText += template[i];
|
|
@@ -32287,7 +32576,7 @@ class UriTemplate {
|
|
|
32287
32576
|
}
|
|
32288
32577
|
getNames(expr) {
|
|
32289
32578
|
const operator = this.getOperator(expr);
|
|
32290
|
-
return expr.slice(operator.length).split(",").map((
|
|
32579
|
+
return expr.slice(operator.length).split(",").map((name2) => name2.replace("*", "").trim()).filter((name2) => name2.length > 0);
|
|
32291
32580
|
}
|
|
32292
32581
|
encodeValue(value, operator) {
|
|
32293
32582
|
UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, "Variable value");
|
|
@@ -32298,12 +32587,12 @@ class UriTemplate {
|
|
|
32298
32587
|
}
|
|
32299
32588
|
expandPart(part, variables) {
|
|
32300
32589
|
if (part.operator === "?" || part.operator === "&") {
|
|
32301
|
-
const pairs = part.names.map((
|
|
32302
|
-
const value2 = variables[
|
|
32590
|
+
const pairs = part.names.map((name2) => {
|
|
32591
|
+
const value2 = variables[name2];
|
|
32303
32592
|
if (value2 === void 0)
|
|
32304
32593
|
return "";
|
|
32305
32594
|
const encoded2 = Array.isArray(value2) ? value2.map((v) => this.encodeValue(v, part.operator)).join(",") : this.encodeValue(value2.toString(), part.operator);
|
|
32306
|
-
return `${
|
|
32595
|
+
return `${name2}=${encoded2}`;
|
|
32307
32596
|
}).filter((pair) => pair.length > 0);
|
|
32308
32597
|
if (pairs.length === 0)
|
|
32309
32598
|
return "";
|
|
@@ -32311,7 +32600,7 @@ class UriTemplate {
|
|
|
32311
32600
|
return separator + pairs.join("&");
|
|
32312
32601
|
}
|
|
32313
32602
|
if (part.names.length > 1) {
|
|
32314
|
-
const values2 = part.names.map((
|
|
32603
|
+
const values2 = part.names.map((name2) => variables[name2]).filter((v) => v !== void 0);
|
|
32315
32604
|
if (values2.length === 0)
|
|
32316
32605
|
return "";
|
|
32317
32606
|
return values2.map((v) => Array.isArray(v) ? v[0] : v).join(",");
|
|
@@ -32363,22 +32652,22 @@ class UriTemplate {
|
|
|
32363
32652
|
}
|
|
32364
32653
|
partToRegExp(part) {
|
|
32365
32654
|
const patterns = [];
|
|
32366
|
-
for (const
|
|
32367
|
-
UriTemplate.validateLength(
|
|
32655
|
+
for (const name3 of part.names) {
|
|
32656
|
+
UriTemplate.validateLength(name3, MAX_VARIABLE_LENGTH, "Variable name");
|
|
32368
32657
|
}
|
|
32369
32658
|
if (part.operator === "?" || part.operator === "&") {
|
|
32370
32659
|
for (let i = 0; i < part.names.length; i++) {
|
|
32371
|
-
const
|
|
32660
|
+
const name3 = part.names[i];
|
|
32372
32661
|
const prefix = i === 0 ? "\\" + part.operator : "&";
|
|
32373
32662
|
patterns.push({
|
|
32374
|
-
pattern: prefix + this.escapeRegExp(
|
|
32375
|
-
name:
|
|
32663
|
+
pattern: prefix + this.escapeRegExp(name3) + "=([^&]+)",
|
|
32664
|
+
name: name3
|
|
32376
32665
|
});
|
|
32377
32666
|
}
|
|
32378
32667
|
return patterns;
|
|
32379
32668
|
}
|
|
32380
32669
|
let pattern2;
|
|
32381
|
-
const
|
|
32670
|
+
const name2 = part.name;
|
|
32382
32671
|
switch (part.operator) {
|
|
32383
32672
|
case "":
|
|
32384
32673
|
pattern2 = part.exploded ? "([^/]+(?:,[^/]+)*)" : "([^/,]+)";
|
|
@@ -32396,7 +32685,7 @@ class UriTemplate {
|
|
|
32396
32685
|
default:
|
|
32397
32686
|
pattern2 = "([^/]+)";
|
|
32398
32687
|
}
|
|
32399
|
-
patterns.push({ pattern: pattern2, name });
|
|
32688
|
+
patterns.push({ pattern: pattern2, name: name2 });
|
|
32400
32689
|
return patterns;
|
|
32401
32690
|
}
|
|
32402
32691
|
match(uri) {
|
|
@@ -32408,9 +32697,9 @@ class UriTemplate {
|
|
|
32408
32697
|
pattern2 += this.escapeRegExp(part);
|
|
32409
32698
|
} else {
|
|
32410
32699
|
const patterns = this.partToRegExp(part);
|
|
32411
|
-
for (const { pattern: partPattern, name } of patterns) {
|
|
32700
|
+
for (const { pattern: partPattern, name: name2 } of patterns) {
|
|
32412
32701
|
pattern2 += partPattern;
|
|
32413
|
-
names.push({ name, exploded: part.exploded });
|
|
32702
|
+
names.push({ name: name2, exploded: part.exploded });
|
|
32414
32703
|
}
|
|
32415
32704
|
}
|
|
32416
32705
|
}
|
|
@@ -32422,9 +32711,9 @@ class UriTemplate {
|
|
|
32422
32711
|
return null;
|
|
32423
32712
|
const result = {};
|
|
32424
32713
|
for (let i = 0; i < names.length; i++) {
|
|
32425
|
-
const { name, exploded } = names[i];
|
|
32714
|
+
const { name: name2, exploded } = names[i];
|
|
32426
32715
|
const value = match[i + 1];
|
|
32427
|
-
const cleanName =
|
|
32716
|
+
const cleanName = name2.replace("*", "");
|
|
32428
32717
|
if (exploded && value.includes(",")) {
|
|
32429
32718
|
result[cleanName] = value.split(",");
|
|
32430
32719
|
} else {
|
|
@@ -32588,7 +32877,7 @@ const ResourcesTab = ({
|
|
|
32588
32877
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: error ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
|
|
32589
32878
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
32590
32879
|
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
|
|
32591
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
|
|
32880
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "break-all", children: error })
|
|
32592
32881
|
] }) : selectedResource ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
32593
32882
|
JsonView,
|
|
32594
32883
|
{
|
|
@@ -32627,23 +32916,6 @@ const ResourcesTab = ({
|
|
|
32627
32916
|
] })
|
|
32628
32917
|
] }) });
|
|
32629
32918
|
};
|
|
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
32919
|
const RootsTab = ({
|
|
32648
32920
|
roots,
|
|
32649
32921
|
setRoots,
|
|
@@ -32772,7 +33044,7 @@ function requireLib() {
|
|
|
32772
33044
|
"\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
33045
|
);
|
|
32774
33046
|
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,
|
|
33047
|
+
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
33048
|
var historyRef = React2.useRef({
|
|
32777
33049
|
stack: [],
|
|
32778
33050
|
offset: -1
|
|
@@ -33045,7 +33317,7 @@ function requireLib() {
|
|
|
33045
33317
|
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
33318
|
React2.createElement("textarea", { ref: function(c) {
|
|
33047
33319
|
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 }),
|
|
33320
|
+
}, 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
33321
|
React2.createElement("style", { dangerouslySetInnerHTML: { __html: cssText } })
|
|
33050
33322
|
);
|
|
33051
33323
|
});
|
|
@@ -33749,10 +34021,10 @@ function requirePrism() {
|
|
|
33749
34021
|
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
33750
34022
|
* @public
|
|
33751
34023
|
*/
|
|
33752
|
-
add: function(
|
|
34024
|
+
add: function(name2, callback) {
|
|
33753
34025
|
var hooks = _.hooks.all;
|
|
33754
|
-
hooks[
|
|
33755
|
-
hooks[
|
|
34026
|
+
hooks[name2] = hooks[name2] || [];
|
|
34027
|
+
hooks[name2].push(callback);
|
|
33756
34028
|
},
|
|
33757
34029
|
/**
|
|
33758
34030
|
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
@@ -33763,8 +34035,8 @@ function requirePrism() {
|
|
|
33763
34035
|
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
33764
34036
|
* @public
|
|
33765
34037
|
*/
|
|
33766
|
-
run: function(
|
|
33767
|
-
var callbacks = _.hooks.all[
|
|
34038
|
+
run: function(name2, env) {
|
|
34039
|
+
var callbacks = _.hooks.all[name2];
|
|
33768
34040
|
if (!callbacks || !callbacks.length) {
|
|
33769
34041
|
return;
|
|
33770
34042
|
}
|
|
@@ -33811,8 +34083,8 @@ function requirePrism() {
|
|
|
33811
34083
|
}
|
|
33812
34084
|
_.hooks.run("wrap", env);
|
|
33813
34085
|
var attributes = "";
|
|
33814
|
-
for (var
|
|
33815
|
-
attributes += " " +
|
|
34086
|
+
for (var name2 in env.attributes) {
|
|
34087
|
+
attributes += " " + name2 + '="' + (env.attributes[name2] || "").replace(/"/g, """) + '"';
|
|
33816
34088
|
}
|
|
33817
34089
|
return "<" + env.tag + ' class="' + env.classes.join(" ") + '"' + attributes + ">" + env.content + "</" + env.tag + ">";
|
|
33818
34090
|
};
|
|
@@ -34673,259 +34945,391 @@ const getArrayItemDefault = (schema) => {
|
|
|
34673
34945
|
return null;
|
|
34674
34946
|
}
|
|
34675
34947
|
};
|
|
34676
|
-
const DynamicJsonForm = (
|
|
34677
|
-
schema,
|
|
34678
|
-
|
|
34679
|
-
|
|
34680
|
-
|
|
34681
|
-
|
|
34682
|
-
|
|
34683
|
-
|
|
34684
|
-
|
|
34685
|
-
|
|
34686
|
-
|
|
34687
|
-
|
|
34688
|
-
|
|
34689
|
-
|
|
34690
|
-
|
|
34691
|
-
|
|
34692
|
-
|
|
34693
|
-
|
|
34694
|
-
|
|
34948
|
+
const DynamicJsonForm = reactExports.forwardRef(
|
|
34949
|
+
({ schema, value, onChange, maxDepth = 3 }, ref2) => {
|
|
34950
|
+
const isOnlyJSON = !isSimpleObject(schema);
|
|
34951
|
+
const [isJsonMode, setIsJsonMode] = reactExports.useState(isOnlyJSON);
|
|
34952
|
+
const [jsonError, setJsonError] = reactExports.useState();
|
|
34953
|
+
const [copiedJson, setCopiedJson] = reactExports.useState(false);
|
|
34954
|
+
const { toast: toast2 } = useToast();
|
|
34955
|
+
const [rawJsonValue, setRawJsonValue] = reactExports.useState(
|
|
34956
|
+
JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
|
|
34957
|
+
);
|
|
34958
|
+
const timeoutRef = reactExports.useRef();
|
|
34959
|
+
const debouncedUpdateParent = reactExports.useCallback(
|
|
34960
|
+
(jsonString) => {
|
|
34961
|
+
if (timeoutRef.current) {
|
|
34962
|
+
clearTimeout(timeoutRef.current);
|
|
34963
|
+
}
|
|
34964
|
+
timeoutRef.current = setTimeout(() => {
|
|
34965
|
+
try {
|
|
34966
|
+
const parsed = JSON.parse(jsonString);
|
|
34967
|
+
onChange(parsed);
|
|
34968
|
+
setJsonError(void 0);
|
|
34969
|
+
} catch (err) {
|
|
34970
|
+
const errorMessage = err instanceof Error ? err.message : "Invalid JSON";
|
|
34971
|
+
setJsonError(errorMessage);
|
|
34972
|
+
const trimmed = jsonString.trim();
|
|
34973
|
+
if (trimmed.length > 5 && !trimmed.match(/^[\s[{]/)) {
|
|
34974
|
+
onChange(generateDefaultValue(schema));
|
|
34975
|
+
}
|
|
34976
|
+
}
|
|
34977
|
+
}, 300);
|
|
34978
|
+
},
|
|
34979
|
+
[onChange, setJsonError, schema]
|
|
34980
|
+
);
|
|
34981
|
+
reactExports.useEffect(() => {
|
|
34982
|
+
if (!isJsonMode) {
|
|
34983
|
+
setRawJsonValue(
|
|
34984
|
+
JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
|
|
34985
|
+
);
|
|
34695
34986
|
}
|
|
34696
|
-
|
|
34987
|
+
}, [value, schema, isJsonMode]);
|
|
34988
|
+
const handleSwitchToFormMode = () => {
|
|
34989
|
+
if (isJsonMode) {
|
|
34697
34990
|
try {
|
|
34698
|
-
const parsed = JSON.parse(
|
|
34991
|
+
const parsed = JSON.parse(rawJsonValue);
|
|
34699
34992
|
onChange(parsed);
|
|
34700
|
-
|
|
34701
|
-
} catch {
|
|
34993
|
+
setIsJsonMode(false);
|
|
34994
|
+
} catch (err) {
|
|
34995
|
+
setJsonError(err instanceof Error ? err.message : "Invalid JSON");
|
|
34702
34996
|
}
|
|
34703
|
-
}
|
|
34704
|
-
|
|
34705
|
-
|
|
34706
|
-
|
|
34707
|
-
|
|
34708
|
-
|
|
34709
|
-
|
|
34710
|
-
|
|
34711
|
-
);
|
|
34712
|
-
}
|
|
34713
|
-
}, [value, schema, isJsonMode]);
|
|
34714
|
-
const handleSwitchToFormMode = () => {
|
|
34715
|
-
if (isJsonMode) {
|
|
34997
|
+
} else {
|
|
34998
|
+
setRawJsonValue(
|
|
34999
|
+
JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
|
|
35000
|
+
);
|
|
35001
|
+
setIsJsonMode(true);
|
|
35002
|
+
}
|
|
35003
|
+
};
|
|
35004
|
+
const formatJson = () => {
|
|
34716
35005
|
try {
|
|
34717
|
-
const
|
|
34718
|
-
|
|
34719
|
-
|
|
35006
|
+
const jsonStr = rawJsonValue.trim();
|
|
35007
|
+
if (!jsonStr) {
|
|
35008
|
+
return;
|
|
35009
|
+
}
|
|
35010
|
+
const formatted = JSON.stringify(JSON.parse(jsonStr), null, 2);
|
|
35011
|
+
setRawJsonValue(formatted);
|
|
35012
|
+
debouncedUpdateParent(formatted);
|
|
35013
|
+
setJsonError(void 0);
|
|
34720
35014
|
} catch (err) {
|
|
34721
35015
|
setJsonError(err instanceof Error ? err.message : "Invalid JSON");
|
|
34722
35016
|
}
|
|
34723
|
-
}
|
|
34724
|
-
|
|
34725
|
-
|
|
34726
|
-
|
|
34727
|
-
|
|
34728
|
-
|
|
34729
|
-
|
|
34730
|
-
|
|
34731
|
-
|
|
34732
|
-
|
|
34733
|
-
|
|
34734
|
-
|
|
35017
|
+
};
|
|
35018
|
+
const validateJson = () => {
|
|
35019
|
+
if (!isJsonMode) return { isValid: true, error: null };
|
|
35020
|
+
try {
|
|
35021
|
+
const jsonStr = rawJsonValue.trim();
|
|
35022
|
+
if (!jsonStr) return { isValid: true, error: null };
|
|
35023
|
+
const parsed = JSON.parse(jsonStr);
|
|
35024
|
+
if (timeoutRef.current) {
|
|
35025
|
+
clearTimeout(timeoutRef.current);
|
|
35026
|
+
}
|
|
35027
|
+
onChange(parsed);
|
|
35028
|
+
setJsonError(void 0);
|
|
35029
|
+
return { isValid: true, error: null };
|
|
35030
|
+
} catch (err) {
|
|
35031
|
+
const errorMessage = err instanceof Error ? err.message : "Invalid JSON";
|
|
35032
|
+
setJsonError(errorMessage);
|
|
35033
|
+
return { isValid: false, error: errorMessage };
|
|
34735
35034
|
}
|
|
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
|
-
|
|
35035
|
+
};
|
|
35036
|
+
const handleCopyJson = reactExports.useCallback(async () => {
|
|
35037
|
+
try {
|
|
35038
|
+
await navigator.clipboard.writeText(
|
|
35039
|
+
JSON.stringify(value, null, 2) ?? "[]"
|
|
35040
|
+
);
|
|
35041
|
+
setCopiedJson(true);
|
|
35042
|
+
toast2({
|
|
35043
|
+
title: "JSON copied",
|
|
35044
|
+
description: "The JSON data has been successfully copied to your clipboard."
|
|
35045
|
+
});
|
|
35046
|
+
setTimeout(() => {
|
|
35047
|
+
setCopiedJson(false);
|
|
35048
|
+
}, 2e3);
|
|
35049
|
+
} catch (error) {
|
|
35050
|
+
toast2({
|
|
35051
|
+
title: "Error",
|
|
35052
|
+
description: `Failed to copy JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
35053
|
+
variant: "destructive"
|
|
35054
|
+
});
|
|
35055
|
+
}
|
|
35056
|
+
}, [toast2, value]);
|
|
35057
|
+
reactExports.useImperativeHandle(ref2, () => ({
|
|
35058
|
+
validateJson
|
|
35059
|
+
}));
|
|
35060
|
+
const renderFormFields = (propSchema, currentValue, path = [], depth = 0, parentSchema, propertyName) => {
|
|
35061
|
+
var _a, _b, _c;
|
|
35062
|
+
if (depth >= maxDepth && (propSchema.type === "object" || propSchema.type === "array")) {
|
|
35063
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35064
|
+
JsonEditor,
|
|
35065
|
+
{
|
|
35066
|
+
value: JSON.stringify(
|
|
35067
|
+
currentValue ?? generateDefaultValue(propSchema, propertyName, parentSchema),
|
|
35068
|
+
null,
|
|
35069
|
+
2
|
|
35070
|
+
),
|
|
35071
|
+
onChange: (newValue) => {
|
|
35072
|
+
try {
|
|
35073
|
+
const parsed = JSON.parse(newValue);
|
|
35074
|
+
handleFieldChange(path, parsed);
|
|
35075
|
+
setJsonError(void 0);
|
|
35076
|
+
} catch (err) {
|
|
35077
|
+
setJsonError(
|
|
35078
|
+
err instanceof Error ? err.message : "Invalid JSON"
|
|
35079
|
+
);
|
|
35080
|
+
}
|
|
35081
|
+
},
|
|
35082
|
+
error: jsonError
|
|
35083
|
+
}
|
|
35084
|
+
);
|
|
35085
|
+
}
|
|
35086
|
+
const isRequired = ((_a = parentSchema == null ? void 0 : parentSchema.required) == null ? void 0 : _a.includes(propertyName || "")) ?? false;
|
|
35087
|
+
let fieldType = propSchema.type;
|
|
35088
|
+
if (Array.isArray(fieldType)) {
|
|
35089
|
+
fieldType = fieldType.find((t) => t !== "null") ?? fieldType[0];
|
|
35090
|
+
}
|
|
35091
|
+
switch (fieldType) {
|
|
35092
|
+
case "string": {
|
|
35093
|
+
if (propSchema.oneOf && propSchema.oneOf.every(
|
|
35094
|
+
(option) => typeof option.const === "string" && typeof option.title === "string"
|
|
35095
|
+
)) {
|
|
35096
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
35097
|
+
"select",
|
|
35098
|
+
{
|
|
35099
|
+
value: currentValue ?? "",
|
|
35100
|
+
onChange: (e) => {
|
|
35101
|
+
const val = e.target.value;
|
|
35102
|
+
if (!val && !isRequired) {
|
|
35103
|
+
handleFieldChange(path, void 0);
|
|
35104
|
+
} else {
|
|
35105
|
+
handleFieldChange(path, val);
|
|
35106
|
+
}
|
|
35107
|
+
},
|
|
35108
|
+
required: isRequired,
|
|
35109
|
+
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",
|
|
35110
|
+
children: [
|
|
35111
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
|
|
35112
|
+
propSchema.oneOf.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35113
|
+
"option",
|
|
35114
|
+
{
|
|
35115
|
+
value: option.const,
|
|
35116
|
+
children: option.title
|
|
35117
|
+
},
|
|
35118
|
+
option.const
|
|
35119
|
+
))
|
|
35120
|
+
]
|
|
35121
|
+
}
|
|
35122
|
+
);
|
|
35123
|
+
}
|
|
35124
|
+
if (propSchema.enum) {
|
|
35125
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
35126
|
+
"select",
|
|
35127
|
+
{
|
|
35128
|
+
value: currentValue ?? "",
|
|
35129
|
+
onChange: (e) => {
|
|
35130
|
+
const val = e.target.value;
|
|
35131
|
+
if (!val && !isRequired) {
|
|
35132
|
+
handleFieldChange(path, void 0);
|
|
35133
|
+
} else {
|
|
35134
|
+
handleFieldChange(path, val);
|
|
35135
|
+
}
|
|
35136
|
+
},
|
|
35137
|
+
required: isRequired,
|
|
35138
|
+
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",
|
|
35139
|
+
children: [
|
|
35140
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
|
|
35141
|
+
propSchema.enum.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option }, option))
|
|
35142
|
+
]
|
|
35143
|
+
}
|
|
35144
|
+
);
|
|
35145
|
+
}
|
|
35146
|
+
let inputType = "text";
|
|
35147
|
+
switch (propSchema.format) {
|
|
35148
|
+
case "email":
|
|
35149
|
+
inputType = "email";
|
|
35150
|
+
break;
|
|
35151
|
+
case "uri":
|
|
35152
|
+
inputType = "url";
|
|
35153
|
+
break;
|
|
35154
|
+
case "date":
|
|
35155
|
+
inputType = "date";
|
|
35156
|
+
break;
|
|
35157
|
+
case "date-time":
|
|
35158
|
+
inputType = "datetime-local";
|
|
35159
|
+
break;
|
|
35160
|
+
default:
|
|
35161
|
+
inputType = "text";
|
|
35162
|
+
break;
|
|
35163
|
+
}
|
|
35164
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35165
|
+
Input,
|
|
35166
|
+
{
|
|
35167
|
+
type: inputType,
|
|
35168
|
+
value: currentValue ?? "",
|
|
35169
|
+
onChange: (e) => {
|
|
35170
|
+
const val = e.target.value;
|
|
35171
|
+
handleFieldChange(path, val);
|
|
35172
|
+
},
|
|
35173
|
+
placeholder: propSchema.description,
|
|
35174
|
+
required: isRequired,
|
|
35175
|
+
minLength: propSchema.minLength,
|
|
35176
|
+
maxLength: propSchema.maxLength,
|
|
35177
|
+
pattern: propSchema.pattern
|
|
34762
35178
|
}
|
|
34763
|
-
|
|
34764
|
-
error: jsonError
|
|
35179
|
+
);
|
|
34765
35180
|
}
|
|
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",
|
|
35181
|
+
case "number":
|
|
35182
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35183
|
+
Input,
|
|
34780
35184
|
{
|
|
34781
|
-
|
|
35185
|
+
type: "number",
|
|
35186
|
+
value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
|
|
34782
35187
|
onChange: (e) => {
|
|
34783
35188
|
const val = e.target.value;
|
|
34784
35189
|
if (!val && !isRequired) {
|
|
34785
35190
|
handleFieldChange(path, void 0);
|
|
34786
35191
|
} else {
|
|
34787
|
-
|
|
35192
|
+
const num = Number(val);
|
|
35193
|
+
if (!isNaN(num)) {
|
|
35194
|
+
handleFieldChange(path, num);
|
|
35195
|
+
}
|
|
34788
35196
|
}
|
|
34789
35197
|
},
|
|
35198
|
+
placeholder: propSchema.description,
|
|
34790
35199
|
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
|
-
]
|
|
35200
|
+
min: propSchema.minimum,
|
|
35201
|
+
max: propSchema.maximum
|
|
34803
35202
|
}
|
|
34804
35203
|
);
|
|
34805
|
-
|
|
34806
|
-
|
|
34807
|
-
|
|
34808
|
-
"select",
|
|
35204
|
+
case "integer":
|
|
35205
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35206
|
+
Input,
|
|
34809
35207
|
{
|
|
34810
|
-
|
|
35208
|
+
type: "number",
|
|
35209
|
+
step: "1",
|
|
35210
|
+
value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
|
|
34811
35211
|
onChange: (e) => {
|
|
34812
35212
|
const val = e.target.value;
|
|
34813
35213
|
if (!val && !isRequired) {
|
|
34814
35214
|
handleFieldChange(path, void 0);
|
|
34815
35215
|
} else {
|
|
34816
|
-
|
|
35216
|
+
const num = Number(val);
|
|
35217
|
+
if (!isNaN(num) && Number.isInteger(num)) {
|
|
35218
|
+
handleFieldChange(path, num);
|
|
35219
|
+
}
|
|
34817
35220
|
}
|
|
34818
35221
|
},
|
|
35222
|
+
placeholder: propSchema.description,
|
|
34819
35223
|
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
|
-
]
|
|
35224
|
+
min: propSchema.minimum,
|
|
35225
|
+
max: propSchema.maximum
|
|
34825
35226
|
}
|
|
34826
35227
|
);
|
|
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
|
-
}
|
|
35228
|
+
case "boolean":
|
|
35229
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35230
|
+
Input,
|
|
35231
|
+
{
|
|
35232
|
+
type: "checkbox",
|
|
35233
|
+
checked: currentValue ?? false,
|
|
35234
|
+
onChange: (e) => handleFieldChange(path, e.target.checked),
|
|
35235
|
+
className: "w-4 h-4",
|
|
35236
|
+
required: isRequired
|
|
35237
|
+
}
|
|
35238
|
+
);
|
|
35239
|
+
case "null":
|
|
35240
|
+
return null;
|
|
35241
|
+
case "object":
|
|
35242
|
+
if (!propSchema.properties) {
|
|
35243
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35244
|
+
JsonEditor,
|
|
35245
|
+
{
|
|
35246
|
+
value: JSON.stringify(currentValue ?? {}, null, 2),
|
|
35247
|
+
onChange: (newValue) => {
|
|
35248
|
+
try {
|
|
35249
|
+
const parsed = JSON.parse(newValue);
|
|
35250
|
+
handleFieldChange(path, parsed);
|
|
35251
|
+
setJsonError(void 0);
|
|
35252
|
+
} catch (err) {
|
|
35253
|
+
setJsonError(
|
|
35254
|
+
err instanceof Error ? err.message : "Invalid JSON"
|
|
35255
|
+
);
|
|
35256
|
+
}
|
|
35257
|
+
},
|
|
35258
|
+
error: jsonError
|
|
34902
35259
|
}
|
|
34903
|
-
|
|
34904
|
-
placeholder: propSchema.description,
|
|
34905
|
-
required: isRequired,
|
|
34906
|
-
min: propSchema.minimum,
|
|
34907
|
-
max: propSchema.maximum
|
|
35260
|
+
);
|
|
34908
35261
|
}
|
|
34909
|
-
|
|
34910
|
-
|
|
34911
|
-
|
|
34912
|
-
|
|
34913
|
-
|
|
34914
|
-
|
|
34915
|
-
|
|
34916
|
-
|
|
34917
|
-
|
|
34918
|
-
|
|
35262
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 border rounded p-3", children: Object.entries(propSchema.properties).map(([key, subSchema]) => {
|
|
35263
|
+
var _a2;
|
|
35264
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
35265
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium mb-1", children: [
|
|
35266
|
+
key,
|
|
35267
|
+
((_a2 = propSchema.required) == null ? void 0 : _a2.includes(key)) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
35268
|
+
] }),
|
|
35269
|
+
renderFormFields(
|
|
35270
|
+
subSchema,
|
|
35271
|
+
currentValue == null ? void 0 : currentValue[key],
|
|
35272
|
+
[...path, key],
|
|
35273
|
+
depth + 1,
|
|
35274
|
+
propSchema,
|
|
35275
|
+
key
|
|
35276
|
+
)
|
|
35277
|
+
] }, key);
|
|
35278
|
+
}) });
|
|
35279
|
+
case "array": {
|
|
35280
|
+
const arrayValue = Array.isArray(currentValue) ? currentValue : [];
|
|
35281
|
+
if (!propSchema.items) return null;
|
|
35282
|
+
if (isSimpleObject(propSchema.items)) {
|
|
35283
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
35284
|
+
propSchema.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: propSchema.description }),
|
|
35285
|
+
((_b = propSchema.items) == null ? void 0 : _b.description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
|
|
35286
|
+
"Items: ",
|
|
35287
|
+
propSchema.items.description
|
|
35288
|
+
] }),
|
|
35289
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
35290
|
+
arrayValue.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
35291
|
+
renderFormFields(
|
|
35292
|
+
propSchema.items,
|
|
35293
|
+
item,
|
|
35294
|
+
[...path, index2.toString()],
|
|
35295
|
+
depth + 1
|
|
35296
|
+
),
|
|
35297
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35298
|
+
Button,
|
|
35299
|
+
{
|
|
35300
|
+
variant: "outline",
|
|
35301
|
+
size: "sm",
|
|
35302
|
+
onClick: () => {
|
|
35303
|
+
const newArray = [...arrayValue];
|
|
35304
|
+
newArray.splice(index2, 1);
|
|
35305
|
+
handleFieldChange(path, newArray);
|
|
35306
|
+
},
|
|
35307
|
+
children: "Remove"
|
|
35308
|
+
}
|
|
35309
|
+
)
|
|
35310
|
+
] }, index2)),
|
|
35311
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35312
|
+
Button,
|
|
35313
|
+
{
|
|
35314
|
+
variant: "outline",
|
|
35315
|
+
size: "sm",
|
|
35316
|
+
onClick: () => {
|
|
35317
|
+
const defaultValue = getArrayItemDefault(
|
|
35318
|
+
propSchema.items
|
|
35319
|
+
);
|
|
35320
|
+
handleFieldChange(path, [...arrayValue, defaultValue]);
|
|
35321
|
+
},
|
|
35322
|
+
title: ((_c = propSchema.items) == null ? void 0 : _c.description) ? `Add new ${propSchema.items.description}` : "Add new item",
|
|
35323
|
+
children: "Add Item"
|
|
35324
|
+
}
|
|
35325
|
+
)
|
|
35326
|
+
] })
|
|
35327
|
+
] });
|
|
34919
35328
|
}
|
|
34920
|
-
);
|
|
34921
|
-
case "null":
|
|
34922
|
-
return null;
|
|
34923
|
-
case "object":
|
|
34924
|
-
if (!propSchema.properties) {
|
|
34925
35329
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34926
35330
|
JsonEditor,
|
|
34927
35331
|
{
|
|
34928
|
-
value: JSON.stringify(currentValue ??
|
|
35332
|
+
value: JSON.stringify(currentValue ?? [], null, 2),
|
|
34929
35333
|
onChange: (newValue) => {
|
|
34930
35334
|
try {
|
|
34931
35335
|
const parsed = JSON.parse(newValue);
|
|
@@ -34941,189 +35345,88 @@ const DynamicJsonForm = ({
|
|
|
34941
35345
|
}
|
|
34942
35346
|
);
|
|
34943
35347
|
}
|
|
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
|
-
);
|
|
35348
|
+
default:
|
|
35349
|
+
return null;
|
|
35350
|
+
}
|
|
35351
|
+
};
|
|
35352
|
+
const handleFieldChange = (path, fieldValue) => {
|
|
35353
|
+
if (path.length === 0) {
|
|
35354
|
+
onChange(fieldValue);
|
|
35355
|
+
return;
|
|
35029
35356
|
}
|
|
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
35357
|
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);
|
|
35358
|
+
const newValue = updateValueAtPath(value, path, fieldValue);
|
|
35359
|
+
onChange(newValue);
|
|
35067
35360
|
} catch (error) {
|
|
35068
|
-
|
|
35069
|
-
|
|
35070
|
-
description: `Failed to copy JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
35071
|
-
variant: "destructive"
|
|
35072
|
-
});
|
|
35361
|
+
console.error("Failed to update form value:", error);
|
|
35362
|
+
onChange(value);
|
|
35073
35363
|
}
|
|
35074
35364
|
};
|
|
35075
|
-
|
|
35076
|
-
|
|
35077
|
-
|
|
35078
|
-
|
|
35079
|
-
|
|
35080
|
-
|
|
35081
|
-
|
|
35082
|
-
|
|
35083
|
-
|
|
35084
|
-
|
|
35085
|
-
|
|
35086
|
-
|
|
35087
|
-
|
|
35088
|
-
|
|
35089
|
-
|
|
35090
|
-
|
|
35091
|
-
|
|
35092
|
-
|
|
35093
|
-
|
|
35365
|
+
const shouldUseJsonMode = schema.type === "object" && (!schema.properties || Object.keys(schema.properties).length === 0);
|
|
35366
|
+
reactExports.useEffect(() => {
|
|
35367
|
+
if (shouldUseJsonMode && !isJsonMode) {
|
|
35368
|
+
setIsJsonMode(true);
|
|
35369
|
+
}
|
|
35370
|
+
}, [shouldUseJsonMode, isJsonMode]);
|
|
35371
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
35372
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end space-x-2", children: [
|
|
35373
|
+
isJsonMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
35374
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
35375
|
+
Button,
|
|
35376
|
+
{
|
|
35377
|
+
type: "button",
|
|
35378
|
+
variant: "outline",
|
|
35379
|
+
size: "sm",
|
|
35380
|
+
onClick: handleCopyJson,
|
|
35381
|
+
children: [
|
|
35382
|
+
copiedJson ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "h-4 w-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-4 w-4 mr-2" }),
|
|
35383
|
+
"Copy JSON"
|
|
35384
|
+
]
|
|
35385
|
+
}
|
|
35386
|
+
),
|
|
35387
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35388
|
+
Button,
|
|
35389
|
+
{
|
|
35390
|
+
type: "button",
|
|
35391
|
+
variant: "outline",
|
|
35392
|
+
size: "sm",
|
|
35393
|
+
onClick: formatJson,
|
|
35394
|
+
children: "Format JSON"
|
|
35395
|
+
}
|
|
35396
|
+
)
|
|
35397
|
+
] }),
|
|
35398
|
+
!isOnlyJSON && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35094
35399
|
Button,
|
|
35095
35400
|
{
|
|
35096
|
-
type: "button",
|
|
35097
35401
|
variant: "outline",
|
|
35098
35402
|
size: "sm",
|
|
35099
|
-
onClick:
|
|
35100
|
-
children: "
|
|
35403
|
+
onClick: handleSwitchToFormMode,
|
|
35404
|
+
children: isJsonMode ? "Switch to Form" : "Switch to JSON"
|
|
35101
35405
|
}
|
|
35102
35406
|
)
|
|
35103
35407
|
] }),
|
|
35104
|
-
|
|
35105
|
-
|
|
35106
|
-
|
|
35107
|
-
|
|
35108
|
-
|
|
35109
|
-
|
|
35110
|
-
|
|
35111
|
-
|
|
35112
|
-
|
|
35113
|
-
}
|
|
35114
|
-
|
|
35115
|
-
|
|
35116
|
-
|
|
35117
|
-
|
|
35118
|
-
|
|
35119
|
-
|
|
35120
|
-
|
|
35121
|
-
|
|
35122
|
-
|
|
35123
|
-
|
|
35124
|
-
|
|
35125
|
-
|
|
35126
|
-
};
|
|
35408
|
+
isJsonMode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35409
|
+
JsonEditor,
|
|
35410
|
+
{
|
|
35411
|
+
value: rawJsonValue,
|
|
35412
|
+
onChange: (newValue) => {
|
|
35413
|
+
setRawJsonValue(newValue);
|
|
35414
|
+
debouncedUpdateParent(newValue);
|
|
35415
|
+
},
|
|
35416
|
+
error: jsonError
|
|
35417
|
+
}
|
|
35418
|
+
) : (
|
|
35419
|
+
// If schema type is object but value is not an object or is empty, and we have actual JSON data,
|
|
35420
|
+
// render a simple representation of the JSON data
|
|
35421
|
+
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: [
|
|
35422
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Form view not available for this JSON structure. Using simplified view:" }),
|
|
35423
|
+
/* @__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 }),
|
|
35424
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Use JSON mode for full editing capabilities." })
|
|
35425
|
+
] }) : renderFormFields(schema, value)
|
|
35426
|
+
)
|
|
35427
|
+
] });
|
|
35428
|
+
}
|
|
35429
|
+
);
|
|
35127
35430
|
const SamplingRequest = ({
|
|
35128
35431
|
onApprove,
|
|
35129
35432
|
request,
|
|
@@ -35158,7 +35461,7 @@ const SamplingRequest = ({
|
|
|
35158
35461
|
},
|
|
35159
35462
|
role: {
|
|
35160
35463
|
type: "string",
|
|
35161
|
-
default: "
|
|
35464
|
+
default: "assistant",
|
|
35162
35465
|
description: "Role of the model"
|
|
35163
35466
|
},
|
|
35164
35467
|
content: {
|
|
@@ -35314,7 +35617,7 @@ var Select$1 = (props) => {
|
|
|
35314
35617
|
defaultValue,
|
|
35315
35618
|
onValueChange,
|
|
35316
35619
|
dir,
|
|
35317
|
-
name,
|
|
35620
|
+
name: name2,
|
|
35318
35621
|
autoComplete,
|
|
35319
35622
|
disabled,
|
|
35320
35623
|
required: required2,
|
|
@@ -35384,7 +35687,7 @@ var Select$1 = (props) => {
|
|
|
35384
35687
|
"aria-hidden": true,
|
|
35385
35688
|
required: required2,
|
|
35386
35689
|
tabIndex: -1,
|
|
35387
|
-
name,
|
|
35690
|
+
name: name2,
|
|
35388
35691
|
autoComplete,
|
|
35389
35692
|
value,
|
|
35390
35693
|
onChange: (event) => setValue(event.target.value),
|
|
@@ -36578,7 +36881,7 @@ const useTheme = () => {
|
|
|
36578
36881
|
[theme, setThemeWithSideEffect]
|
|
36579
36882
|
);
|
|
36580
36883
|
};
|
|
36581
|
-
const version = "0.
|
|
36884
|
+
const version = "0.17.1";
|
|
36582
36885
|
var [createTooltipContext] = createContextScope("Tooltip", [
|
|
36583
36886
|
createPopperScope
|
|
36584
36887
|
]);
|
|
@@ -37084,7 +37387,7 @@ var Switch$1 = reactExports.forwardRef(
|
|
|
37084
37387
|
(props, forwardedRef) => {
|
|
37085
37388
|
const {
|
|
37086
37389
|
__scopeSwitch,
|
|
37087
|
-
name,
|
|
37390
|
+
name: name2,
|
|
37088
37391
|
checked: checkedProp,
|
|
37089
37392
|
defaultChecked,
|
|
37090
37393
|
required: required2,
|
|
@@ -37132,7 +37435,7 @@ var Switch$1 = reactExports.forwardRef(
|
|
|
37132
37435
|
{
|
|
37133
37436
|
control: button,
|
|
37134
37437
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
37135
|
-
name,
|
|
37438
|
+
name: name2,
|
|
37136
37439
|
value,
|
|
37137
37440
|
checked,
|
|
37138
37441
|
required: required2,
|
|
@@ -37299,8 +37602,8 @@ const CustomHeaders = ({
|
|
|
37299
37602
|
return;
|
|
37300
37603
|
}
|
|
37301
37604
|
const newHeaders = Object.entries(parsed).map(
|
|
37302
|
-
([
|
|
37303
|
-
name,
|
|
37605
|
+
([name2, value]) => ({
|
|
37606
|
+
name: name2,
|
|
37304
37607
|
value: String(value),
|
|
37305
37608
|
enabled: true
|
|
37306
37609
|
})
|
|
@@ -37465,6 +37768,8 @@ const Sidebar = ({
|
|
|
37465
37768
|
setCustomHeaders,
|
|
37466
37769
|
oauthClientId,
|
|
37467
37770
|
setOauthClientId,
|
|
37771
|
+
oauthClientSecret,
|
|
37772
|
+
setOauthClientSecret,
|
|
37468
37773
|
oauthScope,
|
|
37469
37774
|
setOauthScope,
|
|
37470
37775
|
onConnect,
|
|
@@ -37473,16 +37778,20 @@ const Sidebar = ({
|
|
|
37473
37778
|
sendLogLevelRequest,
|
|
37474
37779
|
loggingSupported,
|
|
37475
37780
|
config,
|
|
37476
|
-
setConfig
|
|
37781
|
+
setConfig,
|
|
37782
|
+
connectionType,
|
|
37783
|
+
setConnectionType
|
|
37477
37784
|
}) => {
|
|
37478
37785
|
const [theme, setTheme] = useTheme();
|
|
37479
37786
|
const [showEnvVars, setShowEnvVars] = reactExports.useState(false);
|
|
37480
37787
|
const [showAuthConfig, setShowAuthConfig] = reactExports.useState(false);
|
|
37481
37788
|
const [showConfig, setShowConfig] = reactExports.useState(false);
|
|
37482
37789
|
const [shownEnvVars, setShownEnvVars] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
37790
|
+
const [showClientSecret, setShowClientSecret] = reactExports.useState(false);
|
|
37483
37791
|
const [copiedServerEntry, setCopiedServerEntry] = reactExports.useState(false);
|
|
37484
37792
|
const [copiedServerFile, setCopiedServerFile] = reactExports.useState(false);
|
|
37485
37793
|
const { toast: toast2 } = useToast();
|
|
37794
|
+
const connectionTypeTip = "Connect to server directly (requires CORS config on server) or via MCP Inspector Proxy";
|
|
37486
37795
|
const reportError2 = reactExports.useCallback(
|
|
37487
37796
|
(error) => {
|
|
37488
37797
|
toast2({
|
|
@@ -37635,10 +37944,22 @@ const Sidebar = ({
|
|
|
37635
37944
|
}
|
|
37636
37945
|
)
|
|
37637
37946
|
] })
|
|
37638
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.
|
|
37639
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
37640
|
-
|
|
37641
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
37947
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
37948
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
37949
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", htmlFor: "sse-url-input", children: "URL" }),
|
|
37950
|
+
sseUrl ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
|
|
37951
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37952
|
+
Input,
|
|
37953
|
+
{
|
|
37954
|
+
id: "sse-url-input",
|
|
37955
|
+
placeholder: "URL",
|
|
37956
|
+
value: sseUrl,
|
|
37957
|
+
onChange: (e) => setSseUrl(e.target.value),
|
|
37958
|
+
className: "font-mono"
|
|
37959
|
+
}
|
|
37960
|
+
) }),
|
|
37961
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: sseUrl })
|
|
37962
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37642
37963
|
Input,
|
|
37643
37964
|
{
|
|
37644
37965
|
id: "sse-url-input",
|
|
@@ -37647,19 +37968,36 @@ const Sidebar = ({
|
|
|
37647
37968
|
onChange: (e) => setSseUrl(e.target.value),
|
|
37648
37969
|
className: "font-mono"
|
|
37649
37970
|
}
|
|
37650
|
-
)
|
|
37651
|
-
|
|
37652
|
-
|
|
37653
|
-
|
|
37654
|
-
|
|
37655
|
-
|
|
37656
|
-
|
|
37657
|
-
|
|
37658
|
-
|
|
37659
|
-
|
|
37660
|
-
|
|
37661
|
-
|
|
37662
|
-
|
|
37971
|
+
)
|
|
37972
|
+
] }),
|
|
37973
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
|
|
37974
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
37975
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37976
|
+
"label",
|
|
37977
|
+
{
|
|
37978
|
+
className: "text-sm font-medium",
|
|
37979
|
+
htmlFor: "connection-type-select",
|
|
37980
|
+
children: "Connection Type"
|
|
37981
|
+
}
|
|
37982
|
+
),
|
|
37983
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
37984
|
+
Select,
|
|
37985
|
+
{
|
|
37986
|
+
value: connectionType,
|
|
37987
|
+
onValueChange: (value) => setConnectionType(value),
|
|
37988
|
+
children: [
|
|
37989
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: "connection-type-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select connection type" }) }),
|
|
37990
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
37991
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "proxy", children: "Via Proxy" }),
|
|
37992
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "direct", children: "Direct" })
|
|
37993
|
+
] })
|
|
37994
|
+
]
|
|
37995
|
+
}
|
|
37996
|
+
)
|
|
37997
|
+
] }) }),
|
|
37998
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: connectionTypeTip })
|
|
37999
|
+
] })
|
|
38000
|
+
] }),
|
|
37663
38001
|
transportType === "stdio" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
37664
38002
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
37665
38003
|
Button,
|
|
@@ -37853,6 +38191,33 @@ const Sidebar = ({
|
|
|
37853
38191
|
className: "font-mono"
|
|
37854
38192
|
}
|
|
37855
38193
|
),
|
|
38194
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", children: "Client Secret" }),
|
|
38195
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
|
|
38196
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38197
|
+
Input,
|
|
38198
|
+
{
|
|
38199
|
+
type: showClientSecret ? "text" : "password",
|
|
38200
|
+
placeholder: "Client Secret (optional)",
|
|
38201
|
+
onChange: (e) => setOauthClientSecret(e.target.value),
|
|
38202
|
+
value: oauthClientSecret,
|
|
38203
|
+
"data-testid": "oauth-client-secret-input",
|
|
38204
|
+
className: "font-mono"
|
|
38205
|
+
}
|
|
38206
|
+
),
|
|
38207
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38208
|
+
Button,
|
|
38209
|
+
{
|
|
38210
|
+
variant: "outline",
|
|
38211
|
+
size: "icon",
|
|
38212
|
+
className: "h-9 w-9 p-0 shrink-0",
|
|
38213
|
+
onClick: () => setShowClientSecret(!showClientSecret),
|
|
38214
|
+
"aria-label": showClientSecret ? "Hide secret" : "Show secret",
|
|
38215
|
+
"aria-pressed": showClientSecret,
|
|
38216
|
+
title: showClientSecret ? "Hide secret" : "Show secret",
|
|
38217
|
+
children: showClientSecret ? /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(EyeOff, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
38218
|
+
}
|
|
38219
|
+
)
|
|
38220
|
+
] }),
|
|
37856
38221
|
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", children: "Redirect URL" }),
|
|
37857
38222
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37858
38223
|
Input,
|
|
@@ -38121,7 +38486,7 @@ function CheckboxProvider(props) {
|
|
|
38121
38486
|
defaultChecked,
|
|
38122
38487
|
disabled,
|
|
38123
38488
|
form,
|
|
38124
|
-
name,
|
|
38489
|
+
name: name2,
|
|
38125
38490
|
onCheckedChange,
|
|
38126
38491
|
required: required2,
|
|
38127
38492
|
value = "on",
|
|
@@ -38147,7 +38512,7 @@ function CheckboxProvider(props) {
|
|
|
38147
38512
|
setChecked,
|
|
38148
38513
|
control,
|
|
38149
38514
|
setControl,
|
|
38150
|
-
name,
|
|
38515
|
+
name: name2,
|
|
38151
38516
|
form,
|
|
38152
38517
|
value,
|
|
38153
38518
|
hasConsumerStoppedPropagationRef,
|
|
@@ -38223,7 +38588,7 @@ var Checkbox$1 = reactExports.forwardRef(
|
|
|
38223
38588
|
(props, forwardedRef) => {
|
|
38224
38589
|
const {
|
|
38225
38590
|
__scopeCheckbox,
|
|
38226
|
-
name,
|
|
38591
|
+
name: name2,
|
|
38227
38592
|
checked,
|
|
38228
38593
|
defaultChecked,
|
|
38229
38594
|
required: required2,
|
|
@@ -38242,7 +38607,7 @@ var Checkbox$1 = reactExports.forwardRef(
|
|
|
38242
38607
|
disabled,
|
|
38243
38608
|
required: required2,
|
|
38244
38609
|
onCheckedChange,
|
|
38245
|
-
name,
|
|
38610
|
+
name: name2,
|
|
38246
38611
|
form,
|
|
38247
38612
|
value,
|
|
38248
38613
|
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -38300,7 +38665,7 @@ var CheckboxBubbleInput = reactExports.forwardRef(
|
|
|
38300
38665
|
defaultChecked,
|
|
38301
38666
|
required: required2,
|
|
38302
38667
|
disabled,
|
|
38303
|
-
name,
|
|
38668
|
+
name: name2,
|
|
38304
38669
|
value,
|
|
38305
38670
|
form,
|
|
38306
38671
|
bubbleInput,
|
|
@@ -38335,7 +38700,7 @@ var CheckboxBubbleInput = reactExports.forwardRef(
|
|
|
38335
38700
|
defaultChecked: defaultChecked ?? defaultCheckedRef.current,
|
|
38336
38701
|
required: required2,
|
|
38337
38702
|
disabled,
|
|
38338
|
-
name,
|
|
38703
|
+
name: name2,
|
|
38339
38704
|
value,
|
|
38340
38705
|
form,
|
|
38341
38706
|
...props,
|
|
@@ -38389,7 +38754,7 @@ Checkbox.displayName = Checkbox$1.displayName;
|
|
|
38389
38754
|
const ResourceLinkView = reactExports.memo(
|
|
38390
38755
|
({
|
|
38391
38756
|
uri,
|
|
38392
|
-
name,
|
|
38757
|
+
name: name2,
|
|
38393
38758
|
description: description2,
|
|
38394
38759
|
mimeType,
|
|
38395
38760
|
resourceContent,
|
|
@@ -38444,7 +38809,7 @@ const ResourceLinkView = reactExports.memo(
|
|
|
38444
38809
|
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
38810
|
] })
|
|
38446
38811
|
] }),
|
|
38447
|
-
|
|
38812
|
+
name2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-sm text-gray-900 dark:text-gray-100 mb-1", children: name2 }),
|
|
38448
38813
|
description2 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-300 leading-relaxed", children: description2 })
|
|
38449
38814
|
] })
|
|
38450
38815
|
}
|
|
@@ -38626,6 +38991,7 @@ const ToolsTab = ({
|
|
|
38626
38991
|
setSelectedTool,
|
|
38627
38992
|
toolResult,
|
|
38628
38993
|
nextCursor,
|
|
38994
|
+
error,
|
|
38629
38995
|
resourceContent,
|
|
38630
38996
|
onReadResource
|
|
38631
38997
|
}) => {
|
|
@@ -38633,8 +38999,17 @@ const ToolsTab = ({
|
|
|
38633
38999
|
const [isToolRunning, setIsToolRunning] = reactExports.useState(false);
|
|
38634
39000
|
const [isOutputSchemaExpanded, setIsOutputSchemaExpanded] = reactExports.useState(false);
|
|
38635
39001
|
const [isMetaExpanded, setIsMetaExpanded] = reactExports.useState(false);
|
|
39002
|
+
const [hasValidationErrors, setHasValidationErrors] = reactExports.useState(false);
|
|
39003
|
+
const formRefs = reactExports.useRef({});
|
|
38636
39004
|
const { toast: toast2 } = useToast();
|
|
38637
39005
|
const { copied, setCopied } = useCopy();
|
|
39006
|
+
const checkValidationErrors = () => {
|
|
39007
|
+
const errors = Object.values(formRefs.current).some(
|
|
39008
|
+
(ref2) => ref2 && !ref2.validateJson().isValid
|
|
39009
|
+
);
|
|
39010
|
+
setHasValidationErrors(errors);
|
|
39011
|
+
return errors;
|
|
39012
|
+
};
|
|
38638
39013
|
reactExports.useEffect(() => {
|
|
38639
39014
|
const params2 = Object.entries(
|
|
38640
39015
|
(selectedTool == null ? void 0 : selectedTool.inputSchema.properties) ?? []
|
|
@@ -38647,6 +39022,8 @@ const ToolsTab = ({
|
|
|
38647
39022
|
)
|
|
38648
39023
|
]);
|
|
38649
39024
|
setParams(Object.fromEntries(params2));
|
|
39025
|
+
setHasValidationErrors(false);
|
|
39026
|
+
formRefs.current = {};
|
|
38650
39027
|
}, [selectedTool]);
|
|
38651
39028
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "tools", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
38652
39029
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -38661,7 +39038,7 @@ const ToolsTab = ({
|
|
|
38661
39038
|
setSelectedItem: setSelectedTool,
|
|
38662
39039
|
renderItem: (tool) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-start", children: [
|
|
38663
39040
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-1", children: tool.name }),
|
|
38664
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-500 text-left", children: tool.description })
|
|
39041
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-500 text-left line-clamp-3", children: tool.description })
|
|
38665
39042
|
] }),
|
|
38666
39043
|
title: "Tools",
|
|
38667
39044
|
buttonText: nextCursor ? "List More Tools" : "List Tools",
|
|
@@ -38671,110 +39048,202 @@ const ToolsTab = ({
|
|
|
38671
39048
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card border border-border rounded-lg shadow", children: [
|
|
38672
39049
|
/* @__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
39050
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: selectedTool ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
38674
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
39051
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
|
|
39052
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
39053
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
|
|
39054
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "break-all", children: error })
|
|
39055
|
+
] }),
|
|
39056
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400 whitespace-pre-wrap max-h-48 overflow-y-auto", children: selectedTool.description }),
|
|
38675
39057
|
Object.entries(selectedTool.inputSchema.properties ?? []).map(
|
|
38676
39058
|
([key, value]) => {
|
|
38677
39059
|
const prop = normalizeUnionType(value);
|
|
38678
39060
|
const inputSchema = selectedTool.inputSchema;
|
|
38679
39061
|
const required2 = isPropertyRequired(key, inputSchema);
|
|
38680
39062
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
38681
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
38682
|
-
|
|
38683
|
-
|
|
38684
|
-
htmlFor: key,
|
|
38685
|
-
className: "block text-sm font-medium text-gray-700 dark:text-gray-300",
|
|
38686
|
-
children: [
|
|
38687
|
-
key,
|
|
38688
|
-
required2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
38689
|
-
]
|
|
38690
|
-
}
|
|
38691
|
-
),
|
|
38692
|
-
prop.type === "boolean" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 mt-2", children: [
|
|
38693
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38694
|
-
Checkbox,
|
|
38695
|
-
{
|
|
38696
|
-
id: key,
|
|
38697
|
-
name: key,
|
|
38698
|
-
checked: !!params[key],
|
|
38699
|
-
onCheckedChange: (checked) => setParams({
|
|
38700
|
-
...params,
|
|
38701
|
-
[key]: checked
|
|
38702
|
-
})
|
|
38703
|
-
}
|
|
38704
|
-
),
|
|
38705
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38706
|
-
"label",
|
|
39063
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
|
39064
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
39065
|
+
Label$1,
|
|
38707
39066
|
{
|
|
38708
39067
|
htmlFor: key,
|
|
38709
|
-
className: "text-sm font-medium text-gray-700 dark:text-gray-300",
|
|
38710
|
-
children:
|
|
38711
|
-
|
|
38712
|
-
|
|
38713
|
-
|
|
38714
|
-
Textarea,
|
|
38715
|
-
{
|
|
38716
|
-
id: key,
|
|
38717
|
-
name: key,
|
|
38718
|
-
placeholder: prop.description,
|
|
38719
|
-
value: params[key] ?? "",
|
|
38720
|
-
onChange: (e) => setParams({
|
|
38721
|
-
...params,
|
|
38722
|
-
[key]: e.target.value === "" ? void 0 : e.target.value
|
|
38723
|
-
}),
|
|
38724
|
-
className: "mt-1"
|
|
38725
|
-
}
|
|
38726
|
-
) : prop.type === "object" || prop.type === "array" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38727
|
-
DynamicJsonForm,
|
|
38728
|
-
{
|
|
38729
|
-
schema: {
|
|
38730
|
-
type: prop.type,
|
|
38731
|
-
properties: prop.properties,
|
|
38732
|
-
description: prop.description,
|
|
38733
|
-
items: prop.items
|
|
38734
|
-
},
|
|
38735
|
-
value: params[key] ?? generateDefaultValue(prop),
|
|
38736
|
-
onChange: (newValue) => {
|
|
38737
|
-
setParams({
|
|
38738
|
-
...params,
|
|
38739
|
-
[key]: newValue
|
|
38740
|
-
});
|
|
39068
|
+
className: "block text-sm font-medium text-gray-700 dark:text-gray-300",
|
|
39069
|
+
children: [
|
|
39070
|
+
key,
|
|
39071
|
+
required2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
39072
|
+
]
|
|
38741
39073
|
}
|
|
38742
|
-
|
|
38743
|
-
|
|
38744
|
-
|
|
38745
|
-
|
|
38746
|
-
|
|
38747
|
-
|
|
38748
|
-
|
|
38749
|
-
|
|
38750
|
-
|
|
38751
|
-
|
|
38752
|
-
|
|
38753
|
-
|
|
38754
|
-
|
|
38755
|
-
|
|
38756
|
-
|
|
38757
|
-
|
|
38758
|
-
|
|
38759
|
-
|
|
38760
|
-
|
|
38761
|
-
|
|
39074
|
+
),
|
|
39075
|
+
prop.nullable ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
39076
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39077
|
+
Checkbox,
|
|
39078
|
+
{
|
|
39079
|
+
id: key,
|
|
39080
|
+
name: key,
|
|
39081
|
+
checked: params[key] === null,
|
|
39082
|
+
onCheckedChange: (checked) => setParams({
|
|
39083
|
+
...params,
|
|
39084
|
+
[key]: checked ? null : prop.default
|
|
39085
|
+
})
|
|
39086
|
+
}
|
|
39087
|
+
),
|
|
39088
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39089
|
+
"label",
|
|
39090
|
+
{
|
|
39091
|
+
htmlFor: key,
|
|
39092
|
+
className: "text-sm font-medium text-gray-700 dark:text-gray-300",
|
|
39093
|
+
children: "null"
|
|
39094
|
+
}
|
|
39095
|
+
)
|
|
39096
|
+
] }) : null
|
|
39097
|
+
] }),
|
|
39098
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39099
|
+
"div",
|
|
38762
39100
|
{
|
|
38763
|
-
|
|
38764
|
-
|
|
38765
|
-
|
|
38766
|
-
|
|
38767
|
-
|
|
38768
|
-
|
|
38769
|
-
|
|
38770
|
-
|
|
38771
|
-
|
|
38772
|
-
|
|
38773
|
-
|
|
38774
|
-
|
|
38775
|
-
|
|
39101
|
+
role: "toolinputwrapper",
|
|
39102
|
+
className: `${prop.nullable && params[key] === null ? "pointer-events-none opacity-50" : ""}`,
|
|
39103
|
+
children: prop.type === "boolean" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2 mt-2", children: [
|
|
39104
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39105
|
+
Checkbox,
|
|
39106
|
+
{
|
|
39107
|
+
id: key,
|
|
39108
|
+
name: key,
|
|
39109
|
+
checked: !!params[key],
|
|
39110
|
+
onCheckedChange: (checked) => setParams({
|
|
39111
|
+
...params,
|
|
39112
|
+
[key]: checked
|
|
39113
|
+
})
|
|
39114
|
+
}
|
|
39115
|
+
),
|
|
39116
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39117
|
+
"label",
|
|
39118
|
+
{
|
|
39119
|
+
htmlFor: key,
|
|
39120
|
+
className: "text-sm font-medium text-gray-700 dark:text-gray-300",
|
|
39121
|
+
children: prop.description || "Toggle this option"
|
|
39122
|
+
}
|
|
39123
|
+
)
|
|
39124
|
+
] }) : prop.type === "string" && prop.enum ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
39125
|
+
Select,
|
|
39126
|
+
{
|
|
39127
|
+
value: params[key] === void 0 ? "" : String(params[key]),
|
|
39128
|
+
onValueChange: (value2) => {
|
|
39129
|
+
if (value2 === "") {
|
|
39130
|
+
setParams({
|
|
39131
|
+
...params,
|
|
39132
|
+
[key]: void 0
|
|
39133
|
+
});
|
|
39134
|
+
} else {
|
|
39135
|
+
setParams({
|
|
39136
|
+
...params,
|
|
39137
|
+
[key]: value2
|
|
39138
|
+
});
|
|
39139
|
+
}
|
|
39140
|
+
},
|
|
39141
|
+
children: [
|
|
39142
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: key, className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39143
|
+
SelectValue,
|
|
39144
|
+
{
|
|
39145
|
+
placeholder: prop.description || "Select an option"
|
|
39146
|
+
}
|
|
39147
|
+
) }),
|
|
39148
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: prop.enum.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: option, children: option }, option)) })
|
|
39149
|
+
]
|
|
39150
|
+
}
|
|
39151
|
+
) : prop.type === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39152
|
+
Textarea,
|
|
39153
|
+
{
|
|
39154
|
+
id: key,
|
|
39155
|
+
name: key,
|
|
39156
|
+
placeholder: prop.description,
|
|
39157
|
+
value: params[key] === void 0 ? "" : String(params[key]),
|
|
39158
|
+
onChange: (e) => {
|
|
39159
|
+
const value2 = e.target.value;
|
|
39160
|
+
if (value2 === "") {
|
|
39161
|
+
setParams({
|
|
39162
|
+
...params,
|
|
39163
|
+
[key]: void 0
|
|
39164
|
+
});
|
|
39165
|
+
} else {
|
|
39166
|
+
setParams({
|
|
39167
|
+
...params,
|
|
39168
|
+
[key]: value2
|
|
39169
|
+
});
|
|
39170
|
+
}
|
|
39171
|
+
},
|
|
39172
|
+
className: "mt-1"
|
|
39173
|
+
}
|
|
39174
|
+
) : prop.type === "object" || prop.type === "array" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39175
|
+
DynamicJsonForm,
|
|
39176
|
+
{
|
|
39177
|
+
ref: (ref2) => formRefs.current[key] = ref2,
|
|
39178
|
+
schema: {
|
|
39179
|
+
type: prop.type,
|
|
39180
|
+
properties: prop.properties,
|
|
39181
|
+
description: prop.description,
|
|
39182
|
+
items: prop.items
|
|
39183
|
+
},
|
|
39184
|
+
value: params[key] ?? generateDefaultValue(prop),
|
|
39185
|
+
onChange: (newValue) => {
|
|
39186
|
+
setParams({
|
|
39187
|
+
...params,
|
|
39188
|
+
[key]: newValue
|
|
39189
|
+
});
|
|
39190
|
+
setTimeout(checkValidationErrors, 100);
|
|
39191
|
+
}
|
|
39192
|
+
}
|
|
39193
|
+
) }) : prop.type === "number" || prop.type === "integer" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39194
|
+
Input,
|
|
39195
|
+
{
|
|
39196
|
+
type: "number",
|
|
39197
|
+
id: key,
|
|
39198
|
+
name: key,
|
|
39199
|
+
placeholder: prop.description,
|
|
39200
|
+
value: params[key] === void 0 ? "" : String(params[key]),
|
|
39201
|
+
onChange: (e) => {
|
|
39202
|
+
const value2 = e.target.value;
|
|
39203
|
+
if (value2 === "") {
|
|
39204
|
+
setParams({
|
|
39205
|
+
...params,
|
|
39206
|
+
[key]: void 0
|
|
39207
|
+
});
|
|
39208
|
+
} else {
|
|
39209
|
+
const num = Number(value2);
|
|
39210
|
+
if (!isNaN(num)) {
|
|
39211
|
+
setParams({
|
|
39212
|
+
...params,
|
|
39213
|
+
[key]: num
|
|
39214
|
+
});
|
|
39215
|
+
} else {
|
|
39216
|
+
setParams({
|
|
39217
|
+
...params,
|
|
39218
|
+
[key]: value2
|
|
39219
|
+
});
|
|
39220
|
+
}
|
|
39221
|
+
}
|
|
39222
|
+
},
|
|
39223
|
+
className: "mt-1"
|
|
39224
|
+
}
|
|
39225
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39226
|
+
DynamicJsonForm,
|
|
39227
|
+
{
|
|
39228
|
+
ref: (ref2) => formRefs.current[key] = ref2,
|
|
39229
|
+
schema: {
|
|
39230
|
+
type: prop.type,
|
|
39231
|
+
properties: prop.properties,
|
|
39232
|
+
description: prop.description,
|
|
39233
|
+
items: prop.items
|
|
39234
|
+
},
|
|
39235
|
+
value: params[key],
|
|
39236
|
+
onChange: (newValue) => {
|
|
39237
|
+
setParams({
|
|
39238
|
+
...params,
|
|
39239
|
+
[key]: newValue
|
|
39240
|
+
});
|
|
39241
|
+
setTimeout(checkValidationErrors, 100);
|
|
39242
|
+
}
|
|
39243
|
+
}
|
|
39244
|
+
) })
|
|
38776
39245
|
}
|
|
38777
|
-
)
|
|
39246
|
+
)
|
|
38778
39247
|
] }, key);
|
|
38779
39248
|
}
|
|
38780
39249
|
),
|
|
@@ -38839,6 +39308,7 @@ const ToolsTab = ({
|
|
|
38839
39308
|
Button,
|
|
38840
39309
|
{
|
|
38841
39310
|
onClick: async () => {
|
|
39311
|
+
if (checkValidationErrors()) return;
|
|
38842
39312
|
try {
|
|
38843
39313
|
setIsToolRunning(true);
|
|
38844
39314
|
await callTool(selectedTool.name, params);
|
|
@@ -38846,7 +39316,7 @@ const ToolsTab = ({
|
|
|
38846
39316
|
setIsToolRunning(false);
|
|
38847
39317
|
}
|
|
38848
39318
|
},
|
|
38849
|
-
disabled: isToolRunning,
|
|
39319
|
+
disabled: isToolRunning || hasValidationErrors,
|
|
38850
39320
|
children: isToolRunning ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
38851
39321
|
/* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-4 h-4 mr-2 animate-spin" }),
|
|
38852
39322
|
"Running..."
|
|
@@ -38865,10 +39335,10 @@ const ToolsTab = ({
|
|
|
38865
39335
|
JSON.stringify(params, null, 2)
|
|
38866
39336
|
);
|
|
38867
39337
|
setCopied(true);
|
|
38868
|
-
} catch (
|
|
39338
|
+
} catch (error2) {
|
|
38869
39339
|
toast2({
|
|
38870
39340
|
title: "Error",
|
|
38871
|
-
description: `There was an error copying input to the clipboard: ${
|
|
39341
|
+
description: `There was an error copying input to the clipboard: ${error2 instanceof Error ? error2.message : String(error2)}`,
|
|
38872
39342
|
variant: "destructive"
|
|
38873
39343
|
});
|
|
38874
39344
|
}
|
|
@@ -39050,6 +39520,11 @@ const App = () => {
|
|
|
39050
39520
|
const [args, setArgs] = reactExports.useState(getInitialArgs);
|
|
39051
39521
|
const [sseUrl, setSseUrl] = reactExports.useState(getInitialSseUrl);
|
|
39052
39522
|
const [transportType, setTransportType] = reactExports.useState(getInitialTransportType);
|
|
39523
|
+
const [connectionType, setConnectionType] = reactExports.useState(
|
|
39524
|
+
() => {
|
|
39525
|
+
return localStorage.getItem("lastConnectionType") || "proxy";
|
|
39526
|
+
}
|
|
39527
|
+
);
|
|
39053
39528
|
const [logLevel, setLogLevel] = reactExports.useState("debug");
|
|
39054
39529
|
const [notifications, setNotifications] = reactExports.useState([]);
|
|
39055
39530
|
const [roots, setRoots] = reactExports.useState([]);
|
|
@@ -39069,6 +39544,9 @@ const App = () => {
|
|
|
39069
39544
|
const [oauthScope, setOauthScope] = reactExports.useState(() => {
|
|
39070
39545
|
return localStorage.getItem("lastOauthScope") || "";
|
|
39071
39546
|
});
|
|
39547
|
+
const [oauthClientSecret, setOauthClientSecret] = reactExports.useState(() => {
|
|
39548
|
+
return localStorage.getItem("lastOauthClientSecret") || "";
|
|
39549
|
+
});
|
|
39072
39550
|
const [customHeaders, setCustomHeaders] = reactExports.useState(() => {
|
|
39073
39551
|
const savedHeaders = localStorage.getItem("lastCustomHeaders");
|
|
39074
39552
|
if (savedHeaders) {
|
|
@@ -39090,7 +39568,7 @@ const App = () => {
|
|
|
39090
39568
|
{
|
|
39091
39569
|
name: "Authorization",
|
|
39092
39570
|
value: "Bearer ",
|
|
39093
|
-
enabled:
|
|
39571
|
+
enabled: false
|
|
39094
39572
|
}
|
|
39095
39573
|
];
|
|
39096
39574
|
});
|
|
@@ -39150,8 +39628,10 @@ const App = () => {
|
|
|
39150
39628
|
env,
|
|
39151
39629
|
customHeaders,
|
|
39152
39630
|
oauthClientId,
|
|
39631
|
+
oauthClientSecret,
|
|
39153
39632
|
oauthScope,
|
|
39154
39633
|
config,
|
|
39634
|
+
connectionType,
|
|
39155
39635
|
onNotification: (notification) => {
|
|
39156
39636
|
setNotifications((prev) => [...prev, notification]);
|
|
39157
39637
|
},
|
|
@@ -39218,6 +39698,9 @@ const App = () => {
|
|
|
39218
39698
|
reactExports.useEffect(() => {
|
|
39219
39699
|
localStorage.setItem("lastTransportType", transportType);
|
|
39220
39700
|
}, [transportType]);
|
|
39701
|
+
reactExports.useEffect(() => {
|
|
39702
|
+
localStorage.setItem("lastConnectionType", connectionType);
|
|
39703
|
+
}, [connectionType]);
|
|
39221
39704
|
reactExports.useEffect(() => {
|
|
39222
39705
|
if (bearerToken) {
|
|
39223
39706
|
localStorage.setItem("lastBearerToken", bearerToken);
|
|
@@ -39251,6 +39734,9 @@ const App = () => {
|
|
|
39251
39734
|
reactExports.useEffect(() => {
|
|
39252
39735
|
localStorage.setItem("lastOauthScope", oauthScope);
|
|
39253
39736
|
}, [oauthScope]);
|
|
39737
|
+
reactExports.useEffect(() => {
|
|
39738
|
+
localStorage.setItem("lastOauthClientSecret", oauthClientSecret);
|
|
39739
|
+
}, [oauthClientSecret]);
|
|
39254
39740
|
reactExports.useEffect(() => {
|
|
39255
39741
|
saveInspectorConfig(CONFIG_LOCAL_STORAGE_KEY, config);
|
|
39256
39742
|
}, [config]);
|
|
@@ -39485,12 +39971,12 @@ const App = () => {
|
|
|
39485
39971
|
);
|
|
39486
39972
|
setNextResourceTemplateCursor(response.nextCursor);
|
|
39487
39973
|
};
|
|
39488
|
-
const getPrompt = async (
|
|
39974
|
+
const getPrompt = async (name2, args2 = {}) => {
|
|
39489
39975
|
lastToolCallOriginTabRef.current = currentTabRef.current;
|
|
39490
39976
|
const response = await sendMCPRequest(
|
|
39491
39977
|
{
|
|
39492
39978
|
method: "prompts/get",
|
|
39493
|
-
params: { name, arguments: args2 }
|
|
39979
|
+
params: { name: name2, arguments: args2 }
|
|
39494
39980
|
},
|
|
39495
39981
|
GetPromptResultSchema,
|
|
39496
39982
|
"prompts"
|
|
@@ -39569,15 +40055,17 @@ const App = () => {
|
|
|
39569
40055
|
setNextToolCursor(response.nextCursor);
|
|
39570
40056
|
cacheToolOutputSchemas(response.tools);
|
|
39571
40057
|
};
|
|
39572
|
-
const callTool = async (
|
|
40058
|
+
const callTool = async (name2, params) => {
|
|
39573
40059
|
lastToolCallOriginTabRef.current = currentTabRef.current;
|
|
39574
40060
|
try {
|
|
40061
|
+
const tool = tools.find((t) => t.name === name2);
|
|
40062
|
+
const cleanedParams = (tool == null ? void 0 : tool.inputSchema) ? cleanParams(params, tool.inputSchema) : params;
|
|
39575
40063
|
const response = await sendMCPRequest(
|
|
39576
40064
|
{
|
|
39577
40065
|
method: "tools/call",
|
|
39578
40066
|
params: {
|
|
39579
|
-
name,
|
|
39580
|
-
arguments:
|
|
40067
|
+
name: name2,
|
|
40068
|
+
arguments: cleanedParams,
|
|
39581
40069
|
_meta: {
|
|
39582
40070
|
progressToken: progressTokenRef.current++
|
|
39583
40071
|
}
|
|
@@ -39587,6 +40075,7 @@ const App = () => {
|
|
|
39587
40075
|
"tools"
|
|
39588
40076
|
);
|
|
39589
40077
|
setToolResult(response);
|
|
40078
|
+
setErrors((prev) => ({ ...prev, tools: null }));
|
|
39590
40079
|
} catch (e) {
|
|
39591
40080
|
const toolResult2 = {
|
|
39592
40081
|
content: [
|
|
@@ -39598,6 +40087,7 @@ const App = () => {
|
|
|
39598
40087
|
isError: true
|
|
39599
40088
|
};
|
|
39600
40089
|
setToolResult(toolResult2);
|
|
40090
|
+
setErrors((prev) => ({ ...prev, tools: null }));
|
|
39601
40091
|
}
|
|
39602
40092
|
};
|
|
39603
40093
|
const handleRootsChange = async () => {
|
|
@@ -39627,13 +40117,13 @@ const App = () => {
|
|
|
39627
40117
|
) });
|
|
39628
40118
|
if (window.location.pathname === "/oauth/callback") {
|
|
39629
40119
|
const OAuthCallback = React.lazy(
|
|
39630
|
-
() => __vitePreload(() => import("./OAuthCallback-
|
|
40120
|
+
() => __vitePreload(() => import("./OAuthCallback-0GeGMxax.js"), true ? [] : void 0)
|
|
39631
40121
|
);
|
|
39632
40122
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
|
|
39633
40123
|
}
|
|
39634
40124
|
if (window.location.pathname === "/oauth/callback/debug") {
|
|
39635
40125
|
const OAuthDebugCallback = React.lazy(
|
|
39636
|
-
() => __vitePreload(() => import("./OAuthDebugCallback-
|
|
40126
|
+
() => __vitePreload(() => import("./OAuthDebugCallback-DEQBSYMe.js"), true ? [] : void 0)
|
|
39637
40127
|
);
|
|
39638
40128
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
|
|
39639
40129
|
}
|
|
@@ -39669,13 +40159,17 @@ const App = () => {
|
|
|
39669
40159
|
setCustomHeaders,
|
|
39670
40160
|
oauthClientId,
|
|
39671
40161
|
setOauthClientId,
|
|
40162
|
+
oauthClientSecret,
|
|
40163
|
+
setOauthClientSecret,
|
|
39672
40164
|
oauthScope,
|
|
39673
40165
|
setOauthScope,
|
|
39674
40166
|
onConnect: connectMcpServer,
|
|
39675
40167
|
onDisconnect: disconnectMcpServer,
|
|
39676
40168
|
logLevel,
|
|
39677
40169
|
sendLogLevelRequest,
|
|
39678
|
-
loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false
|
|
40170
|
+
loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false,
|
|
40171
|
+
connectionType,
|
|
40172
|
+
setConnectionType
|
|
39679
40173
|
}
|
|
39680
40174
|
),
|
|
39681
40175
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -39843,9 +40337,9 @@ const App = () => {
|
|
|
39843
40337
|
setPrompts([]);
|
|
39844
40338
|
setNextPromptCursor(void 0);
|
|
39845
40339
|
},
|
|
39846
|
-
getPrompt: (
|
|
40340
|
+
getPrompt: (name2, args2) => {
|
|
39847
40341
|
clearError("prompts");
|
|
39848
|
-
getPrompt(
|
|
40342
|
+
getPrompt(name2, args2);
|
|
39849
40343
|
},
|
|
39850
40344
|
selectedPrompt,
|
|
39851
40345
|
setSelectedPrompt: (prompt) => {
|
|
@@ -39873,10 +40367,10 @@ const App = () => {
|
|
|
39873
40367
|
setNextToolCursor(void 0);
|
|
39874
40368
|
cacheToolOutputSchemas([]);
|
|
39875
40369
|
},
|
|
39876
|
-
callTool: async (
|
|
40370
|
+
callTool: async (name2, params) => {
|
|
39877
40371
|
clearError("tools");
|
|
39878
40372
|
setToolResult(null);
|
|
39879
|
-
await callTool(
|
|
40373
|
+
await callTool(name2, params);
|
|
39880
40374
|
},
|
|
39881
40375
|
selectedTool,
|
|
39882
40376
|
setSelectedTool: (tool) => {
|