@mcp-use/inspector 0.8.3-canary.0 → 0.9.0-canary.2

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.
Files changed (28) hide show
  1. package/dist/cli.js +29 -0
  2. package/dist/client/assets/browser-B7TIAiNJ.js +17967 -0
  3. package/dist/client/assets/display-A5IEINAP-CxMIzbGz.js +480 -0
  4. package/dist/client/assets/{embeddings-BiULWmf2.js → embeddings-CF86nH4i.js} +6 -1
  5. package/dist/client/assets/{index-BIMuOeon.js → index-B8yt0GKw.js} +11662 -2464
  6. package/dist/client/assets/{index-DAor5Yr-.js → index-BCYl76Jb.js} +2 -3
  7. package/dist/client/assets/index-BLXuIjh0.js +725 -0
  8. package/dist/client/assets/index-BMuvzxLw.js +400 -0
  9. package/dist/client/assets/{index-DPEyMG1a.js → index-BaR5HKmC.js} +28313 -19836
  10. package/dist/client/assets/{index-CwF__a_n.css → index-Br7cLVs6.css} +29 -0
  11. package/dist/client/assets/{index-B9oLougE.js → index-CV9pPOH9.js} +36 -4
  12. package/dist/client/assets/{index-C4Csm_Xe.js → index-DoWSnGj3.js} +76 -784
  13. package/dist/client/assets/index-RN6yjAFG.js +2817 -0
  14. package/dist/client/assets/{display-YIYC6WJE-BTd-7ehF.js → index-cuGVED_J.js} +149 -926
  15. package/dist/client/assets/util-D59LNlyU.js +23 -0
  16. package/dist/client/assets/{winston-DPHXtm9k.js → winston-nzaZqgVL.js} +154 -760
  17. package/dist/client/index.html +3 -3
  18. package/dist/server/{chunk-26WTIZ4S.js → chunk-LNMQYGXR.js} +29 -0
  19. package/dist/server/{chunk-6ZFXPXO4.js → chunk-PBQJCPZX.js} +1 -1
  20. package/dist/server/cli.js +1 -1
  21. package/dist/server/index.js +2 -2
  22. package/dist/server/middleware.js +2 -2
  23. package/dist/server/server.js +1 -1
  24. package/dist/server/shared-static.d.ts.map +1 -1
  25. package/dist/server/shared-static.js +1 -1
  26. package/package.json +2 -2
  27. package/dist/client/assets/browser-CeWBn_h2.js +0 -38211
  28. package/dist/client/assets/chunk-VL2OQCWN-aIw8FJQU.js +0 -6475
