Skip to content

Commit 04e2491

Browse files
authored
Merge branch 'main' into patch-2
2 parents 5ad2c3c + f19b382 commit 04e2491

File tree

11 files changed

+34
-10
lines changed

11 files changed

+34
-10
lines changed

client/bin/client.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,34 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
99
const distPath = join(__dirname, "../dist");
1010

1111
const server = http.createServer((request, response) => {
12-
return handler(request, response, {
12+
const handlerOptions = {
1313
public: distPath,
1414
rewrites: [{ source: "/**", destination: "/index.html" }],
15-
});
15+
headers: [
16+
{
17+
// Ensure index.html is never cached
18+
source: "index.html",
19+
headers: [
20+
{
21+
key: "Cache-Control",
22+
value: "no-cache, no-store, max-age=0",
23+
},
24+
],
25+
},
26+
{
27+
// Allow long-term caching for hashed assets
28+
source: "assets/**",
29+
headers: [
30+
{
31+
key: "Cache-Control",
32+
value: "public, max-age=31536000, immutable",
33+
},
34+
],
35+
},
36+
],
37+
};
38+
39+
return handler(request, response, handlerOptions);
1640
});
1741

1842
const port = process.env.PORT || 6274;

client/src/components/JsonView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { JsonValue } from "@/utils/jsonUtils";
33
import clsx from "clsx";
44
import { Copy, CheckCheck } from "lucide-react";
55
import { Button } from "@/components/ui/button";
6-
import { useToast } from "@/hooks/use-toast";
6+
import { useToast } from "@/lib/hooks/useToast";
77
import { getDataType, tryParseJson } from "@/utils/jsonUtils";
88

99
interface JsonViewProps {

client/src/components/OAuthCallback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useRef } from "react";
22
import { InspectorOAuthClientProvider } from "../lib/auth";
33
import { SESSION_KEYS } from "../lib/constants";
44
import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
5-
import { useToast } from "@/hooks/use-toast.ts";
5+
import { useToast } from "@/lib/hooks/useToast";
66
import {
77
generateOAuthErrorDescription,
88
parseOAuthCallbackParams,

client/src/components/SamplingRequest.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from "@modelcontextprotocol/sdk/types.js";
88
import { PendingRequest } from "./SamplingTab";
99
import DynamicJsonForm from "./DynamicJsonForm";
10-
import { useToast } from "@/hooks/use-toast";
10+
import { useToast } from "@/lib/hooks/useToast";
1111
import { JsonSchemaType, JsonValue } from "@/utils/jsonUtils";
1212

1313
export type SamplingRequestProps = {

client/src/components/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
} from "@modelcontextprotocol/sdk/types.js";
3030
import { InspectorConfig } from "@/lib/configurationTypes";
3131
import { ConnectionStatus } from "@/lib/constants";
32-
import useTheme from "../lib/useTheme";
32+
import useTheme from "../lib/hooks/useTheme";
3333
import { version } from "../../../package.json";
3434
import {
3535
Tooltip,

client/src/components/__tests__/Sidebar.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { InspectorConfig } from "@/lib/configurationTypes";
77
import { TooltipProvider } from "@/components/ui/tooltip";
88

99
// Mock theme hook
10-
jest.mock("../../lib/useTheme", () => ({
10+
jest.mock("../../lib/hooks/useTheme", () => ({
1111
__esModule: true,
1212
default: () => ["light", jest.fn()],
1313
}));

client/src/components/ui/toaster.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useToast } from "@/hooks/use-toast";
1+
import { useToast } from "@/lib/hooks/useToast";
22
import {
33
Toast,
44
ToastClose,

client/src/lib/hooks/__tests__/useConnection.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jest.mock("@modelcontextprotocol/sdk/client/auth.js", () => ({
3737
}));
3838

3939
// Mock the toast hook
40-
jest.mock("@/hooks/use-toast", () => ({
40+
jest.mock("@/lib/hooks/useToast", () => ({
4141
useToast: () => ({
4242
toast: jest.fn(),
4343
}),

client/src/lib/hooks/useConnection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
} from "@modelcontextprotocol/sdk/types.js";
2828
import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
2929
import { useState } from "react";
30-
import { useToast } from "@/hooks/use-toast";
30+
import { useToast } from "@/lib/hooks/useToast";
3131
import { z } from "zod";
3232
import { ConnectionStatus } from "../constants";
3333
import { Notification, StdErrNotificationSchema } from "../notificationTypes";
File renamed without changes.

0 commit comments

Comments
 (0)