@tonyclaw/llm-inspector 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/index-B5q3Llgm.css +1 -0
  3. package/.output/public/assets/index-C6tbslcs.js +105 -0
  4. package/.output/public/assets/{main-C3tLo75s.js → main-C1k6vRnH.js} +1 -1
  5. package/.output/server/_libs/cfworker__json-schema.mjs +1 -0
  6. package/.output/server/_libs/lucide-react.mjs +60 -54
  7. package/.output/server/_libs/modelcontextprotocol__server.mjs +9738 -0
  8. package/.output/server/_libs/zod.mjs +79 -16
  9. package/.output/server/_ssr/{index-C8VC13EA.mjs → index-AxruZp16.mjs} +495 -77
  10. package/.output/server/_ssr/index.mjs +2 -2
  11. package/.output/server/_ssr/{router-D5ccnemB.mjs → router-DtleGqN8.mjs} +650 -29
  12. package/.output/server/_tanstack-start-manifest_v-B1WAHWIa.mjs +4 -0
  13. package/.output/server/index.mjs +26 -26
  14. package/README.md +98 -0
  15. package/package.json +3 -1
  16. package/src/components/proxy-viewer/CompareDrawer.tsx +583 -91
  17. package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +74 -4
  18. package/src/lib/serverPort.ts +41 -0
  19. package/src/mcp/loopback.ts +76 -0
  20. package/src/mcp/previewExtractor.ts +166 -0
  21. package/src/mcp/server.ts +320 -0
  22. package/src/mcp/toolHandlers.ts +259 -0
  23. package/src/proxy/formats/openai/schemas.ts +19 -0
  24. package/src/proxy/handler.ts +23 -2
  25. package/src/proxy/openaiOrphanToolStrip.ts +148 -0
  26. package/src/proxy/schemas.ts +1 -0
  27. package/src/routes/api/mcp.ts +25 -0
  28. package/.output/public/assets/index-B0anmGQr.css +0 -1
  29. package/.output/public/assets/index-H_thmL2_.js +0 -105
  30. package/.output/server/_tanstack-start-manifest_v-DUbXa1lt.mjs +0 -4
