@modelcontextprotocol/inspector-client 1.0.3 → 1.0.5

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.
@@ -1,4 +1,4 @@
1
- import { u as useToast, r as reactExports, c as clearOAuthConnectionSnapshot, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-C2CDzlVy.js";
1
+ import { u as useToast, r as reactExports, c as clearOAuthConnectionSnapshot, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-BA98C07j.js";
2
2
  const OAuthCallback = ({ onConnect }) => {
3
3
  const { toast } = useToast();
4
4
  const hasProcessedRef = reactExports.useRef(false);
@@ -1,4 +1,4 @@
1
- import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-C2CDzlVy.js";
1
+ import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-BA98C07j.js";
2
2
  const OAuthDebugCallback = ({ onConnect }) => {
3
3
  reactExports.useEffect(() => {
4
4
  let isProcessed = false;
@@ -12400,7 +12400,7 @@ function esc(str) {
12400
12400
  }
12401
12401
  const captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {
12402
12402
  };
12403
- function isObject(data2) {
12403
+ function isObject$1(data2) {
12404
12404
  return typeof data2 === "object" && data2 !== null && !Array.isArray(data2);
12405
12405
  }
12406
12406
  const allowsEval = cached(() => {
@@ -12416,13 +12416,13 @@ const allowsEval = cached(() => {
12416
12416
  }
12417
12417
  });
12418
12418
  function isPlainObject$2(o2) {
12419
- if (isObject(o2) === false)
12419
+ if (isObject$1(o2) === false)
12420
12420
  return false;
12421
12421
  const ctor = o2.constructor;
12422
12422
  if (ctor === void 0)
12423
12423
  return true;
12424
12424
  const prot = ctor.prototype;
12425
- if (isObject(prot) === false)
12425
+ if (isObject$1(prot) === false)
12426
12426
  return false;
12427
12427
  if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
12428
12428
  return false;
@@ -13877,7 +13877,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
13877
13877
  return (payload, ctx) => fn2(shape, payload, ctx);
13878
13878
  };
13879
13879
  let fastpass;
13880
- const isObject$1 = isObject;
13880
+ const isObject2 = isObject$1;
13881
13881
  const jit = !globalConfig.jitless;
13882
13882
  const allowsEval$1 = allowsEval;
13883
13883
  const fastEnabled = jit && allowsEval$1.value;
@@ -13886,7 +13886,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
13886
13886
  inst._zod.parse = (payload, ctx) => {
13887
13887
  value ?? (value = _normalized.value);
13888
13888
  const input = payload.value;
13889
- if (!isObject$1(input)) {
13889
+ if (!isObject2(input)) {
13890
13890
  payload.issues.push({
13891
13891
  expected: "object",
13892
13892
  code: "invalid_type",
@@ -14045,7 +14045,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
14045
14045
  });
14046
14046
  inst._zod.parse = (payload, ctx) => {
14047
14047
  const input = payload.value;
14048
- if (!isObject(input)) {
14048
+ if (!isObject$1(input)) {
14049
14049
  payload.issues.push({
14050
14050
  code: "invalid_type",
14051
14051
  expected: "object",
@@ -17366,7 +17366,7 @@ object({
17366
17366
  token_type_hint: string().optional()
17367
17367
  }).strip();
17368
17368
  const name = "@modelcontextprotocol/inspector-client";
17369
- const version$1 = "1.0.3";
17369
+ const version$1 = "1.0.5";
17370
17370
  const packageJson = {
17371
17371
  name,
17372
17372
  version: version$1
@@ -29909,15 +29909,348 @@ function requireAjv$2() {
29909
29909
  }
29910
29910
  var ajvExports$1 = requireAjv$2();
29911
29911
  const Ajv$1 = /* @__PURE__ */ getDefaultExportFromCjs(ajvExports$1);
29912
+ const SCHEMA_KEYWORDS = [
29913
+ "additionalProperties",
29914
+ "additionalItems",
29915
+ "contains",
29916
+ "propertyNames",
29917
+ "if",
29918
+ "then",
29919
+ "else",
29920
+ "not",
29921
+ "unevaluatedItems",
29922
+ "unevaluatedProperties"
29923
+ ];
29924
+ const SCHEMA_ARRAY_KEYWORDS = ["allOf", "anyOf", "oneOf", "prefixItems"];
29925
+ const SCHEMA_MAP_KEYWORDS = [
29926
+ "properties",
29927
+ "patternProperties",
29928
+ "$defs",
29929
+ "definitions",
29930
+ "dependentSchemas",
29931
+ "dependencies"
29932
+ ];
29933
+ const HOLDING_PREFIX = "__inspector_unevaluated_";
29934
+ const IDENTIFIER_KEYWORDS = [
29935
+ "$id",
29936
+ "id",
29937
+ "$anchor",
29938
+ "$dynamicAnchor",
29939
+ "$recursiveAnchor"
29940
+ ];
29941
+ function isObject(value) {
29942
+ return typeof value === "object" && value !== null && !Array.isArray(value);
29943
+ }
29944
+ function isSchema(value) {
29945
+ return isObject(value) || typeof value === "boolean";
29946
+ }
29947
+ const relKey = (rel) => rel.length === 1 ? rel[0] : `${rel[0]}\0${rel[1]}`;
29948
+ function childRels(node) {
29949
+ const rels = [];
29950
+ for (const key of SCHEMA_KEYWORDS) {
29951
+ if (isSchema(node[key])) rels.push([key]);
29952
+ }
29953
+ for (const key of SCHEMA_ARRAY_KEYWORDS) {
29954
+ const value = node[key];
29955
+ if (Array.isArray(value)) {
29956
+ value.forEach((sub, i2) => {
29957
+ if (isSchema(sub)) rels.push([key, String(i2)]);
29958
+ });
29959
+ }
29960
+ }
29961
+ for (const key of SCHEMA_MAP_KEYWORDS) {
29962
+ const value = node[key];
29963
+ if (isObject(value)) {
29964
+ for (const [name2, sub] of Object.entries(value)) {
29965
+ if (isSchema(sub)) rels.push([key, name2]);
29966
+ }
29967
+ }
29968
+ }
29969
+ if (Array.isArray(node.items)) {
29970
+ node.items.forEach((sub, i2) => {
29971
+ if (isSchema(sub)) rels.push(["items", String(i2)]);
29972
+ });
29973
+ } else if (isSchema(node.items)) {
29974
+ rels.push(["items"]);
29975
+ }
29976
+ return rels;
29977
+ }
29978
+ function getAt(node, rel) {
29979
+ const value = node[rel[0]];
29980
+ return rel.length === 1 ? value : value[rel[1]];
29981
+ }
29982
+ function parseLocalRef(ref2) {
29983
+ if (ref2 === "#") return [];
29984
+ if (!ref2.startsWith("#/")) return null;
29985
+ if (/%2f|%00/i.test(ref2) || ref2.includes("\0")) return null;
29986
+ try {
29987
+ return ref2.slice(2).split("/").map(
29988
+ (part) => decodeURIComponent(part).replace(/~1/g, "/").replace(/~0/g, "~")
29989
+ );
29990
+ } catch {
29991
+ return null;
29992
+ }
29993
+ }
29994
+ const formatSegment = (part) => "/" + encodeURIComponent(part.replace(/~/g, "~0").replace(/\//g, "~1"));
29995
+ const DYNAMIC_REF_KEYWORDS = ["$dynamicRef", "$recursiveRef"];
29996
+ function stripSchemaPatterns(schema) {
29997
+ const positions = [];
29998
+ const rawRefs = [];
29999
+ let hasIdentifier = false;
30000
+ const analyze = (node, parent) => {
30001
+ const id2 = positions.length;
30002
+ const position = {
30003
+ node,
30004
+ parent,
30005
+ children: /* @__PURE__ */ new Map(),
30006
+ direct: false,
30007
+ dynamic: false
30008
+ };
30009
+ positions.push(position);
30010
+ if (!isObject(node)) return id2;
30011
+ if (IDENTIFIER_KEYWORDS.some((key) => key in node)) hasIdentifier = true;
30012
+ if (typeof node.pattern === "string") position.direct = true;
30013
+ if (isObject(node.patternProperties) && Object.keys(node.patternProperties).length > 0) {
30014
+ position.direct = true;
30015
+ }
30016
+ if (typeof node.$ref === "string") rawRefs.push([id2, node.$ref]);
30017
+ if (DYNAMIC_REF_KEYWORDS.some((key) => key in node)) {
30018
+ position.dynamic = true;
30019
+ }
30020
+ for (const rel of childRels(node)) {
30021
+ position.children.set(relKey(rel), analyze(getAt(node, rel), id2));
30022
+ }
30023
+ return id2;
30024
+ };
30025
+ analyze(schema, -1);
30026
+ const resolve2 = (segments) => {
30027
+ let current = 0;
30028
+ for (let i2 = 0; i2 < segments.length; ) {
30029
+ const { children } = positions[current];
30030
+ const single = children.get(segments[i2]);
30031
+ if (single !== void 0) {
30032
+ current = single;
30033
+ i2 += 1;
30034
+ continue;
30035
+ }
30036
+ if (i2 + 1 >= segments.length) return null;
30037
+ const pair = children.get(`${segments[i2]}\0${segments[i2 + 1]}`);
30038
+ if (pair === void 0) return null;
30039
+ current = pair;
30040
+ i2 += 2;
30041
+ }
30042
+ return current;
30043
+ };
30044
+ const referrers = /* @__PURE__ */ new Map();
30045
+ for (const [id2, ref2] of rawRefs) {
30046
+ const segments = parseLocalRef(ref2);
30047
+ const target = segments === null ? null : resolve2(segments);
30048
+ positions[id2].ref = target;
30049
+ if (target !== null) {
30050
+ const list = referrers.get(target) ?? [];
30051
+ list.push(id2);
30052
+ referrers.set(target, list);
30053
+ }
30054
+ }
30055
+ const tainted = new Uint8Array(positions.length);
30056
+ const work = [];
30057
+ const taint = (id2) => {
30058
+ if (id2 < 0 || tainted[id2]) return;
30059
+ tainted[id2] = 1;
30060
+ work.push(id2);
30061
+ };
30062
+ positions.forEach((position, id2) => {
30063
+ if (position.direct || position.dynamic || position.ref === null) {
30064
+ taint(id2);
30065
+ }
30066
+ });
30067
+ while (work.length > 0) {
30068
+ const id2 = work.pop();
30069
+ taint(positions[id2].parent);
30070
+ for (const referrer of referrers.get(id2) ?? []) taint(referrer);
30071
+ }
30072
+ let stripped = 0;
30073
+ let skipped = 0;
30074
+ const outParent = new Int32Array(positions.length).fill(-2);
30075
+ const outRel = new Array(positions.length);
30076
+ const refSites = [];
30077
+ const holding = [];
30078
+ const root = isObject(schema) ? schema : void 0;
30079
+ const takenNames = new Set(
30080
+ isObject(root?.definitions) ? Object.keys(root.definitions) : []
30081
+ );
30082
+ let nextName = 0;
30083
+ const emit = (id2) => {
30084
+ const { node, children } = positions[id2];
30085
+ if (!isObject(node)) return node;
30086
+ const childOf = (rel) => children.get(relKey(rel));
30087
+ const relocate = (rel) => holding.push(childOf(rel));
30088
+ if (positions[id2].ref === null) {
30089
+ childRels(node).forEach(relocate);
30090
+ skipped++;
30091
+ return {};
30092
+ }
30093
+ const copy = { ...node };
30094
+ const isTainted = (rel) => tainted[childOf(rel)] === 1;
30095
+ if (typeof copy.pattern === "string") {
30096
+ delete copy.pattern;
30097
+ stripped++;
30098
+ }
30099
+ if (isObject(copy.patternProperties) && Object.keys(copy.patternProperties).length > 0) {
30100
+ for (const name2 of Object.keys(copy.patternProperties)) {
30101
+ if (isSchema(copy.patternProperties[name2])) {
30102
+ relocate(["patternProperties", name2]);
30103
+ }
30104
+ stripped++;
30105
+ }
30106
+ delete copy.patternProperties;
30107
+ if ("additionalProperties" in copy) {
30108
+ if (isSchema(copy.additionalProperties)) {
30109
+ relocate(["additionalProperties"]);
30110
+ }
30111
+ delete copy.additionalProperties;
30112
+ skipped++;
30113
+ }
30114
+ }
30115
+ const dropIfTainted = (keyword2, alsoDrop = []) => {
30116
+ if (!(keyword2 in copy)) return;
30117
+ const rels = childRels({ [keyword2]: copy[keyword2] });
30118
+ if (!rels.some(isTainted)) return;
30119
+ rels.forEach(relocate);
30120
+ delete copy[keyword2];
30121
+ for (const extra of alsoDrop) delete copy[extra];
30122
+ skipped++;
30123
+ };
30124
+ dropIfTainted("not");
30125
+ dropIfTainted("oneOf");
30126
+ if (isSchema(copy.if) && isTainted(["if"])) {
30127
+ for (const keyword2 of ["if", "then", "else"]) {
30128
+ if (isSchema(copy[keyword2])) relocate([keyword2]);
30129
+ delete copy[keyword2];
30130
+ }
30131
+ skipped++;
30132
+ }
30133
+ dropIfTainted("contains", ["minContains", "maxContains"]);
30134
+ if (tainted[id2]) {
30135
+ for (const keyword2 of ["unevaluatedProperties", "unevaluatedItems"]) {
30136
+ if (keyword2 in copy) {
30137
+ if (isSchema(copy[keyword2])) relocate([keyword2]);
30138
+ delete copy[keyword2];
30139
+ skipped++;
30140
+ }
30141
+ }
30142
+ }
30143
+ for (const keyword2 of DYNAMIC_REF_KEYWORDS) {
30144
+ if (keyword2 in copy) {
30145
+ delete copy[keyword2];
30146
+ skipped++;
30147
+ }
30148
+ }
30149
+ const target = positions[id2].ref;
30150
+ if (typeof copy.$ref === "string" && typeof target === "number") {
30151
+ refSites.push({ node: copy, target });
30152
+ }
30153
+ const cloned = /* @__PURE__ */ new Set();
30154
+ for (const rel of childRels(copy)) {
30155
+ const child = childOf(rel);
30156
+ outParent[child] = id2;
30157
+ outRel[child] = rel;
30158
+ const sub = emit(child);
30159
+ if (rel.length === 1) {
30160
+ copy[rel[0]] = sub;
30161
+ continue;
30162
+ }
30163
+ const [keyword2, name2] = rel;
30164
+ if (!cloned.has(keyword2)) {
30165
+ cloned.add(keyword2);
30166
+ const container = copy[keyword2];
30167
+ copy[keyword2] = Array.isArray(container) ? [...container] : { ...container };
30168
+ }
30169
+ copy[keyword2][name2] = sub;
30170
+ }
30171
+ return copy;
30172
+ };
30173
+ outParent[0] = -1;
30174
+ outRel[0] = [];
30175
+ const output = emit(0);
30176
+ if (isObject(output) && holding.length > 0) {
30177
+ const definitions2 = isObject(output.definitions) ? { ...output.definitions } : {};
30178
+ for (const id2 of holding) {
30179
+ let name2;
30180
+ do {
30181
+ name2 = `${HOLDING_PREFIX}${nextName++}`;
30182
+ } while (takenNames.has(name2));
30183
+ takenNames.add(name2);
30184
+ outParent[id2] = 0;
30185
+ outRel[id2] = ["definitions", name2];
30186
+ definitions2[name2] = emit(id2);
30187
+ }
30188
+ output.definitions = definitions2;
30189
+ }
30190
+ const pointers = /* @__PURE__ */ new Map();
30191
+ const pointerOf = (id2) => {
30192
+ if (outParent[id2] === -2) return void 0;
30193
+ if (id2 === 0) return "#";
30194
+ const memo = pointers.get(id2);
30195
+ if (memo !== void 0) return memo;
30196
+ const chain = [];
30197
+ let current = id2;
30198
+ while (current !== 0 && !pointers.has(current)) {
30199
+ chain.push(current);
30200
+ current = outParent[current];
30201
+ }
30202
+ let pointer = current === 0 ? "#" : pointers.get(current);
30203
+ for (let i2 = chain.length - 1; i2 >= 0; i2--) {
30204
+ const link = chain[i2];
30205
+ pointer += outRel[link].map(formatSegment).join("");
30206
+ pointers.set(link, pointer);
30207
+ }
30208
+ return pointer;
30209
+ };
30210
+ for (const site of refSites) {
30211
+ site.node.$ref = pointerOf(site.target);
30212
+ }
30213
+ return { schema: output, stripped, skipped, validate: !hasIdentifier };
30214
+ }
30215
+ function schemaNote(result) {
30216
+ if (!result.validate) {
30217
+ return "this schema was not validated: it declares an $id or $anchor, which the Inspector does not resolve";
30218
+ }
30219
+ if (result.stripped === 0 && result.skipped === 0) return void 0;
30220
+ return patternsNotEvaluatedNote(result.stripped, result.skipped);
30221
+ }
30222
+ function patternsNotEvaluatedNote(stripped, skipped = 0) {
30223
+ const parts = [];
30224
+ if (stripped > 0) {
30225
+ parts.push(
30226
+ `${stripped} regex pattern(s) in this schema were not evaluated`
30227
+ );
30228
+ }
30229
+ if (skipped > 0) {
30230
+ parts.push(
30231
+ `${skipped} check(s) in this schema were skipped because they depend on an unevaluated pattern or an unresolvable $ref`
30232
+ );
30233
+ }
30234
+ return parts.join("; ");
30235
+ }
29912
30236
  const ajv$2 = new Ajv$1();
29913
30237
  const toolOutputValidators = /* @__PURE__ */ new Map();
30238
+ const toolOutputSchemaNotes = /* @__PURE__ */ new Map();
29914
30239
  function cacheToolOutputSchemas(tools) {
29915
30240
  toolOutputValidators.clear();
30241
+ toolOutputSchemaNotes.clear();
29916
30242
  for (const tool of tools) {
29917
30243
  if (tool.outputSchema) {
29918
30244
  try {
29919
- const validator = ajv$2.compile(tool.outputSchema);
29920
- toolOutputValidators.set(tool.name, validator);
30245
+ const result = stripSchemaPatterns(tool.outputSchema);
30246
+ const note = schemaNote(result);
30247
+ if (result.validate) {
30248
+ toolOutputValidators.set(
30249
+ tool.name,
30250
+ ajv$2.compile(result.schema)
30251
+ );
30252
+ }
30253
+ if (note !== void 0) toolOutputSchemaNotes.set(tool.name, note);
29921
30254
  } catch (error) {
29922
30255
  console.warn(
29923
30256
  `Failed to compile output schema for tool ${tool.name}:`,
@@ -29932,20 +30265,23 @@ function getToolOutputValidator(toolName) {
29932
30265
  }
29933
30266
  function validateToolOutput(toolName, structuredContent) {
29934
30267
  const validator = getToolOutputValidator(toolName);
30268
+ const toolNote = toolOutputSchemaNotes.get(toolName);
30269
+ const note = toolNote === void 0 ? {} : { note: toolNote };
29935
30270
  if (!validator) {
29936
- return { isValid: true };
30271
+ return toolNote === void 0 ? { isValid: true } : { isValid: true, validated: false, note: toolNote };
29937
30272
  }
29938
30273
  const isValid2 = validator(structuredContent);
29939
30274
  if (!isValid2) {
29940
30275
  return {
29941
30276
  isValid: false,
29942
- error: ajv$2.errorsText(validator.errors)
30277
+ error: ajv$2.errorsText(validator.errors),
30278
+ ...note
29943
30279
  };
29944
30280
  }
29945
- return { isValid: true };
30281
+ return { isValid: true, ...note };
29946
30282
  }
29947
30283
  function hasOutputSchema(toolName) {
29948
- return toolOutputValidators.has(toolName);
30284
+ return toolOutputValidators.has(toolName) || toolOutputSchemaNotes.has(toolName);
29949
30285
  }
29950
30286
  function generateDefaultValue(schema, propertyName, parentSchema) {
29951
30287
  if ("default" in schema && schema.default !== void 0) {
@@ -57143,7 +57479,7 @@ const useTheme = () => {
57143
57479
  [theme, setThemeWithSideEffect]
57144
57480
  );
57145
57481
  };
57146
- const version = "1.0.3";
57482
+ const version = "1.0.5";
57147
57483
  var __defProp$2 = Object.defineProperty;
57148
57484
  var __name$2 = (target, value) => __defProp$2(target, "name", { value, configurable: true });
57149
57485
  var [createTooltipContext, createTooltipScope] = /* @__PURE__ */ createContextScope("Tooltip", [
@@ -59409,14 +59745,20 @@ const ToolResults = ({
59409
59745
  /* @__PURE__ */ jsxRuntimeExports.jsx("h5", { className: "font-semibold mb-2 text-sm", children: "Structured Content:" }),
59410
59746
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-gray-50 dark:bg-gray-900 p-3 rounded-lg", children: [
59411
59747
  /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: structuredResult.structuredContent }),
59412
- validationResult && /* @__PURE__ */ jsxRuntimeExports.jsx(
59748
+ validationResult && /* @__PURE__ */ jsxRuntimeExports.jsxs(
59413
59749
  "div",
59414
59750
  {
59415
59751
  className: `mt-2 p-2 rounded text-sm ${validationResult.isValid ? "bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200" : "bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200"}`,
59416
- children: validationResult.isValid ? "✓ Valid according to output schema" : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59417
- "✗ Validation Error: ",
59418
- validationResult.error
59419
- ] })
59752
+ children: [
59753
+ "validated" in validationResult && validationResult.validated === false ? "Not validated against output schema" : validationResult.isValid ? "✓ Valid according to output schema" : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59754
+ "✗ Validation Error: ",
59755
+ validationResult.error
59756
+ ] }),
59757
+ "note" in validationResult && validationResult.note && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1 text-xs opacity-80", children: [
59758
+ "⚠ ",
59759
+ validationResult.note
59760
+ ] })
59761
+ ]
59420
59762
  }
59421
59763
  )
59422
59764
  ] })
@@ -59427,7 +59769,11 @@ const ToolResults = ({
59427
59769
  ] }),
59428
59770
  !structuredResult.structuredContent && validationResult && !validationResult.isValid && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200 p-2 rounded text-sm", children: [
59429
59771
  "✗ Validation Error: ",
59430
- validationResult.error
59772
+ validationResult.error,
59773
+ "note" in validationResult && validationResult.note && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1 text-xs opacity-80", children: [
59774
+ "⚠ ",
59775
+ validationResult.note
59776
+ ] })
59431
59777
  ] }) }),
59432
59778
  structuredResult.content.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
59433
59779
  structuredResult.structuredContent && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -66726,6 +67072,14 @@ const ElicitationRequest = ({
66726
67072
  const [showUrlConfirm, setShowUrlConfirm] = reactExports.useState(false);
66727
67073
  const requestData = request.request;
66728
67074
  const isUrlMode = requestData.mode === "url";
67075
+ const sanitized = reactExports.useMemo(
67076
+ () => isUrlMode ? void 0 : stripSchemaPatterns(
67077
+ requestData.requestedSchema
67078
+ ),
67079
+ [isUrlMode, requestData]
67080
+ );
67081
+ const regexFreeSchema = sanitized?.schema;
67082
+ const sanitizedNote = sanitized && schemaNote(sanitized);
66729
67083
  reactExports.useEffect(() => {
66730
67084
  if (isUrlMode) return;
66731
67085
  const defaultValue = generateDefaultValue(
@@ -66885,13 +67239,15 @@ const ElicitationRequest = ({
66885
67239
  if (!validateFormData(formData, formRequest.requestedSchema)) {
66886
67240
  return;
66887
67241
  }
66888
- const ajv2 = new Ajv$1();
66889
- const validate2 = ajv2.compile(formRequest.requestedSchema);
66890
- const isValid2 = validate2(formData);
66891
- if (!isValid2) {
66892
- const errorMessage = ajv2.errorsText(validate2.errors);
66893
- setValidationError(errorMessage);
66894
- return;
67242
+ if (sanitized?.validate) {
67243
+ const ajv2 = new Ajv$1();
67244
+ const validate2 = ajv2.compile(regexFreeSchema);
67245
+ const isValid2 = validate2(formData);
67246
+ if (!isValid2) {
67247
+ const errorMessage = ajv2.errorsText(validate2.errors);
67248
+ setValidationError(errorMessage);
67249
+ return;
67250
+ }
66895
67251
  }
66896
67252
  onResolve(request.id, {
66897
67253
  action: "accept",
@@ -66937,7 +67293,7 @@ const ElicitationRequest = ({
66937
67293
  /* @__PURE__ */ jsxRuntimeExports.jsx(
66938
67294
  DynamicJsonForm,
66939
67295
  {
66940
- schema: formRequest.requestedSchema,
67296
+ schema: regexFreeSchema,
66941
67297
  value: formData,
66942
67298
  onChange: (newValue) => {
66943
67299
  setFormData(newValue);
@@ -66945,6 +67301,10 @@ const ElicitationRequest = ({
66945
67301
  }
66946
67302
  }
66947
67303
  ),
67304
+ sanitizedNote && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 text-xs text-muted-foreground", children: [
67305
+ "⚠ ",
67306
+ sanitizedNote
67307
+ ] }),
66948
67308
  validationError && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-md", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-sm text-red-600 dark:text-red-400", children: [
66949
67309
  /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Validation Error:" }),
66950
67310
  " ",
@@ -68053,13 +68413,13 @@ const App = () => {
68053
68413
  ) });
68054
68414
  if (window.location.pathname === OAUTH_CALLBACK_PATH) {
68055
68415
  const OAuthCallback = React.lazy(
68056
- () => __vitePreload(() => import("./OAuthCallback-jbB02Bt3.js"), true ? [] : void 0)
68416
+ () => __vitePreload(() => import("./OAuthCallback-HH7qRC_N.js"), true ? [] : void 0)
68057
68417
  );
68058
68418
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
68059
68419
  }
68060
68420
  if (window.location.pathname === OAUTH_DEBUG_CALLBACK_PATH) {
68061
68421
  const OAuthDebugCallback = React.lazy(
68062
- () => __vitePreload(() => import("./OAuthDebugCallback-VeJ8bP3s.js"), true ? [] : void 0)
68422
+ () => __vitePreload(() => import("./OAuthDebugCallback-CEN7EFMg.js"), true ? [] : void 0)
68063
68423
  );
68064
68424
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
68065
68425
  }
@@ -1783,6 +1783,9 @@ video {
1783
1783
  .opacity-70 {
1784
1784
  opacity: 0.7;
1785
1785
  }
1786
+ .opacity-80 {
1787
+ opacity: 0.8;
1788
+ }
1786
1789
  .opacity-90 {
1787
1790
  opacity: 0.9;
1788
1791
  }
package/dist/index.html CHANGED
@@ -5,8 +5,8 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/mcp.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>MCP Inspector</title>
8
- <script type="module" crossorigin src="/assets/index-C2CDzlVy.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-DXy0twoH.css">
8
+ <script type="module" crossorigin src="/assets/index-BA98C07j.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-D-iperlR.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root" class="w-full"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelcontextprotocol/inspector-client",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Client-side application for the Model Context Protocol inspector",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Model Context Protocol a Series of LF Projects, LLC.",