@mcpjam/inspector 0.3.7 → 0.3.9

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, S as SESSION_KEYS, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, I as InspectorOAuthClientProvider, a as auth } from "./index-BG-3VNs4.js";
1
+ import { u as useToast, r as reactExports, S as SESSION_KEYS, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, I as InspectorOAuthClientProvider, a as auth } from "./index-BT03cD-1.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-BG-3VNs4.js";
1
+ import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-BT03cD-1.js";
2
2
  const OAuthDebugCallback = ({ onConnect }) => {
3
3
  reactExports.useEffect(() => {
4
4
  let isProcessed = false;
@@ -34088,7 +34088,7 @@ const useTheme = () => {
34088
34088
  [theme, setThemeWithSideEffect]
34089
34089
  );
34090
34090
  };
34091
- const version$1 = "0.3.7";
34091
+ const version$1 = "0.3.9";
34092
34092
  var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
34093
34093
  createPopperScope
34094
34094
  ]);
@@ -39916,6 +39916,282 @@ const RootsTab = ({
39916
39916
  ] })
39917
39917
  ] });
39918
39918
  };
39919
+ var CHECKBOX_NAME = "Checkbox";
39920
+ var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
39921
+ var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
39922
+ function CheckboxProvider(props) {
39923
+ const {
39924
+ __scopeCheckbox,
39925
+ checked: checkedProp,
39926
+ children,
39927
+ defaultChecked,
39928
+ disabled,
39929
+ form,
39930
+ name,
39931
+ onCheckedChange,
39932
+ required: required2,
39933
+ value = "on",
39934
+ // @ts-expect-error
39935
+ internal_do_not_use_render
39936
+ } = props;
39937
+ const [checked, setChecked] = useControllableState({
39938
+ prop: checkedProp,
39939
+ defaultProp: defaultChecked ?? false,
39940
+ onChange: onCheckedChange,
39941
+ caller: CHECKBOX_NAME
39942
+ });
39943
+ const [control, setControl] = reactExports.useState(null);
39944
+ const [bubbleInput, setBubbleInput] = reactExports.useState(null);
39945
+ const hasConsumerStoppedPropagationRef = reactExports.useRef(false);
39946
+ const isFormControl = control ? !!form || !!control.closest("form") : (
39947
+ // We set this to true by default so that events bubble to forms without JS (SSR)
39948
+ true
39949
+ );
39950
+ const context = {
39951
+ checked,
39952
+ disabled,
39953
+ setChecked,
39954
+ control,
39955
+ setControl,
39956
+ name,
39957
+ form,
39958
+ value,
39959
+ hasConsumerStoppedPropagationRef,
39960
+ required: required2,
39961
+ defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,
39962
+ isFormControl,
39963
+ bubbleInput,
39964
+ setBubbleInput
39965
+ };
39966
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
39967
+ CheckboxProviderImpl,
39968
+ {
39969
+ scope: __scopeCheckbox,
39970
+ ...context,
39971
+ children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
39972
+ }
39973
+ );
39974
+ }
39975
+ var TRIGGER_NAME = "CheckboxTrigger";
39976
+ var CheckboxTrigger = reactExports.forwardRef(
39977
+ ({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
39978
+ const {
39979
+ control,
39980
+ value,
39981
+ disabled,
39982
+ checked,
39983
+ required: required2,
39984
+ setControl,
39985
+ setChecked,
39986
+ hasConsumerStoppedPropagationRef,
39987
+ isFormControl,
39988
+ bubbleInput
39989
+ } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);
39990
+ const composedRefs = useComposedRefs(forwardedRef, setControl);
39991
+ const initialCheckedStateRef = reactExports.useRef(checked);
39992
+ reactExports.useEffect(() => {
39993
+ const form = control == null ? void 0 : control.form;
39994
+ if (form) {
39995
+ const reset = () => setChecked(initialCheckedStateRef.current);
39996
+ form.addEventListener("reset", reset);
39997
+ return () => form.removeEventListener("reset", reset);
39998
+ }
39999
+ }, [control, setChecked]);
40000
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
40001
+ Primitive.button,
40002
+ {
40003
+ type: "button",
40004
+ role: "checkbox",
40005
+ "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
40006
+ "aria-required": required2,
40007
+ "data-state": getState(checked),
40008
+ "data-disabled": disabled ? "" : void 0,
40009
+ disabled,
40010
+ value,
40011
+ ...checkboxProps,
40012
+ ref: composedRefs,
40013
+ onKeyDown: composeEventHandlers(onKeyDown, (event) => {
40014
+ if (event.key === "Enter") event.preventDefault();
40015
+ }),
40016
+ onClick: composeEventHandlers(onClick, (event) => {
40017
+ setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked);
40018
+ if (bubbleInput && isFormControl) {
40019
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
40020
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
40021
+ }
40022
+ })
40023
+ }
40024
+ );
40025
+ }
40026
+ );
40027
+ CheckboxTrigger.displayName = TRIGGER_NAME;
40028
+ var Checkbox$1 = reactExports.forwardRef(
40029
+ (props, forwardedRef) => {
40030
+ const {
40031
+ __scopeCheckbox,
40032
+ name,
40033
+ checked,
40034
+ defaultChecked,
40035
+ required: required2,
40036
+ disabled,
40037
+ value,
40038
+ onCheckedChange,
40039
+ form,
40040
+ ...checkboxProps
40041
+ } = props;
40042
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
40043
+ CheckboxProvider,
40044
+ {
40045
+ __scopeCheckbox,
40046
+ checked,
40047
+ defaultChecked,
40048
+ disabled,
40049
+ required: required2,
40050
+ onCheckedChange,
40051
+ name,
40052
+ form,
40053
+ value,
40054
+ internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
40055
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
40056
+ CheckboxTrigger,
40057
+ {
40058
+ ...checkboxProps,
40059
+ ref: forwardedRef,
40060
+ __scopeCheckbox
40061
+ }
40062
+ ),
40063
+ isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
40064
+ CheckboxBubbleInput,
40065
+ {
40066
+ __scopeCheckbox
40067
+ }
40068
+ )
40069
+ ] })
40070
+ }
40071
+ );
40072
+ }
40073
+ );
40074
+ Checkbox$1.displayName = CHECKBOX_NAME;
40075
+ var INDICATOR_NAME = "CheckboxIndicator";
40076
+ var CheckboxIndicator = reactExports.forwardRef(
40077
+ (props, forwardedRef) => {
40078
+ const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
40079
+ const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
40080
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
40081
+ Presence,
40082
+ {
40083
+ present: forceMount || isIndeterminate(context.checked) || context.checked === true,
40084
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
40085
+ Primitive.span,
40086
+ {
40087
+ "data-state": getState(context.checked),
40088
+ "data-disabled": context.disabled ? "" : void 0,
40089
+ ...indicatorProps,
40090
+ ref: forwardedRef,
40091
+ style: { pointerEvents: "none", ...props.style }
40092
+ }
40093
+ )
40094
+ }
40095
+ );
40096
+ }
40097
+ );
40098
+ CheckboxIndicator.displayName = INDICATOR_NAME;
40099
+ var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
40100
+ var CheckboxBubbleInput = reactExports.forwardRef(
40101
+ ({ __scopeCheckbox, ...props }, forwardedRef) => {
40102
+ const {
40103
+ control,
40104
+ hasConsumerStoppedPropagationRef,
40105
+ checked,
40106
+ defaultChecked,
40107
+ required: required2,
40108
+ disabled,
40109
+ name,
40110
+ value,
40111
+ form,
40112
+ bubbleInput,
40113
+ setBubbleInput
40114
+ } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);
40115
+ const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
40116
+ const prevChecked = usePrevious(checked);
40117
+ const controlSize = useSize(control);
40118
+ reactExports.useEffect(() => {
40119
+ const input = bubbleInput;
40120
+ if (!input) return;
40121
+ const inputProto = window.HTMLInputElement.prototype;
40122
+ const descriptor = Object.getOwnPropertyDescriptor(
40123
+ inputProto,
40124
+ "checked"
40125
+ );
40126
+ const setChecked = descriptor.set;
40127
+ const bubbles = !hasConsumerStoppedPropagationRef.current;
40128
+ if (prevChecked !== checked && setChecked) {
40129
+ const event = new Event("click", { bubbles });
40130
+ input.indeterminate = isIndeterminate(checked);
40131
+ setChecked.call(input, isIndeterminate(checked) ? false : checked);
40132
+ input.dispatchEvent(event);
40133
+ }
40134
+ }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
40135
+ const defaultCheckedRef = reactExports.useRef(isIndeterminate(checked) ? false : checked);
40136
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
40137
+ Primitive.input,
40138
+ {
40139
+ type: "checkbox",
40140
+ "aria-hidden": true,
40141
+ defaultChecked: defaultChecked ?? defaultCheckedRef.current,
40142
+ required: required2,
40143
+ disabled,
40144
+ name,
40145
+ value,
40146
+ form,
40147
+ ...props,
40148
+ tabIndex: -1,
40149
+ ref: composedRefs,
40150
+ style: {
40151
+ ...props.style,
40152
+ ...controlSize,
40153
+ position: "absolute",
40154
+ pointerEvents: "none",
40155
+ opacity: 0,
40156
+ margin: 0,
40157
+ // We transform because the input is absolutely positioned but we have
40158
+ // rendered it **after** the button. This pulls it back to sit on top
40159
+ // of the button.
40160
+ transform: "translateX(-100%)"
40161
+ }
40162
+ }
40163
+ );
40164
+ }
40165
+ );
40166
+ CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
40167
+ function isFunction(value) {
40168
+ return typeof value === "function";
40169
+ }
40170
+ function isIndeterminate(checked) {
40171
+ return checked === "indeterminate";
40172
+ }
40173
+ function getState(checked) {
40174
+ return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
40175
+ }
40176
+ const Checkbox = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
40177
+ Checkbox$1,
40178
+ {
40179
+ ref: ref2,
40180
+ className: cn(
40181
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
40182
+ className
40183
+ ),
40184
+ ...props,
40185
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
40186
+ CheckboxIndicator,
40187
+ {
40188
+ className: cn("flex items-center justify-center text-current"),
40189
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "h-4 w-4" })
40190
+ }
40191
+ )
40192
+ }
40193
+ ));
40194
+ Checkbox.displayName = Checkbox$1.displayName;
39919
40195
  var lib = {};