@@ -1,3 +1,6 @@
1
+ const NEVER = Object.freeze({
2
+ status: "aborted"
3
+ });
1
4
  function $constructor(name, initializer2, params) {
2
5
  function init(inst, def) {
3
6
  if (!inst._zod) {
@@ -644,7 +647,7 @@ const string$1 = (params) => {
644
647
  return new RegExp(`^${regex}$`);
645
648
  };
646
649
  const integer = /^-?\d+$/;
647
- const number$1 = /^-?\d+(?:\.\d+)?$/;
650
+ const number$2 = /^-?\d+(?:\.\d+)?$/;
648
651
  const boolean$1 = /^(?:true|false)$/i;
649
652
  const _null$2 = /^null$/i;
650
653
  const lowercase = /^[^A-Z]*$/;
@@ -1242,10 +1245,10 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1242
1245
  inst._zod.check = (payload) => {
1243
1246
  try {
1244
1247
  const trimmed = payload.value.trim();
1245
- const url = new URL(trimmed);
1248
+ const url2 = new URL(trimmed);
1246
1249
  if (def.hostname) {
1247
1250
  def.hostname.lastIndex = 0;
1248
- if (!def.hostname.test(url.hostname)) {
1251
+ if (!def.hostname.test(url2.hostname)) {
1249
1252
  payload.issues.push({
1250
1253
  code: "invalid_format",
1251
1254
  format: "url",
@@ -1259,7 +1262,7 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1259
1262
  }
1260
1263
  if (def.protocol) {
1261
1264
  def.protocol.lastIndex = 0;
1262
- if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
1265
+ if (!def.protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol)) {
1263
1266
  payload.issues.push({
1264
1267
  code: "invalid_format",
1265
1268
  format: "url",
@@ -1272,7 +1275,7 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1272
1275
  }
1273
1276
  }
1274
1277
  if (def.normalize) {
1275
- payload.value = url.href;
1278
+ payload.value = url2.href;
1276
1279
  } else {
1277
1280
  payload.value = trimmed;
1278
1281
  }
@@ -1478,7 +1481,7 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1478
1481
  });
1479
1482
  const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1480
1483
  $ZodType.init(inst, def);
1481
- inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
1484
+ inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
1482
1485
  inst._zod.parse = (payload, _ctx) => {
1483
1486
  if (def.coerce)
1484
1487
  try {
@@ -1542,6 +1545,10 @@ const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1542
1545
  return payload;
1543
1546
  };
1544
1547
  });
1548
+ const $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
1549
+ $ZodType.init(inst, def);
1550
+ inst._zod.parse = (payload) => payload;
1551
+ });
1545
1552
  const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
1546
1553
  $ZodType.init(inst, def);
1547
1554
  inst._zod.parse = (payload) => payload;
@@ -2115,7 +2122,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
2115
2122
  if (keyResult instanceof Promise) {
2116
2123
  throw new Error("Async schemas not supported in object keys currently");
2117
2124
  }
2118
- const checkNumericKey = typeof key === "string" && number$1.test(key) && keyResult.issues.length;
2125
+ const checkNumericKey = typeof key === "string" && number$2.test(key) && keyResult.issues.length;
2119
2126
  if (checkNumericKey) {
2120
2127
  const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
2121
2128
  if (retryResult instanceof Promise) {
@@ -2803,6 +2810,15 @@ function _number(Class, params) {
2803
2810
  });
2804
2811
  }
2805
2812
  // @__NO_SIDE_EFFECTS__
2813
+ function _coercedNumber(Class, params) {
2814
+ return new Class({
2815
+ type: "number",
2816
+ coerce: true,
2817
+ checks: [],
2818
+ ...normalizeParams(params)
2819
+ });
2820
+ }
2821
+ // @__NO_SIDE_EFFECTS__
2806
2822
  function _int(Class, params) {
2807
2823
  return new Class({
2808
2824
  type: "number",
@@ -2827,6 +2843,12 @@ function _null$1(Class, params) {
2827
2843
  });
2828
2844
  }
2829
2845
  // @__NO_SIDE_EFFECTS__
2846
+ function _any(Class) {
2847
+ return new Class({
2848
+ type: "any"
2849
+ });
2850
+ }
2851
+ // @__NO_SIDE_EFFECTS__
2830
2852
  function _unknown(Class) {
2831
2853
  return new Class({
2832
2854
  type: "unknown"
@@ -3486,6 +3508,8 @@ const nullProcessor = (_schema, ctx, json, _params) => {
3486
3508
  const neverProcessor = (_schema, _ctx, json, _params) => {
3487
3509
  json.not = {};
3488
3510
  };
3511
+ const anyProcessor = (_schema, _ctx, _json, _params) => {
3512
+ };
3489
3513
  const unknownProcessor = (_schema, _ctx, _json, _params) => {
3490
3514
  };
3491
3515
  const enumProcessor = (schema, _ctx, json, _params) => {
@@ -3968,6 +3992,9 @@ const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
3968
3992
  $ZodURL.init(inst, def);
3969
3993
  ZodStringFormat.init(inst, def);
3970
3994
  });
3995
+ function url(params) {
3996
+ return /* @__PURE__ */ _url(ZodURL, params);
3997
+ }
3971
3998
  const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
3972
3999
  $ZodEmoji.init(inst, def);
3973
4000
  ZodStringFormat.init(inst, def);
@@ -4054,7 +4081,7 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
4054
4081
  inst.isFinite = true;
4055
4082
  inst.format = bag.format ?? null;
4056
4083
  });
4057
- function number(params) {
4084
+ function number$1(params) {
4058
4085
  return /* @__PURE__ */ _number(ZodNumber, params);
4059
4086
  }
4060
4087
  const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
@@ -4080,6 +4107,14 @@ const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
4080
4107
  function _null(params) {
4081
4108
  return /* @__PURE__ */ _null$1(ZodNull, params);
4082
4109
  }
4110
+ const ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
4111
+ $ZodAny.init(inst, def);
4112
+ ZodType.init(inst, def);
4113
+ inst._zod.processJSONSchema = (ctx, json, params) => anyProcessor();
4114
+ });
4115
+ function any() {
4116
+ return /* @__PURE__ */ _any(ZodAny);
4117
+ }
4083
4118
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
4084
4119
  $ZodUnknown.init(inst, def);
4085
4120
  ZodType.init(inst, def);
@@ -4143,6 +4178,14 @@ function object(shape, params) {
4143
4178
  };
4144
4179
  return new ZodObject(def);
4145
4180
  }
4181
+ function looseObject(shape, params) {
4182
+ return new ZodObject({
4183
+ type: "object",
4184
+ shape,
4185
+ catchall: unknown(),
4186
+ ...normalizeParams(params)
4187
+ });
4188
+ }
4146
4189
  const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
4147
4190
  $ZodUnion.init(inst, def);
4148
4191
  ZodType.init(inst, def);
@@ -4444,18 +4487,38 @@ function refine(fn, _params = {}) {
4444
4487
  function superRefine(fn) {
4445
4488
  return /* @__PURE__ */ _superRefine(fn);
4446
4489
  }
4490
+ function preprocess(fn, schema) {
4491
+ return pipe(transform(fn), schema);
4492
+ }
4493
+ const ZodIssueCode = {
4494
+ custom: "custom"
4495
+ };
4496
+ function number(params) {
4497
+ return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
4498
+ }
4447
4499
  export {
4500
+ NEVER as N,
4501
+ ZodIssueCode as Z,
4448
4502
  _enum as _,
4449
4503
  array as a,
4450
- boolean as b,
4451
- _null as c,
4452
- discriminatedUnion as d,
4453
- lazy as e,
4454
- unknown as f,
4504
+ string as b,
4505
+ boolean as c,
4506
+ object as d,
4507
+ unknown as e,
4508
+ looseObject as f,
4509
+ discriminatedUnion as g,
4510
+ _null as h,
4511
+ datetime as i,
4512
+ intersection as j,
4513
+ lazy as k,
4455
4514
  literal as l,
4456
- number as n,
4457
- object as o,
4515
+ url as m,
4516
+ number$1 as n,
4517
+ optional as o,
4518
+ preprocess as p,
4519
+ number as q,
4458
4520
  record as r,
4459
- string as s,
4521
+ safeParse as s,
4522
+ any as t,
4460
4523
  union as u
4461
4524
  };