Skip to content

Commit 674ff27

Browse files
committed
Merge main into ochafik/kotlin-sdk (resolved conflicts)
2 parents e32aa97 + 8550545 commit 674ff27

File tree

3,101 files changed

+48765
-3026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,101 files changed

+48765
-3026
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [main]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
@@ -30,30 +33,37 @@ jobs:
3033
- name: Verify generated schemas are up-to-date
3134
run: |
3235
npm run generate:schemas
33-
npm run prettier:fix
3436
git diff --exit-code src/generated/ || (echo "Generated schemas are out of date. Run 'npm run generate:schemas' and commit." && exit 1)
3537
3638
- run: npm test
3739

3840
- run: npm run prettier
3941

40-
kotlin:
42+
e2e:
4143
runs-on: ubuntu-latest
4244
steps:
4345
- uses: actions/checkout@v4
4446

45-
- name: Set up JDK 21
46-
uses: actions/setup-java@v4
47+
- uses: oven-sh/setup-bun@v2
4748
with:
48-
java-version: "21"
49-
distribution: "temurin"
49+
bun-version: latest
5050

51-
- name: Build Kotlin SDK
52-
working-directory: kotlin
53-
run: |
54-
chmod +x gradlew
55-
./gradlew build
51+
- uses: actions/setup-node@v4
52+
with:
53+
node-version: "20"
54+
55+
- run: npm ci
56+
57+
- name: Install Playwright browsers
58+
run: npx playwright install --with-deps chromium
5659

57-
- name: Test Kotlin SDK
58-
working-directory: kotlin
59-
run: ./gradlew test
60+
- name: Run E2E tests
61+
run: npx playwright test --reporter=list
62+
63+
- name: Upload test results
64+
uses: actions/upload-artifact@v4
65+
if: failure()
66+
with:
67+
name: test-results
68+
path: test-results/
69+
retention-days: 7

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ bun.lockb
66
.vscode/
77
docs/api/
88
tmp/
9+
intermediate-findings/
10+
11+
# Playwright
12+
playwright-report/
13+
test-results/

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": false,
5+
"printWidth": 80,
6+
"tabWidth": 2
7+
}

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,45 @@ Or build and run examples:
4040
npm run examples:start
4141
```
4242

43+
## Testing
44+
45+
### Unit Tests
46+
47+
Run unit tests with Bun:
48+
49+
```bash
50+
npm test
51+
```
52+
53+
### E2E Tests
54+
55+
E2E tests use Playwright to verify all example servers work correctly with screenshot comparisons.
56+
57+
```bash
58+
# Run all E2E tests
59+
npm run test:e2e
60+
61+
# Run a specific server's tests
62+
npm run test:e2e -- --grep "Budget Allocator"
63+
64+
# Run tests in interactive UI mode
65+
npm run test:e2e:ui
66+
```
67+
68+
### Updating Golden Screenshots
69+
70+
When UI changes are intentional, update the golden screenshots:
71+
72+
```bash
73+
# Update all screenshots
74+
npm run test:e2e:update
75+
76+
# Update screenshots for a specific server
77+
npm run test:e2e:update -- --grep "Three.js"
78+
```
79+
80+
**Note**: Golden screenshots are platform-agnostic. Tests use canvas masking and tolerance thresholds to handle minor cross-platform rendering differences.
81+
4382
## Code of Conduct
4483

4584
This project follows our [Code of Conduct](CODE_OF_CONDUCT.md). Please review it before contributing.

docs/quickstart.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ import cors from "cors";
102102
import express from "express";
103103
import fs from "node:fs/promises";
104104
import path from "node:path";
105-
import { z } from "zod";
105+
import * as z from "zod";
106106

107107
const server = new McpServer({
108108
name: "My MCP App Server",
@@ -130,17 +130,22 @@ server.registerTool(
130130
},
131131
);
132132

133-
server.registerResource(resourceUri, resourceUri, {}, async () => {
134-
const html = await fs.readFile(
135-
path.join(import.meta.dirname, "dist", "mcp-app.html"),
136-
"utf-8",
137-
);
138-
return {
139-
contents: [
140-
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
141-
],
142-
};
143-
});
133+
server.registerResource(
134+
resourceUri,
135+
resourceUri,
136+
{ mimeType: "text/html;profile=mcp-app" },
137+
async () => {
138+
const html = await fs.readFile(
139+
path.join(import.meta.dirname, "dist", "mcp-app.html"),
140+
"utf-8",
141+
);
142+
return {
143+
contents: [
144+
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
145+
],
146+
};
147+
},
148+
);
144149

145150
// Express server for MCP endpoint
146151
const app = express();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>application-identifier</key>
6+
<string>FAKETEAMID.basic-host-swift.BasicHostSwift</string>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pK�F0D application-identifier *FAKETEAMID.basic-host-swift.BasicHostSwift

examples/basic-host-swift/.build/Build/Intermediates.noindex/BasicHostSwift.build/Debug-iphonesimulator/BasicHostSwift.build/BasicHostSwift.DependencyMetadataFileList

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/Users/ochafik/code/ext-apps3/examples/basic-host-swift/.build/Build/Products/Debug-iphonesimulator/CSystem.appintents/Metadata.appintents/extract.actionsdata
2+
/Users/ochafik/code/ext-apps3/examples/basic-host-swift/.build/Build/Products/Debug-iphonesimulator/EventSource.appintents/Metadata.appintents/extract.actionsdata
3+
/Users/ochafik/code/ext-apps3/examples/basic-host-swift/.build/Build/Products/Debug-iphonesimulator/Logging.appintents/Metadata.appintents/extract.actionsdata
4+
/Users/ochafik/code/ext-apps3/examples/basic-host-swift/.build/Build/Products/Debug-iphonesimulator/MCP.appintents/Metadata.appintents/extract.actionsdata
5+
/Users/ochafik/code/ext-apps3/examples/basic-host-swift/.build/Build/Products/Debug-iphonesimulator/McpApps.appintents/Metadata.appintents/extract.actionsdata
6+
/Users/ochafik/code/ext-apps3/examples/basic-host-swift/.build/Build/Products/Debug-iphonesimulator/SystemPackage.appintents/Metadata.appintents/extract.actionsdata
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>application-identifier</key>
6+
<string>FAKETEAMID.basic-host-swift.BasicHostSwift</string>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)