39920
40196
  var hasRequiredLib;
39921
40197
  function requireLib() {
@@ -41993,24 +42269,17 @@ const DynamicJsonForm = ({
41993
42269
  const fieldValue = objectValue[fieldName];
41994
42270
  const fieldRequired2 = isFieldRequired([fieldName]);
41995
42271
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
41996
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
41997
- "label",
41998
- {
41999
- htmlFor: fieldName,
42000
- className: "block text-sm font-medium",
42001
- children: [
42002
- fieldSchema.title || fieldName,
42003
- fieldRequired2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
42004
- ]
42005
- }
42006
- ),
42007
- fieldSchema.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-500", children: fieldSchema.description }),
42008
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: renderFieldInput(
42272
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Label, { htmlFor: fieldName, className: "text-sm font-medium", children: [
42273
+ fieldSchema.title || fieldName,
42274
+ fieldRequired2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-destructive ml-1", children: "*" })
42275
+ ] }),
42276
+ fieldSchema.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground", children: fieldSchema.description }),
42277
+ renderFieldInput(
42009
42278
  fieldSchema,
42010
42279
  fieldValue,
42011
42280
  fieldPath,
42012
42281
  fieldRequired2
42013
- ) })
42282
+ )
42014
42283
  ] }, fieldName);
