@tonyclaw/llm-inspector 1.9.6 → 1.9.7

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 (49) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/index-Cc1oV0hF.css +1 -0
  3. package/.output/public/assets/index-DTjsqi6U.js +11 -0
  4. package/.output/public/assets/index-DrYcBTSK.js +122 -0
  5. package/.output/server/_chunks/ssr-renderer.mjs +1 -0
  6. package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +1 -1
  7. package/.output/server/_libs/ajv-formats.mjs +18 -18
  8. package/.output/server/_libs/ajv.mjs +196 -196
  9. package/.output/server/_libs/cookie-es.mjs +7 -21
  10. package/.output/server/_libs/h3-v2.mjs +18 -7
  11. package/.output/server/_libs/h3.mjs +24 -16
  12. package/.output/server/_libs/jszip.mjs +28 -28
  13. package/.output/server/_libs/pako.mjs +13 -13
  14. package/.output/server/_libs/radix-ui__react-collection.mjs +1 -1
  15. package/.output/server/_libs/radix-ui__react-id.mjs +1 -1
  16. package/.output/server/_libs/react-dom.mjs +5 -5
  17. package/.output/server/_libs/react.mjs +43 -43
  18. package/.output/server/_libs/readable-stream.mjs +15 -15
  19. package/.output/server/_libs/safe-buffer.mjs +3 -3
  20. package/.output/server/_libs/semver.mjs +10 -10
  21. package/.output/server/_libs/seroval-plugins.mjs +5 -5
  22. package/.output/server/_libs/seroval.mjs +606 -596
  23. package/.output/server/_libs/srvx.mjs +110 -46
  24. package/.output/server/_libs/swr.mjs +1 -1
  25. package/.output/server/_libs/tanstack__history.mjs +31 -44
  26. package/.output/server/_libs/tanstack__react-router.mjs +781 -1090
  27. package/.output/server/_libs/tanstack__router-core.mjs +2223 -2328
  28. package/.output/server/_libs/tslib.mjs +5 -5
  29. package/.output/server/_libs/use-sync-external-store.mjs +1 -1
  30. package/.output/server/_libs/zod.mjs +503 -205
  31. package/.output/server/_ssr/empty-plugin-adapters-BFgPZ6_d.mjs +6 -0
  32. package/.output/server/_ssr/{index--OdB29Fv.mjs → index-Lxfn0bBE.mjs} +31 -13
  33. package/.output/server/_ssr/index.mjs +1100 -777
  34. package/.output/server/_ssr/{router-CY_hgLPo.mjs → router-CXva8nm-.mjs} +26 -7
  35. package/.output/server/_tanstack-start-manifest_v-Cb2CDJtB.mjs +4 -0
  36. package/.output/server/index.mjs +26 -25
  37. package/README.md +50 -11
  38. package/package.json +1 -1
  39. package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +35 -2
  40. package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +25 -11
  41. package/src/proxy/formats/openai/schemas.ts +6 -0
  42. package/src/proxy/formats/openai/stream.ts +8 -0
  43. package/src/proxy/handler.ts +6 -2
  44. package/.output/public/assets/index-Bjuk3Pry.css +0 -1
  45. package/.output/public/assets/index-DtK6Ymig.js +0 -97
  46. package/.output/public/assets/main-ClWp6y0D.js +0 -17
  47. package/.output/server/_libs/tiny-invariant.mjs +0 -12
  48. package/.output/server/_libs/tiny-warning.mjs +0 -5
  49. package/.output/server/_tanstack-start-manifest_v-bpFJzmyh.mjs +0 -4
@@ -0,0 +1,6 @@
1
+ var pluginSerializationAdapters = [];
2
+ var hasPluginAdapters = false;
3
+ export {
4
+ hasPluginAdapters,
5
+ pluginSerializationAdapters
6
+ };
@@ -1,5 +1,5 @@
1
- import { r as reactExports, j as jsxRuntimeExports, a as React } from "../_libs/react.mjs";
2
- import { C as CapturedLogSchema, a as parseRequest, p as parseOpenAIResponse, I as InspectorResponseSchema } from "./router-CY_hgLPo.mjs";
1
+ import { r as reactExports, j as jsxRuntimeExports, R as React } from "../_libs/react.mjs";
2
+ import { C as CapturedLogSchema, a as parseRequest, p as parseOpenAIResponse, I as InspectorResponseSchema } from "./router-CXva8nm-.mjs";
3
3
  import { u as useVirtualizer } from "../_libs/tanstack__react-virtual.mjs";
