fix: add explicit .js extensions to relative imports so declarations resolve under NodeNext/Node16

The emitted .d.ts copy relative specifiers verbatim, and the extensionless form
(e.g. `from "./events"`) doesn't resolve under Node16/NodeNext, hiding inherited
members such as `addEventListener` (TS2339). Appending `.js` matches the existing
SDK-import style and works with both bundler-mode type-checking and Bun.build.
Types-only; runtime is unaffected.

Fixes #704
This commit is contained in:
Ken Jo 2026-07-11 21:03:43 +09:00 • committed by Olivier Chafik
commit 264d9cae44

View file

@ -3,8 +3,8 @@ import { Client, InMemoryTransport } from "@modelcontextprotocol/client";
import { Server, type ServerCapabilities } from "@modelcontextprotocol/server";
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,
@ -13,7 +13,7 @@ import {
isToolVisibilityAppOnly,
McpUiOpenLinkResultSchema,
type McpUiHostCapabilities,
} from "./app-bridge";
} from "./app-bridge.js";
/** Wait for pending microtasks to complete */
const flush = () => new Promise((resolve) => setTimeout(resolve, 0));