42015
42284
  }
42016
42285
  ) });
@@ -42023,25 +42292,22 @@ const DynamicJsonForm = ({
42023
42292
  case "string": {
42024
42293
  if (propSchema.enum) {
42025
42294
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
42026
- "select",
42295
+ Select,
42027
42296
  {
42028
42297
  value: currentValue ?? "",
42029
- onChange: (e) => {
42030
- const val = e.target.value;
42298
+ onValueChange: (val) => {
42031
42299
  if (!val && !fieldRequired) {
42032
42300
  handleFieldChange(path2, void 0);
42033
42301
  } else {
42034
42302
  handleFieldChange(path2, val);
42035
42303
  }
42036
42304
  },
42037
- required: fieldRequired,
42038
- 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",
42039
42305
  children: [
42040
- /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
42041
- propSchema.enum.map((option, index2) => {
42306
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select an option..." }) }),
42307
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: propSchema.enum.map((option, index2) => {
42042
42308
  var _a2;
42043
- return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: ((_a2 = propSchema.enumNames) == null ? void 0 : _a2[index2]) || option }, option);
42044
- })
42309
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: option, children: ((_a2 = propSchema.enumNames) == null ? void 0 : _a2[index2]) || option }, option);
42310
+ }) })
42045
42311
  ]
42046
42312
  }
42047
42313
  );