4
4
  import { J as JSZip } from "../_libs/jszip.mjs";
5
5
  import { c as clsx } from "../_libs/clsx.mjs";
@@ -8,7 +8,7 @@ import { c as cva } from "../_libs/class-variance-authority.mjs";
8
8
  import { R as Root, T as Trigger$1, C as Content, a as Close, b as Title, P as Portal$1, O as Overlay } from "../_libs/radix-ui__react-dialog.mjs";
9
9
  import { R as Root2, T as Trigger, I as Icon, V as Value, P as Portal, C as Content2, a as Viewport, b as Item, c as ItemIndicator, d as ItemText, S as ScrollUpButton, e as ScrollDownButton } from "../_libs/radix-ui__react-select.mjs";
10
10
  import { u as useSWR } from "../_libs/swr.mjs";
11
- import { D as Download, L as LayoutGrid, a as List, S as Settings, C as ChevronDown, b as Check, R as RotateCcw, X, U as Upload, P as Plus, c as Copy, d as CircleAlert, e as ChevronUp, f as ChevronRight, g as Clock, M as MessageSquare, Z as Zap, h as LoaderCircle, W as Wrench, G as Globe, i as User, F as FileTerminal, j as Radio, E as ExternalLink, k as EyeOff, l as Eye, m as RotateCw, n as Pencil, T as Trash2, o as TriangleAlert, p as Minus, q as CircleCheckBig, r as CircleStop, s as CircleQuestionMark, t as Server, u as Gauge, v as Lock, w as Wifi, x as WifiOff, y as ChevronsUp, z as ChevronsDown, A as Terminal, B as Brain } from "../_libs/lucide-react.mjs";
11
+ import { D as Download, L as LayoutGrid, a as List, S as Settings, C as ChevronDown, b as Check, R as RotateCcw, X, U as Upload, P as Plus, c as Copy, d as CircleAlert, e as ChevronUp, f as ChevronRight, g as Clock, M as MessageSquare, Z as Zap, h as LoaderCircle, W as Wrench, G as Globe, i as User, F as FileTerminal, j as Radio, E as ExternalLink, k as EyeOff, l as Eye, m as RotateCw, n as Pencil, T as Trash2, o as TriangleAlert, p as Minus, q as CircleCheckBig, r as CircleStop, s as CircleQuestionMark, t as Server, u as Gauge, v as Lock, w as Wifi, x as WifiOff, y as ChevronsUp, z as ChevronsDown, B as Brain, A as Terminal } from "../_libs/lucide-react.mjs";
12
12
  import { M as Markdown } from "../_libs/react-markdown.mjs";
13
13
  import { a as array, s as string, u as union, o as object, l as literal, n as number, b as boolean } from "../_libs/zod.mjs";
14
14
  import { R as Root2$1, L as List$1, T as Trigger$2, C as Content$1 } from "../_libs/radix-ui__react-tabs.mjs";
@@ -18,11 +18,9 @@ import { R as Root$1 } from "../_libs/radix-ui__react-separator.mjs";
18
18
  import { R as Root$2, C as CollapsibleTrigger$1, a as CollapsibleContent$1 } from "../_libs/radix-ui__react-collapsible.mjs";
19
19
  import { R as Root$3, V as Viewport$1, C as Corner, S as ScrollAreaScrollbar, a as ScrollAreaThumb } from "../_libs/radix-ui__react-scroll-area.mjs";
20
20
  import "../_libs/tanstack__react-router.mjs";
21
- import "../_libs/tiny-warning.mjs";
22
21
  import "../_libs/tanstack__router-core.mjs";
