Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app-bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ import {
} from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod/v4";

import { App } from "./app";
import { LATEST_PROTOCOL_VERSION } from "./types";
import { App } from "./app.js";
import { LATEST_PROTOCOL_VERSION } from "./types.js";
import {
AppBridge,
buildAllowAttribute,
getToolUiResourceUri,
isToolVisibilityModelOnly,
isToolVisibilityAppOnly,
type McpUiHostCapabilities,
} from "./app-bridge";
} from "./app-bridge.js";

/** Wait for pending microtasks to complete */
const flush = () => new Promise((resolve) => setTimeout(resolve, 0));
Expand Down
12 changes: 6 additions & 6 deletions src/app-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {
ProtocolOptions,
RequestOptions,
} from "@modelcontextprotocol/sdk/shared/protocol.js";
import { ProtocolWithEvents } from "./events";
import { ProtocolWithEvents } from "./events.js";

import {
type AppNotification,
Expand Down Expand Up @@ -92,11 +92,11 @@ import {
McpUiRequestDisplayModeResult,
McpUiResourcePermissions,
McpUiToolMeta,
} from "./types";
export * from "./types";
export { RESOURCE_URI_META_KEY, RESOURCE_MIME_TYPE } from "./app";
import { RESOURCE_URI_META_KEY } from "./app";
export { PostMessageTransport } from "./message-transport";
} from "./types.js";
export * from "./types.js";
export { RESOURCE_URI_META_KEY, RESOURCE_MIME_TYPE } from "./app.js";
import { RESOURCE_URI_META_KEY } from "./app.js";
export { PostMessageTransport } from "./message-transport.js";

/**
* Extract UI resource URI from tool metadata.
Expand Down
18 changes: 9 additions & 9 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import {
ToolAnnotations,
ToolListChangedNotification,
} from "@modelcontextprotocol/sdk/types.js";
import { AppNotification, AppRequest, AppResult } from "./types";
import { ProtocolWithEvents } from "./events";
import { AppNotification, AppRequest, AppResult } from "./types.js";
import { ProtocolWithEvents } from "./events.js";
export { ProtocolWithEvents };
import { PostMessageTransport } from "./message-transport";
import { PostMessageTransport } from "./message-transport.js";
import {
LATEST_PROTOCOL_VERSION,
McpUiAppCapabilities,
Expand Down Expand Up @@ -67,28 +67,28 @@ import {
McpUiToolResultNotificationSchema,
McpUiRequestDisplayModeRequest,
McpUiRequestDisplayModeResultSchema,
} from "./types";
} from "./types.js";
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
import {
StandardSchemaV1,
standardSchemaToJsonSchema,
validateStandardSchema,
} from "./standard-schema";
} from "./standard-schema.js";
import { z } from "zod/v4";

export type {
StandardSchemaV1,
StandardSchemaWithJSON,
} from "./standard-schema";
} from "./standard-schema.js";

export { PostMessageTransport } from "./message-transport";
export * from "./types";
export { PostMessageTransport } from "./message-transport.js";
export * from "./types.js";
export {
applyHostStyleVariables,
applyHostFonts,
getDocumentTheme,
applyDocumentTheme,
} from "./styles";
} from "./styles.js";

/**
* Metadata key for associating a UI resource URI with a tool.
Expand Down
2 changes: 1 addition & 1 deletion src/message-transport.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, expect, beforeEach, afterEach, mock } from "bun:test";
import type { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";

import { PostMessageTransport } from "./message-transport";
import { PostMessageTransport } from "./message-transport.js";

/**
* Minimal `window` stub for bun's DOM-less test environment.
Expand Down
2 changes: 1 addition & 1 deletion src/message-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Transport,
TransportSendOptions,
} from "@modelcontextprotocol/sdk/shared/transport.js";
import { TOOL_INPUT_PARTIAL_METHOD } from "./spec.types";
import { TOOL_INPUT_PARTIAL_METHOD } from "./spec.types.js";

/**
* JSON-RPC transport using `window.postMessage` for iframe↔parent communication.
Expand Down
8 changes: 4 additions & 4 deletions src/react/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* }
* ```
*/
export * from "./useApp";
export * from "./useAutoResize";
export * from "./useDocumentTheme";
export * from "./useHostStyles";
export * from "./useApp.js";
export * from "./useAutoResize.js";
export * from "./useDocumentTheme.js";
export * from "./useHostStyles.js";
4 changes: 2 additions & 2 deletions src/react/useApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
AppOptions,
McpUiAppCapabilities,
PostMessageTransport,
} from "../app";
export * from "../app";
} from "../app.js";
export * from "../app.js";

/**
* Options for configuring the {@link useApp `useApp`} hook.
Expand Down
2 changes: 1 addition & 1 deletion src/react/useAutoResize.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, RefObject } from "react";
import { App } from "../app";
import { App } from "../app.js";

/**
* React hook that automatically reports UI size changes to the host.
Expand Down
4 changes: 2 additions & 2 deletions src/react/useDocumentTheme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { getDocumentTheme } from "../styles";
import { McpUiTheme } from "../types";
import { getDocumentTheme } from "../styles.js";
import { McpUiTheme } from "../types.js";

/**
* React hook that provides the current document theme reactively.
Expand Down
6 changes: 3 additions & 3 deletions src/react/useHostStyles.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useEffect, useRef } from "react";
import { App } from "../app";
import { App } from "../app.js";
import {
applyDocumentTheme,
applyHostFonts,
applyHostStyleVariables,
} from "../styles";
import { McpUiHostContext } from "../types";
} from "../styles.js";
import { McpUiHostContext } from "../types.js";

/**
* React hook that applies host style variables and theme as CSS custom properties.
Expand Down
2 changes: 1 addition & 1 deletion src/server/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
RESOURCE_MIME_TYPE,
getUiCapability,
EXTENSION_ID,
} from "./index";
} from "./index.js";
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

describe("registerAppTool", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import type {
AnySchema,
ZodRawShapeCompat,
} from "@modelcontextprotocol/sdk/server/zod-compat.js";
import type { StandardSchemaWithJSON } from "../standard-schema";
import type { StandardSchemaWithJSON } from "../standard-schema.js";
import type {
ClientCapabilities,
ReadResourceResult,
Expand Down
2 changes: 1 addition & 1 deletion src/styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { McpUiStyles, McpUiTheme } from "./types";
import { McpUiStyles, McpUiTheme } from "./types.js";

/**
* Get the current document theme from the root HTML element.
Expand Down