@@ -42135,506 +42401,224 @@ const DynamicJsonForm = ({
42135
42401
  case "boolean":
42136
42402
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
42137
42403
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42138
- Input,
42404
+ Checkbox,
42139
42405
  {
42140
- type: "checkbox",
42141
42406
  checked: currentValue ?? false,
42142
- onChange: (e) => handleFieldChange(path2, e.target.checked),
42143
- className: "w-4 h-4",
42407
+ onCheckedChange: (checked) => handleFieldChange(path2, checked),
42144
42408
  required: fieldRequired
42145
42409
  }
42146
42410
  ),
42147
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm", children: propSchema.description || "Enable this option" })
42148
- ] });
42149
- default:
42150
- return null;
42151
- }
42152
- };
42153
- const handleFieldChange = (path2, fieldValue) => {
42154
- if (path2.length === 0) {
42155
- onChange(fieldValue);
42156
- return;
42157
- }
42158
- try {
42159
- const newValue = updateValueAtPath(value, path2, fieldValue);
42160
- onChange(newValue);
42161
- } catch (error) {
42162
- console.error("Failed to update form value:", error);
42163
- onChange(value);
42164
- }
42165
- };
42166
- const shouldUseJsonMode = schema.type === "object" && (!schema.properties || Object.keys(schema.properties).length === 0);
42167
- reactExports.useEffect(() => {
42168
- if (shouldUseJsonMode && !isJsonMode) {
42169
- setIsJsonMode(true);
42170
- }
42171
- }, [shouldUseJsonMode, isJsonMode]);
42172
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
42173
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end space-x-2", children: [
42174
- isJsonMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
42175
- Button,
42176
- {
42177
- type: "button",
42178
- variant: "outline",
42179
- size: "sm",
42180
- onClick: formatJson,
42181
- children: "Format JSON"
42182
- }
42183
- ),
42184
- !isOnlyJSON && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", size: "sm", onClick: handleSwitchToFormMode, children: isJsonMode ? "Switch to Form" : "Switch to JSON" })
42185
- ] }),
42186
- isJsonMode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
42187
- JsonEditor,
42188
- {
42189
- value: rawJsonValue,
42190
- onChange: (newValue) => {
42191
- setRawJsonValue(newValue);
42192
- debouncedUpdateParent(newValue);
42193
- },
42194
- error: jsonError
42195
- }
42196
- ) : (
42197
- // If schema type is object but value is not an object or is empty, and we have actual JSON data,
42198
- // render a simple representation of the JSON data
42199
- 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: [
42200
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Form view not available for this JSON structure. Using simplified view:" }),
42201
- /* @__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 }),
42202
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Use JSON mode for full editing capabilities." })
42203
- ] }) : renderFormFields(schema, value)
42204
- )
42205
- ] });
42206
- };
42207
- const SamplingRequest = ({
42208
- onApprove,
42209
- request,
42210
- onReject
42211
- }) => {
42212
- var _a2;
42213
- const { toast: toast2 } = useToast();
42214
- const [messageResult, setMessageResult] = reactExports.useState({
42215
- model: "stub-model",
42216
- stopReason: "endTurn",
42217
- role: "assistant",
42218
- content: {
42219
- type: "text",
42220
- text: ""
42221
- }
42222
- });
42223
- const contentType = (_a2 = messageResult == null ? void 0 : messageResult.content) == null ? void 0 : _a2.type;
42224
- const schema = reactExports.useMemo(() => {
42225
- const s = {
42226
- type: "object",
42227
- description: "Message result",
42228
- properties: {
42229
- model: {
42230
- type: "string",
42231
- default: "stub-model",
42232
- description: "model name"
42233
- },
42234
- stopReason: {
42235
- type: "string",
42236
- default: "endTurn",
42237
- description: "Stop reason"
42238
- },
42239
- role: {
42240
- type: "string",
42241
- default: "endTurn",
42242
- description: "Role of the model"
42243
- },
42244
- content: {
42245
- type: "object",
42246
- properties: {
42247
- type: {
42248
- type: "string",
42249
- default: "text",
42250
- description: "Type of content"
42251
- }
42252
- }
42253
- }
42254
- }
42255
- };
42256
- if (contentType === "text" && s.properties) {
42257
- s.properties.content.properties = {
42258
- ...s.properties.content.properties,
42259
- text: {
42260
- type: "string",
42261
- default: "",
42262
- description: "text content"
42263
- }
42264
- };
42265
- setMessageResult((prev) => ({
42266
- ...prev,
42267
- content: {
42268
- type: contentType,
42269
- text: ""
42270
- }
42271
- }));
42272
- } else if (contentType === "image" && s.properties) {
42273
- s.properties.content.properties = {
42274
- ...s.properties.content.properties,
42275
- data: {
42276
- type: "string",
42277
- default: "",
42278
- description: "Base64 encoded image data"
42279
- },
42280
- mimeType: {
42281
- type: "string",
42282
- default: "",
42283
- description: "Mime type of the image"
42284
- }
42285
- };
42286
- setMessageResult((prev) => ({
42287
- ...prev,
42288
- content: {
42289
- type: contentType,
42290
- data: "",
42291
- mimeType: ""
42292
- }
42293
- }));
42294
- }
42295
- return s;
42296
- }, [contentType]);
42297
- const handleApprove = (id2) => {
42298
- const validationResult = CreateMessageResultSchema.safeParse(messageResult);
42299
- if (!validationResult.success) {
42300
- toast2({
42301
- title: "Error",
42302
- description: `There was an error validating the message result: ${validationResult.error.message}`,
42303
- variant: "destructive"
42304
- });
42411
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { className: "text-sm", children: propSchema.description || "Enable this option" })
42412
+ ] });
42413
+ default:
42414
+ return null;
42415
+ }
42416
+ };
42417
+ const handleFieldChange = (path2, fieldValue) => {
42418
+ if (path2.length === 0) {
42419
+ onChange(fieldValue);
42305
42420
  return;
42306
42421
  }
42307
- onApprove(id2, validationResult.data);
42422
+ try {
42423
+ const newValue = updateValueAtPath(value, path2, fieldValue);
42424
+ onChange(newValue);
42425
+ } catch (error) {
42426
+ console.error("Failed to update form value:", error);
42427
+ onChange(value);
42428
+ }
42308
42429
  };
42309
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
42310
- "div",
42311
- {
42312
- "data-testid": "sampling-request",
42313
- className: "flex gap-4 p-4 border rounded-lg space-y-4",
42314
- children: [
42315
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 bg-gray-50 dark:bg-gray-800 dark:text-gray-100 p-2 rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: JSON.stringify(request.request) }) }),
42316
- /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { className: "flex-1 space-y-4", children: [
42317
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42318
- DynamicJsonForm,
42319
- {
42320
- schema,
42321
- value: messageResult,
42322
- onChange: (newValue) => {
42323
- setMessageResult(newValue);
42324
- }
42325
- }
42326
- ) }),
42327
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-2 mt-1", children: [
42328
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "button", onClick: () => handleApprove(request.id), children: "Approve" }),
42329
- /* @__PURE__ */ jsxRuntimeExports.jsx(
42330
- Button,
42331
- {
42332
- type: "button",
42333
- variant: "outline",
42334
- onClick: () => onReject(request.id),
42335
- children: "Reject"
42336
- }
42337
- )
42338
- ] })
42339
- ] })
42340
- ]
42430
+ const shouldUseJsonMode = schema.type === "object" && (!schema.properties || Object.keys(schema.properties).length === 0);
42431
+ reactExports.useEffect(() => {
42432
+ if (shouldUseJsonMode && !isJsonMode) {
42433
+ setIsJsonMode(true);
42341
42434
  }
42342
- );
42343
- };
42344
- const SamplingTab = ({ pendingRequests, onApprove, onReject }) => {
42345
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-96", children: [
42346
- /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "When the server requests LLM sampling, requests will appear here for approval." }) }),
42347
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 space-y-4", children: [
42348
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold", children: "Recent Requests" }),
42349
- pendingRequests.map((request) => /* @__PURE__ */ jsxRuntimeExports.jsx(
42350
- SamplingRequest,
42435
+ }, [shouldUseJsonMode, isJsonMode]);
42436
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
42437
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end gap-2", children: [
42438
+ isJsonMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
42439
+ Button,
42351
42440
  {
42352
- request,
42353
- onApprove,
42354
- onReject
42441
+ type: "button",
42442
+ variant: "outline",
42443
+ size: "sm",
42444
+ onClick: formatJson,
42445
+ children: "Format JSON"
42446
+ }
42447
+ ),
42448
+ !isOnlyJSON && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", size: "sm", onClick: handleSwitchToFormMode, children: isJsonMode ? "Switch to Form" : "Switch to JSON" })
42449
+ ] }),
42450
+ isJsonMode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
42451
+ JsonEditor,
42452
+ {
42453
+ value: rawJsonValue,
42454
+ onChange: (newValue) => {
42455
+ setRawJsonValue(newValue);
42456
+ debouncedUpdateParent(newValue);
42355
42457
  },
42356
- request.id
42357
- )),
42358
- pendingRequests.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: "No pending requests" })
42359
- ] })
42458
+ error: jsonError
42459
+ }
42460
+ ) : schema.type === "object" && (typeof value !== "object" || value === null || Object.keys(value).length === 0) && rawJsonValue && rawJsonValue !== "{}" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3 border rounded-md p-4 bg-muted/50", children: [
42461
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Form view not available for this JSON structure. Using simplified view:" }),
42462
+ /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "bg-background border rounded p-3 text-sm overflow-auto", children: rawJsonValue }),
42463
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "Use JSON mode for full editing capabilities." })
42464
+ ] }) : renderFormFields(schema, value)
42360
42465
  ] });