@@ -0,0 +1,400 @@
1
+ const ANSI_BACKGROUND_OFFSET = 10;
2
+ const wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
3
+ const wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
4
+ const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
5
+ const styles$1 = {
6
+ modifier: {
7
+ reset: [0, 0],
8
+ // 21 isn't widely supported and 22 does the same thing
9
+ bold: [1, 22],
10
+ dim: [2, 22],
11
+ italic: [3, 23],
12
+ underline: [4, 24],
13
+ overline: [53, 55],
14
+ inverse: [7, 27],
15
+ hidden: [8, 28],
16
+ strikethrough: [9, 29]
17
+ },
18
+ color: {
19
+ black: [30, 39],
20
+ red: [31, 39],
21
+ green: [32, 39],
22
+ yellow: [33, 39],
23
+ blue: [34, 39],
24
+ magenta: [35, 39],
25
+ cyan: [36, 39],
26
+ white: [37, 39],
27
+ // Bright color
28
+ blackBright: [90, 39],
29
+ gray: [90, 39],
30
+ // Alias of `blackBright`
31
+ grey: [90, 39],
32
+ // Alias of `blackBright`
33
+ redBright: [91, 39],
34
+ greenBright: [92, 39],
35
+ yellowBright: [93, 39],
36
+ blueBright: [94, 39],
37
+ magentaBright: [95, 39],
38
+ cyanBright: [96, 39],
39
+ whiteBright: [97, 39]
40
+ },
41
+ bgColor: {
42
+ bgBlack: [40, 49],
43
+ bgRed: [41, 49],
44
+ bgGreen: [42, 49],
45
+ bgYellow: [43, 49],
46
+ bgBlue: [44, 49],
47
+ bgMagenta: [45, 49],
48
+ bgCyan: [46, 49],
49
+ bgWhite: [47, 49],
50
+ // Bright color
51
+ bgBlackBright: [100, 49],
52
+ bgGray: [100, 49],
53
+ // Alias of `bgBlackBright`
54
+ bgGrey: [100, 49],
55
+ // Alias of `bgBlackBright`
56
+ bgRedBright: [101, 49],
57
+ bgGreenBright: [102, 49],
58
+ bgYellowBright: [103, 49],
59
+ bgBlueBright: [104, 49],
60
+ bgMagentaBright: [105, 49],
61
+ bgCyanBright: [106, 49],
62
+ bgWhiteBright: [107, 49]
63
+ }
64
+ };
65
+ const modifierNames = Object.keys(styles$1.modifier);
66
+ const foregroundColorNames = Object.keys(styles$1.color);
67
+ const backgroundColorNames = Object.keys(styles$1.bgColor);
68
+ const colorNames = [...foregroundColorNames, ...backgroundColorNames];
69
+ function assembleStyles() {
70
+ const codes = /* @__PURE__ */ new Map();
71
+ for (const [groupName, group] of Object.entries(styles$1)) {
72
+ for (const [styleName, style] of Object.entries(group)) {
73
+ styles$1[styleName] = {
74
+ open: `\x1B[${style[0]}m`,
75
+ close: `\x1B[${style[1]}m`
76
+ };
77
+ group[styleName] = styles$1[styleName];
78
+ codes.set(style[0], style[1]);
79
+ }
80
+ Object.defineProperty(styles$1, groupName, {
81
+ value: group,
82
+ enumerable: false
83
+ });
84
+ }
85
+ Object.defineProperty(styles$1, "codes", {
86
+ value: codes,
87
+ enumerable: false
88
+ });
89
+ styles$1.color.close = "\x1B[39m";
90
+ styles$1.bgColor.close = "\x1B[49m";
91
+ styles$1.color.ansi = wrapAnsi16();
92
+ styles$1.color.ansi256 = wrapAnsi256();
93
+ styles$1.color.ansi16m = wrapAnsi16m();
94
+ styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
95
+ styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
96
+ styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
97
+ Object.defineProperties(styles$1, {
98
+ rgbToAnsi256: {
99
+ value(red, green, blue) {
100
+ if (red === green && green === blue) {
101
+ if (red < 8) {
102
+ return 16;
103
+ }
104
+ if (red > 248) {
105
+ return 231;
106
+ }
107
+ return Math.round((red - 8) / 247 * 24) + 232;
108
+ }
109
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
110
+ },
111
+ enumerable: false
112
+ },
113
+ hexToRgb: {
114
+ value(hex) {
115
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
116
+ if (!matches) {
117
+ return [0, 0, 0];
118
+ }
119
+ let [colorString] = matches;
120
+ if (colorString.length === 3) {
121
+ colorString = [...colorString].map((character) => character + character).join("");
122
+ }
123
+ const integer = Number.parseInt(colorString, 16);
124
+ return [
125
+ /* eslint-disable no-bitwise */
126
+ integer >> 16 & 255,
127
+ integer >> 8 & 255,
128
+ integer & 255
129
+ /* eslint-enable no-bitwise */
130
+ ];
131
+ },
132
+ enumerable: false
133
+ },
134
+ hexToAnsi256: {
135
+ value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
136
+ enumerable: false
137
+ },
138
+ ansi256ToAnsi: {
139
+ value(code) {
140
+ if (code < 8) {
141
+ return 30 + code;
142
+ }
143
+ if (code < 16) {
144
+ return 90 + (code - 8);
145
+ }
146
+ let red;
147
+ let green;
148
+ let blue;
149
+ if (code >= 232) {
150
+ red = ((code - 232) * 10 + 8) / 255;
151
+ green = red;
152
+ blue = red;
153
+ } else {
154
+ code -= 16;
155
+ const remainder = code % 36;
156
+ red = Math.floor(code / 36) / 5;
157
+ green = Math.floor(remainder / 6) / 5;
158
+ blue = remainder % 6 / 5;
159
+ }
160
+ const value = Math.max(red, green, blue) * 2;
161
+ if (value === 0) {
162
+ return 30;
163
+ }
164
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
165
+ if (value === 2) {
166
+ result += 60;
167
+ }
168
+ return result;
169
+ },
170
+ enumerable: false
171
+ },
172
+ rgbToAnsi: {
173
+ value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
174
+ enumerable: false
175
+ },
176
+ hexToAnsi: {
177
+ value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
178
+ enumerable: false
179
+ }
180
+ });
181
+ return styles$1;
182
+ }
183
+ const ansiStyles = assembleStyles();
184
+ const level = (() => {
185
+ if (!("navigator" in globalThis)) {
186
+ return 0;
187
+ }
188
+ if (globalThis.navigator.userAgentData) {
189
+ const brand = navigator.userAgentData.brands.find(({ brand: brand2 }) => brand2 === "Chromium");
190
+ if (brand && brand.version > 93) {
191
+ return 3;
192
+ }
193
+ }
194
+ if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) {
195
+ return 1;
196
+ }
197
+ return 0;
198
+ })();
199
+ const colorSupport = level !== 0 && {
200
+ level,
201
+ hasBasic: true,
202
+ has256: level >= 2,
203
+ has16m: level >= 3
204
+ };
205
+ const supportsColor = {
206
+ stdout: colorSupport,
207
+ stderr: colorSupport
208
+ };
209
+ function stringReplaceAll(string, substring, replacer) {
210
+ let index = string.indexOf(substring);
211
+ if (index === -1) {
212
+ return string;
213
+ }
214
+ const substringLength = substring.length;
215
+ let endIndex = 0;
216
+ let returnValue = "";
217
+ do {
218
+ returnValue += string.slice(endIndex, index) + substring + replacer;
219
+ endIndex = index + substringLength;
220
+ index = string.indexOf(substring, endIndex);
221
+ } while (index !== -1);
222
+ returnValue += string.slice(endIndex);
223
+ return returnValue;
224
+ }
225
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
226
+ let endIndex = 0;
227
+ let returnValue = "";
228
+ do {
229
+ const gotCR = string[index - 1] === "\r";
230
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
231
+ endIndex = index + 1;
232
+ index = string.indexOf("\n", endIndex);
233
+ } while (index !== -1);
234
+ returnValue += string.slice(endIndex);
235
+ return returnValue;
236
+ }
237
+ const { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
238
+ const GENERATOR = Symbol("GENERATOR");
239
+ const STYLER = Symbol("STYLER");
240
+ const IS_EMPTY = Symbol("IS_EMPTY");
241
+ const levelMapping = [
242
+ "ansi",
243
+ "ansi",
244
+ "ansi256",
245
+ "ansi16m"
246
+ ];
247
+ const styles = /* @__PURE__ */ Object.create(null);
248
+ const applyOptions = (object, options = {}) => {
249
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
250
+ throw new Error("The `level` option should be an integer from 0 to 3");
251
+ }
252
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
253
+ object.level = options.level === void 0 ? colorLevel : options.level;
254
+ };
255
+ class Chalk {
256
+ constructor(options) {
257
+ return chalkFactory(options);
258
+ }
259
+ }
260
+ const chalkFactory = (options) => {
261
+ const chalk2 = (...strings) => strings.join(" ");
262
+ applyOptions(chalk2, options);
263
+ Object.setPrototypeOf(chalk2, createChalk.prototype);
264
+ return chalk2;
265
+ };
266
+ function createChalk(options) {
267
+ return chalkFactory(options);
268
+ }
269
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
270
+ for (const [styleName, style] of Object.entries(ansiStyles)) {
271
+ styles[styleName] = {
272
+ get() {
273
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
274
+ Object.defineProperty(this, styleName, { value: builder });
275
+ return builder;
276
+ }
277
+ };
278
+ }
279
+ styles.visible = {
280
+ get() {
281
+ const builder = createBuilder(this, this[STYLER], true);
282
+ Object.defineProperty(this, "visible", { value: builder });
283
+ return builder;
284
+ }
285
+ };
286
+ const getModelAnsi = (model, level2, type, ...arguments_) => {
287
+ if (model === "rgb") {
288
+ if (level2 === "ansi16m") {
289
+ return ansiStyles[type].ansi16m(...arguments_);
290
+ }
291
+ if (level2 === "ansi256") {
292
+ return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
293
+ }
294
+ return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
295
+ }
296
+ if (model === "hex") {
297
+ return getModelAnsi("rgb", level2, type, ...ansiStyles.hexToRgb(...arguments_));
298
+ }
299
+ return ansiStyles[type][model](...arguments_);
300
+ };
301
+ const usedModels = ["rgb", "hex", "ansi256"];
302
+ for (const model of usedModels) {
303
+ styles[model] = {
304
+ get() {
305
+ const { level: level2 } = this;
306
+ return function(...arguments_) {
307
+ const styler = createStyler(getModelAnsi(model, levelMapping[level2], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
308
+ return createBuilder(this, styler, this[IS_EMPTY]);
309
+ };
310
+ }
311
+ };
312
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
313
+ styles[bgModel] = {
314
+ get() {
315
+ const { level: level2 } = this;
316
+ return function(...arguments_) {
317
+ const styler = createStyler(getModelAnsi(model, levelMapping[level2], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
318
+ return createBuilder(this, styler, this[IS_EMPTY]);
319
+ };
320
+ }
321
+ };
322
+ }
323
+ const proto = Object.defineProperties(() => {
324
+ }, {
325
+ ...styles,
326
+ level: {
327
+ enumerable: true,
328
+ get() {
329
+ return this[GENERATOR].level;
330
+ },
331
+ set(level2) {
332
+ this[GENERATOR].level = level2;
333
+ }
334
+ }
335
+ });
336
+ const createStyler = (open, close, parent) => {
337
+ let openAll;
338
+ let closeAll;
339
+ if (parent === void 0) {
340
+ openAll = open;
341
+ closeAll = close;
342
+ } else {
343
+ openAll = parent.openAll + open;
344
+ closeAll = close + parent.closeAll;
345
+ }
346
+ return {
347
+ open,
348
+ close,
349
+ openAll,
350
+ closeAll,
351
+ parent
352
+ };
353
+ };
354
+ const createBuilder = (self, _styler, _isEmpty) => {
355
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
356
+ Object.setPrototypeOf(builder, proto);
357
+ builder[GENERATOR] = self;
358
+ builder[STYLER] = _styler;
359
+ builder[IS_EMPTY] = _isEmpty;
360
+ return builder;
361
+ };
362
+ const applyStyle = (self, string) => {
363
+ if (self.level <= 0 || !string) {
364
+ return self[IS_EMPTY] ? "" : string;
365
+ }
366
+ let styler = self[STYLER];
367
+ if (styler === void 0) {
368
+ return string;
369
+ }
370
+ const { openAll, closeAll } = styler;
371
+ if (string.includes("\x1B")) {
372
+ while (styler !== void 0) {
373
+ string = stringReplaceAll(string, styler.close, styler.open);
374
+ styler = styler.parent;
375
+ }
376
+ }
377
+ const lfIndex = string.indexOf("\n");
378
+ if (lfIndex !== -1) {
379
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
380
+ }
381
+ return openAll + string + closeAll;
382
+ };
383
+ Object.defineProperties(createChalk.prototype, styles);
384
+ const chalk = createChalk();
385
+ const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
386
+ export {
387
+ Chalk,
388
+ backgroundColorNames,
389
+ backgroundColorNames as backgroundColors,
390
+ chalkStderr,
391
+ colorNames,
392
+ colorNames as colors,
393
+ chalk as default,
394
+ foregroundColorNames,
395
+ foregroundColorNames as foregroundColors,
396
+ modifierNames,
397
+ modifierNames as modifiers,
398
+ stdoutColor as supportsColor,
399
+ stderrColor as supportsColorStderr
400
+ };