23
- import "../_libs/cookie-es.mjs";
24
22
  import "../_libs/tanstack__history.mjs";
25
- import "../_libs/tiny-invariant.mjs";
23
+ import "../_libs/cookie-es.mjs";
26
24
  import "../_libs/seroval.mjs";
27
25
  import "../_libs/seroval-plugins.mjs";
28
26
  import "node:stream/web";
@@ -199,7 +197,7 @@ async function exportLogsAsZip(logs) {
199
197
  document.body.removeChild(anchor);
200
198
  URL.revokeObjectURL(url);
201
199
  }
202
- const version = "1.9.6";
200
+ const version = "1.9.7";
203
201
  const packageJson = {
204
202
  version
205
203
  };
@@ -1296,11 +1294,27 @@ function SystemReminderBlock({ text }) {
1296
1294
  /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pl-4 pt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: text }) }) }) })
1297
1295
  ] });
1298
1296
  }
1297
+ const THINKING_TAG_REGEX = /<think>([\s\S]*?)<\/think>/gi;
1298
+ const THINKING_TAG_REGEX_SINGLE = /<think>([\s\S]*?)<\/think>/i;
1299
+ function extractThinkingFromContent(text) {
1300
+ const match = THINKING_TAG_REGEX_SINGLE.exec(text);
1301
+ if (!match || match[1] === void 0) {
1302
+ return { thinking: null, remainingText: text };
1303
+ }
1304
+ const thinking = match[1].trim();
1305
+ const remainingText = text.replace(THINKING_TAG_REGEX, "").trim();
1306
+ return { thinking, remainingText };
1307
+ }
1299
1308
  function TextBlock({ text }) {
1300
1309
  if (text.includes("<system-reminder>")) {
1301
1310
  return /* @__PURE__ */ jsxRuntimeExports.jsx(SystemReminderBlock, { text });
1302
1311
  }
1303
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: text }) });
1312
+ const { thinking, remainingText } = extractThinkingFromContent(text);
1313
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
1314
+ thinking !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(ThinkingBlock, { thinking }),
1315
+ remainingText.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: remainingText }) }),
1316
+ thinking === null && remainingText.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground italic", children: "Empty text block" })
1317
+ ] });
1304
1318
  }
1305
1319
  function ThinkingBlock({ thinking }) {
1306
1320
  const [open, setOpen] = reactExports.useState(false);
@@ -1427,11 +1441,15 @@ function OpenAIResponseView({ response }) {
1427
1441
  ] }),
1428
1442
  /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { className: "opacity-50" }),
1429
1443
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
1430
- message?.reasoning_content !== null && message?.reasoning_content !== void 0 && message.reasoning_content.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-purple-500/30 rounded-md p-3 bg-purple-500/5", children: [
1431
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-purple-400 font-mono mb-1", children: "thinking" }),
1432
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-purple-200 whitespace-pre-wrap", children: message.reasoning_content })
1433
- ] }),
1434
- message?.content !== null && message?.content !== void 0 && message.content.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: message.content }) }),
1444
+ message?.reasoning_content !== null && message?.reasoning_content !== void 0 && message.reasoning_content.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ThinkingBlock, { thinking: message.reasoning_content }),
1445
+ message?.content !== null && message?.content !== void 0 && message.content.length > 0 && (() => {
1446
+ const hasReasoningField = message.reasoning_content !== null && message.reasoning_content !== void 0 && message.reasoning_content.length > 0;
1447
+ const { thinking, remainingText } = extractThinkingFromContent(message.content);
1448
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
1449
+ thinking !== null && !hasReasoningField && /* @__PURE__ */ jsxRuntimeExports.jsx(ThinkingBlock, { thinking }),
1450
+ remainingText.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: remainingText }) })
1451
+ ] });
1452
+ })(),
1435
1453
  message?.function_call !== null && message?.function_call !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-blue-500/30 rounded-md p-3 bg-blue-500/5", children: [
1436
1454
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-blue-400 font-mono mb-1", children: "function_call" }),
1437
1455
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-mono text-xs", children: [