42361
42466
  };
42362
- var CHECKBOX_NAME = "Checkbox";
42363
- var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
42364
- var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
42365
- function CheckboxProvider(props) {
42366
- const {
42367
- __scopeCheckbox,
42368
- checked: checkedProp,
42369
- children,
42370
- defaultChecked,
42371
- disabled,
42372
- form,
42373
- name,
42374
- onCheckedChange,
42375
- required: required2,
42376
- value = "on",
42377
- // @ts-expect-error
42378
- internal_do_not_use_render
42379
- } = props;
42380
- const [checked, setChecked] = useControllableState({
42381
- prop: checkedProp,
42382
- defaultProp: defaultChecked ?? false,
42383
- onChange: onCheckedChange,
42384
- caller: CHECKBOX_NAME
42385
- });
42386
- const [control, setControl] = reactExports.useState(null);
42387
- const [bubbleInput, setBubbleInput] = reactExports.useState(null);
42388
- const hasConsumerStoppedPropagationRef = reactExports.useRef(false);
42389
- const isFormControl = control ? !!form || !!control.closest("form") : (
42390
- // We set this to true by default so that events bubble to forms without JS (SSR)
42391
- true
42392
- );
42393
- const context = {
42394
- checked,
42395
- disabled,
42396
- setChecked,
42397
- control,
42398
- setControl,
42399
- name,
42400
- form,
42401
- value,
42402
- hasConsumerStoppedPropagationRef,
42403
- required: required2,
42404
- defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,
42405
- isFormControl,
42406
- bubbleInput,
42407
- setBubbleInput
42408
- };
42409
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
42410
- CheckboxProviderImpl,
42411
- {
42412
- scope: __scopeCheckbox,
42413
- ...context,
42414
- children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
42467
+ const SamplingRequest = ({
42468
+ onApprove,
42469
+ request,
42470
+ onReject
42471
+ }) => {
42472
+ var _a2;
42473
+ const { toast: toast2 } = useToast();
42474
+ const [messageResult, setMessageResult] = reactExports.useState({
42475
+ model: "stub-model",
42476
+ stopReason: "endTurn",
42477
+ role: "assistant",
42478
+ content: {
42479
+ type: "text",
42480
+ text: ""
42415
42481
  }
42416
- );
42417
- }
42418
- var TRIGGER_NAME = "CheckboxTrigger";
42419
- var CheckboxTrigger = reactExports.forwardRef(
42420
- ({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
42421
- const {
42422
- control,
42423
- value,
42424
- disabled,
42425
- checked,
42426
- required: required2,
42427
- setControl,
42428
- setChecked,
42429
- hasConsumerStoppedPropagationRef,
42430
- isFormControl,
42431
- bubbleInput
42432
- } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);
42433
- const composedRefs = useComposedRefs(forwardedRef, setControl);
42434
- const initialCheckedStateRef = reactExports.useRef(checked);
42435
- reactExports.useEffect(() => {
42436
- const form = control == null ? void 0 : control.form;
42437
- if (form) {
42438
- const reset = () => setChecked(initialCheckedStateRef.current);
42439
- form.addEventListener("reset", reset);
42440
- return () => form.removeEventListener("reset", reset);
42441
- }
42442
- }, [control, setChecked]);
42443
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
42444
- Primitive.button,
42445
- {
42446
- type: "button",
42447
- role: "checkbox",
42448
- "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
42449
- "aria-required": required2,
42450
- "data-state": getState(checked),
42451
- "data-disabled": disabled ? "" : void 0,
42452
- disabled,
42453
- value,
42454
- ...checkboxProps,
42455
- ref: composedRefs,
42456
- onKeyDown: composeEventHandlers(onKeyDown, (event) => {
42457
- if (event.key === "Enter") event.preventDefault();
42458
- }),
42459
- onClick: composeEventHandlers(onClick, (event) => {
42460
- setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked);
42461
- if (bubbleInput && isFormControl) {
42462
- hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
42463
- if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
42464
- }
42465
- })
42466
- }
42467
- );
42468
- }
42469
- );
42470
- CheckboxTrigger.displayName = TRIGGER_NAME;
42471
- var Checkbox$1 = reactExports.forwardRef(
42472
- (props, forwardedRef) => {
42473
- const {
42474
- __scopeCheckbox,
42475
- name,
42476
- checked,
42477
- defaultChecked,
42478
- required: required2,
42479
- disabled,
42480
- value,
42481
- onCheckedChange,
42482
- form,
42483
- ...checkboxProps
42484
- } = props;
42485
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
42486
- CheckboxProvider,
42487
- {
42488
- __scopeCheckbox,
42489
- checked,
42490
- defaultChecked,
42491
- disabled,
42492
- required: required2,
42493
- onCheckedChange,
42494
- name,
42495
- form,
42496
- value,
42497
- internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
42498
- /* @__PURE__ */ jsxRuntimeExports.jsx(
42499
- CheckboxTrigger,
42500
- {
42501
- ...checkboxProps,
42502
- ref: forwardedRef,
42503
- __scopeCheckbox
42504
- }
42505
- ),
42506
- isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
42507
- CheckboxBubbleInput,
42508
- {
42509
- __scopeCheckbox
42482
+ });
42483
+ const contentType = (_a2 = messageResult == null ? void 0 : messageResult.content) == null ? void 0 : _a2.type;
42484
+ const schema = reactExports.useMemo(() => {
42485
+ const s = {
42486
+ type: "object",
42487
+ description: "Message result",
42488
+ properties: {
42489
+ model: {
42490
+ type: "string",
42491
+ default: "stub-model",
42492
+ description: "model name"
42493
+ },
42494
+ stopReason: {
42495
+ type: "string",
42496
+ default: "endTurn",
42497
+ description: "Stop reason"
42498
+ },
42499
+ role: {
42500
+ type: "string",
42501
+ default: "endTurn",
42502
+ description: "Role of the model"
42503
+ },
42504
+ content: {
42505
+ type: "object",
42506
+ properties: {
42507
+ type: {
42508
+ type: "string",
42509
+ default: "text",
42510
+ description: "Type of content"
42510
42511
  }
42511
- )
42512
- ] })
42513
- }
42514
- );
42515
- }
42516
- );
42517
- Checkbox$1.displayName = CHECKBOX_NAME;
42518
- var INDICATOR_NAME = "CheckboxIndicator";
42519
- var CheckboxIndicator = reactExports.forwardRef(
42520
- (props, forwardedRef) => {
42521
- const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
42522
- const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
42523
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
42524
- Presence,
42525
- {
42526
- present: forceMount || isIndeterminate(context.checked) || context.checked === true,
42527
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42528
- Primitive.span,
42529
- {
42530
- "data-state": getState(context.checked),
42531
- "data-disabled": context.disabled ? "" : void 0,
42532
- ...indicatorProps,
42533
- ref: forwardedRef,
42534
- style: { pointerEvents: "none", ...props.style }
42535
42512
  }
42536
- )
42537
- }
42538
- );
42539
- }
42540
- );
42541
- CheckboxIndicator.displayName = INDICATOR_NAME;
42542
- var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
42543
- var CheckboxBubbleInput = reactExports.forwardRef(
42544
- ({ __scopeCheckbox, ...props }, forwardedRef) => {
42545
- const {
42546
- control,
42547
- hasConsumerStoppedPropagationRef,
42548
- checked,
42549
- defaultChecked,
42550
- required: required2,
42551
- disabled,
42552
- name,
42553
- value,
42554
- form,
42555
- bubbleInput,
42556
- setBubbleInput
42557
- } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);
42558
- const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
42559
- const prevChecked = usePrevious(checked);
42560
- const controlSize = useSize(control);
42561
- reactExports.useEffect(() => {
42562
- const input = bubbleInput;
42563
- if (!input) return;
42564
- const inputProto = window.HTMLInputElement.prototype;
42565
- const descriptor = Object.getOwnPropertyDescriptor(
42566
- inputProto,
42567
- "checked"
42568
- );
42569
- const setChecked = descriptor.set;
42570
- const bubbles = !hasConsumerStoppedPropagationRef.current;
42571
- if (prevChecked !== checked && setChecked) {
42572
- const event = new Event("click", { bubbles });
42573
- input.indeterminate = isIndeterminate(checked);
42574
- setChecked.call(input, isIndeterminate(checked) ? false : checked);
42575
- input.dispatchEvent(event);
42576
- }
42577
- }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
42578
- const defaultCheckedRef = reactExports.useRef(isIndeterminate(checked) ? false : checked);
42579
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
42580
- Primitive.input,
42581
- {
42582
- type: "checkbox",
42583
- "aria-hidden": true,
42584
- defaultChecked: defaultChecked ?? defaultCheckedRef.current,
42585
- required: required2,
42586
- disabled,
42587
- name,
42588
- value,
42589
- form,
42590
- ...props,
42591
- tabIndex: -1,
42592
- ref: composedRefs,
42593
- style: {
42594
- ...props.style,
42595
- ...controlSize,
42596
- position: "absolute",
42597
- pointerEvents: "none",
42598
- opacity: 0,
42599
- margin: 0,
42600
- // We transform because the input is absolutely positioned but we have
42601
- // rendered it **after** the button. This pulls it back to sit on top
42602
- // of the button.
42603
- transform: "translateX(-100%)"
42604
42513
  }
42605
42514
  }
42606
- );
42607
- }
42608
- );
42609
- CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME;
42610
- function isFunction(value) {
42611
- return typeof value === "function";
42612
- }
42613
- function isIndeterminate(checked) {
42614
- return checked === "indeterminate";
42615
- }
42616
- function getState(checked) {
42617
- return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
42618
- }
42619
- const Checkbox = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
42620
- Checkbox$1,
42621
- {
42622
- ref: ref2,
42623
- className: cn(
42624
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
42625
- className
42626
- ),
42627
- ...props,
42628
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42629
- CheckboxIndicator,
42630
- {
42631
- className: cn("flex items-center justify-center text-current"),
42632
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "h-4 w-4" })
42633
- }
42634
- )
42635
- }
42636
- ));
42637
- Checkbox.displayName = Checkbox$1.displayName;
42515
+ };
42516
+ if (contentType === "text" && s.properties) {
42517
+ s.properties.content.properties = {
42518
+ ...s.properties.content.properties,
42519
+ text: {
42520
+ type: "string",
42521
+ default: "",
42522
+ description: "text content"
42523
+ }
42524
+ };
42525
+ setMessageResult((prev) => ({
42526
+ ...prev,
42527
+ content: {
42528
+ type: contentType,
42529
+ text: ""
42530
+ }
42531
+ }));
42532
+ } else if (contentType === "image" && s.properties) {
42533
+ s.properties.content.properties = {
42534
+ ...s.properties.content.properties,
42535
+ data: {
42536
+ type: "string",
42537
+ default: "",
42538
+ description: "Base64 encoded image data"
42539
+ },
42540
+ mimeType: {
42541
+ type: "string",
42542
+ default: "",
42543
+ description: "Mime type of the image"
42544
+ }
42545
+ };
42546
+ setMessageResult((prev) => ({
42547
+ ...prev,
42548
+ content: {
42549
+ type: contentType,
42550
+ data: "",
42551
+ mimeType: ""
42552
+ }
42553
+ }));
42554
+ }
42555
+ return s;
42556
+ }, [contentType]);
42557
+ const handleApprove = (id2) => {
42558
+ const validationResult = CreateMessageResultSchema.safeParse(messageResult);
42559
+ if (!validationResult.success) {
42560
+ toast2({
42561
+ title: "Error",
42562
+ description: `There was an error validating the message result: ${validationResult.error.message}`,
42563
+ variant: "destructive"
42564
+ });
42565
+ return;
42566
+ }
42567
+ onApprove(id2, validationResult.data);
42568
+ };
42569
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
42570
+ "div",
42571
+ {
42572
+ "data-testid": "sampling-request",
42573
+ className: "flex gap-4 p-4 border rounded-lg space-y-4",
42574
+ children: [
42575
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 bg-gray-50 dark:bg-gray-800 dark:text-gray-100 p-2 rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: JSON.stringify(request.request) }) }),
42576
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { className: "flex-1 space-y-4", children: [
42577
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42578
+ DynamicJsonForm,
42579
+ {
42580
+ schema,
42581
+ value: messageResult,
42582
+ onChange: (newValue) => {
42583
+ setMessageResult(newValue);
42584
+ }
42585
+ }
42586
+ ) }),
42587
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex space-x-2 mt-1", children: [
42588
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "button", onClick: () => handleApprove(request.id), children: "Approve" }),
42589
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
42590
+ Button,
42591
+ {
42592
+ type: "button",
42593
+ variant: "outline",
42594
+ onClick: () => onReject(request.id),
42595
+ children: "Reject"
42596
+ }
42597
+ )
42598
+ ] })
42599
+ ] })
42600
+ ]
42601
+ }
42602
+ );
42603
+ };
42604
+ const SamplingTab = ({ pendingRequests, onApprove, onReject }) => {
42605
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-96", children: [
42606
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "When the server requests LLM sampling, requests will appear here for approval." }) }),
42607
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 space-y-4", children: [
42608
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold", children: "Recent Requests" }),
42609
+ pendingRequests.map((request) => /* @__PURE__ */ jsxRuntimeExports.jsx(
42610
+ SamplingRequest,
42611
+ {
42612
+ request,
42613
+ onApprove,
42614
+ onReject
42615
+ },
42616
+ request.id
42617
+ )),
42618
+ pendingRequests.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-500", children: "No pending requests" })
42619
+ ] })
42620
+ ] });
42621
+ };
42638
42622
  function generateRequestId() {
42639
42623
  return `req_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
42640
42624
  }
@@ -52101,7 +52085,7 @@ class Client extends Protocol {
52101
52085
  return this.notification({ method: "notifications/roots/list_changed" });
52102
52086
  }
52103
52087
  }
52104
- const version = "0.3.7";
52088
+ const version = "0.3.9";
52105
52089
  const packageJson = {
52106
52090
  version
52107
52091
  };
@@ -62208,10 +62192,10 @@ const ElicitationModal = ({ request, onClose }) => {
62208
62192
  const schemaDescription = request.requestedSchema.description;
62209
62193
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: true, onOpenChange: handleCancel, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { className: "max-w-2xl max-h-[80vh] overflow-y-auto", children: [
62210
62194
  /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogHeader, { children: [
62211
- /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { children: schemaTitle }),
62212
- /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogDescription, { className: "space-y-2", children: [
62213
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block", children: request.message }),
62214
- schemaDescription && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block text-sm text-muted-foreground", children: schemaDescription })
62195
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "text-lg font-semibold", children: schemaTitle }),
62196
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogDescription, { className: "text-sm", children: [
62197
+ request.message,
62198
+ schemaDescription && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-xs text-muted-foreground", children: schemaDescription })
62215
62199
  ] })
62216
62200
  ] }),
62217
62201
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "py-4", children: [
@@ -62226,10 +62210,9 @@ const ElicitationModal = ({ request, onClose }) => {
62226
62210
  }
62227
62211
  }
62228
62212
  ),
62229
- 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: [
62230
- /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Validation Error:" }),
62231
- " ",
62232
- validationError
62213
+ validationError && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 p-3 bg-destructive/10 border border-destructive/20 rounded-md", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2", children: [
62214
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4 text-destructive mt-0.5 flex-shrink-0" }),
62215
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-destructive", children: validationError })
62233
62216
  ] }) })
62234
62217
  ] }),
62235
62218
  /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: "gap-2", children: [
@@ -62789,7 +62772,7 @@ const __vitePreload = function preload(baseModule, deps, importerUrl) {
62789
62772
  });
62790
62773
  };
62791
62774
  const renderOAuthCallback = (onOAuthConnect) => {
62792
- const OAuthCallback = React.lazy(() => __vitePreload(() => import("./OAuthCallback-CEBEd-Vt.js"), true ? [] : void 0));
62775
+ const OAuthCallback = React.lazy(() => __vitePreload(() => import("./OAuthCallback-BSOXmPlE.js"), true ? [] : void 0));
62793
62776
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
62794
62777
  reactExports.Suspense,
62795
62778
  {
@@ -62803,7 +62786,7 @@ const renderOAuthCallback = (onOAuthConnect) => {
62803
62786
  };
62804
62787
  const renderOAuthDebugCallback = (onOAuthDebugConnect) => {
62805
62788
  const OAuthDebugCallback = React.lazy(
62806
- () => __vitePreload(() => import("./OAuthDebugCallback-D-raj6yP.js"), true ? [] : void 0)
62789
+ () => __vitePreload(() => import("./OAuthDebugCallback-DyzqkofK.js"), true ? [] : void 0)
62807
62790
  );
62808
62791
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
62809
62792
  reactExports.Suspense,
@@ -1779,6 +1779,9 @@ video {
1779
1779
  .border-destructive {
1780
1780
  border-color: hsl(var(--destructive));
1781
1781
  }
1782
+ .border-destructive\/20 {
1783
+ border-color: hsl(var(--destructive) / 0.2);
1784
+ }
1782
1785
  .border-destructive\/50 {
1783
1786
  border-color: hsl(var(--destructive) / 0.5);
1784
1787
  }
@@ -1899,6 +1902,9 @@ video {
1899
1902
  .bg-destructive {
1900
1903
  background-color: hsl(var(--destructive));
1901
1904
  }
1905
+ .bg-destructive\/10 {
1906
+ background-color: hsl(var(--destructive) / 0.1);
1907
+ }
1902
1908
  .bg-emerald-500 {
1903
1909
  --tw-bg-opacity: 1;
1904
1910
  background-color: rgb(16 185 129 / var(--tw-bg-opacity, 1));
@@ -2746,8 +2752,6 @@ video {
2746
2752
  font-weight: 400;
2747
2753
 
2748
2754
  color-scheme: light dark;
2749
- color: rgba(255, 255, 255, 0.87);
2750
- background-color: #242424;
2751
2755
 
2752
2756
  font-synthesis: none;
2753
2757
  text-rendering: optimizeLegibility;
@@ -2777,10 +2781,6 @@ h1 {
2777
2781
  }
2778
2782
 
2779
2783
  @media (prefers-color-scheme: light) {
2780
- :root {
2781
- color: #213547;
2782
- background-color: #ffffff;
2783
- }
2784
2784
  a:hover {
2785
2785
  color: #747bff;
2786
2786
  }
@@ -3621,10 +3621,6 @@ h1 {
3621
3621
  background-color: rgb(5 46 22 / 0.3);
3622
3622
  }
3623
3623
 
3624
- .dark\:bg-red-900\/20:is(.dark *) {
3625
- background-color: rgb(127 29 29 / 0.2);
3626
- }
3627
-
3628
3624
  .dark\:bg-red-950\/20:is(.dark *) {
3629
3625
  background-color: rgb(69 10 10 / 0.2);
3630
3626
  }
@@ -5,8 +5,8 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/mcp_jam.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>MCPJam Inspector</title>
8
- <script type="module" crossorigin src="/assets/index-BG-3VNs4.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-CWDemo1t.css">
8
+ <script type="module" crossorigin src="/assets/index-BT03cD-1.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-Bwd_BFIj.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": "@mcpjam/inspector",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "MCPJam inspector",
5
5
  "license": "Apache-2.0",
6
6
  "author": "MCPJam (https://mcpjam.com)",
@@ -44,6 +44,7 @@
44
44
  "dependencies": {
45
45
  "@anthropic-ai/sdk": "^0.52.0",
46
46
  "@heroicons/react": "^2.2.0",
47
+ "@libsql/client": "^0.14.0",
47
48
  "@mcpjam/inspector-cli": "^0.1.6",
48
49
  "@mcpjam/inspector-client": "^0.1.6",
49
50
  "@mcpjam/inspector-server": "^0.1.6",