Skip to content
Closed
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
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ npm run test:e2e
npm test

# Check JSDoc comment syntax and `{@link}` references
npm exec typedoc -- --treatValidationWarningsAsErrors --emit none
npm run docs -- --treatValidationWarningsAsErrors --emit none

# Regenerate package-lock.json
# Note: repo .npmrc pins registry to npmjs.org, so a plain `npm i` is safe even
Expand Down Expand Up @@ -85,7 +85,7 @@ View (App) <--PostMessageTransport--> Host (AppBridge) <--MCP Client--> MCP Serv

JSDoc `@example` tags should pull type-checked code from companion `.examples.ts` files (e.g., `app.ts` → `app.examples.ts`). Use ` ```ts source="./file.examples.ts#regionName" ` fences referencing `//#region regionName` blocks; region names follow `exportedName_variant` or `ClassName_methodName_variant` pattern (e.g., `useApp_basicUsage`, `App_hostCapabilities_checkAfterConnection`). For whole-file inclusion (any file type), omit the `#regionName`. Run `npm run sync:snippets` to sync.

Standalone docs in `docs/` (listed in `typedoc.config.mjs` `projectDocuments`) can also have type-checked companion `.ts`/`.tsx` files using the same pattern.
Standalone docs in `docs/` (listed in `typedoc.config.ts` `projectDocuments`) can also have type-checked companion `.ts`/`.tsx` files using the same pattern.

## Full Examples

Expand Down
5 changes: 3 additions & 2 deletions build.bun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import { $ } from "bun";
import { cpSync, mkdirSync } from "node:fs";

// Run TypeScript compiler for type declarations
await $`tsc`;
// TypeDoc and declaration emit still require TypeScript's JavaScript compiler API.
// Keep this compatibility lane explicit while native TypeScript 7 checks source.
await $`node node_modules/typescript/bin/tsc`;

// Copy schema.json (tsc is emitDeclarationOnly, Bun.build doesn't emit JSON assets).
// Needed for the "./schema.json" package export.
Expand Down
2 changes: 2 additions & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ npm pkg set scripts.start='concurrently --raw "cross-env NODE_ENV=development IN
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down Expand Up @@ -91,6 +92,7 @@ npm pkg set scripts.start='concurrently --raw "cross-env NODE_ENV=development IN
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"cors": "^2.8.5",
"express": "^5.1.0",
"prettier": "^3.6.2",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-host/src/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getTheme, onThemeChange } from "./theme";
import { HOST_STYLE_VARIABLES } from "./host-styles";


const SANDBOX_PROXY_BASE_URL = "http://localhost:8081/sandbox.html";
const SANDBOX_PROXY_BASE_URL = `http://localhost:${import.meta.env.VITE_SANDBOX_PORT ?? "8081"}/sandbox.html`;
const IMPLEMENTATION = { name: "MCP Apps Host", version: "1.0.0" };


Expand Down
1 change: 1 addition & 0 deletions examples/basic-host/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"resolveJsonModule": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-server-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/node": "22.10.0",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-preact/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-preact/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-server-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@vitejs/plugin-react": "^4.3.4",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
}
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-react/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-server-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/node": "22.10.0",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0",
"vite-plugin-solid": "^2.11.12"
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-solid/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-solid/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-server-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/node": "22.10.0",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-svelte/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-svelte/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-server-vanillajs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/node": "22.10.0",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-vanillajs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-vanillajs/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-server-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@vitejs/plugin-vue": "^5.0.0",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-vue/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/basic-server-vue/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/budget-allocator-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/node": "22.10.0",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/budget-allocator-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/budget-allocator-server/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/cohort-heatmap-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@vitejs/plugin-react": "^4.3.4",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/cohort-heatmap-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/cohort-heatmap-server/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/customer-segmentation-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/node": "22.10.0",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/customer-segmentation-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/customer-segmentation-server/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/debug-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"cors": "^2.8.5",
"cross-env": "^10.1.0",
"express": "^5.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
}
Expand Down
1 change: 1 addition & 0 deletions examples/debug-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/debug-server/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/integration-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/react-dom": "^19.2.2",
"@vitejs/plugin-react": "^4.3.4",
"concurrently": "^9.2.1",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/integration-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/integration-server/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/lazy-auth-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/node": "22.10.0",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/lazy-auth-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/lazy-auth-server/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/map-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/node": "22.10.0",
"concurrently": "^9.2.1",
"cross-env": "^10.1.0",
"typescript": "^5.9.3",
"typescript": "^7.0.2",
"vite": "^6.0.0",
"vite-plugin-singlefile": "^2.3.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/map-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["node", "vite/client"],
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
1 change: 1 addition & 0 deletions examples/map-server/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["ES2022"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["node"],
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist",
Expand Down
Loading