sunpeak 0.19.2 → 0.19.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/bin/commands/dev.mjs +1 -1
- package/bin/commands/inspect.mjs +1 -1
- package/bin/commands/new.mjs +9 -5
- package/bin/commands/start.mjs +3 -1
- package/bin/commands/test-init.mjs +478 -76
- package/bin/commands/test.mjs +357 -4
- package/bin/lib/eval/eval-reporter.mjs +105 -0
- package/bin/lib/eval/eval-runner.mjs +310 -0
- package/bin/lib/eval/eval-types.d.mts +168 -0
- package/bin/lib/eval/eval-vitest-plugin.mjs +158 -0
- package/bin/lib/eval/model-registry.mjs +73 -0
- package/bin/lib/sandbox-server.mjs +5 -2
- package/bin/sunpeak.js +1 -0
- package/dist/chatgpt/index.cjs +1 -1
- package/dist/chatgpt/index.js +1 -1
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/host/chatgpt/index.cjs +1 -1
- package/dist/host/chatgpt/index.js +1 -1
- package/dist/index.cjs +134 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +71 -62
- package/dist/index.js.map +1 -1
- package/dist/inspector/index.cjs +1 -1
- package/dist/inspector/index.js +1 -1
- package/dist/{inspector-Cdo5BK2D.js → inspector-D5DckQuU.js} +236 -98
- package/dist/inspector-D5DckQuU.js.map +1 -0
- package/dist/{inspector-8nPV2A-z.cjs → inspector-jY9O18z9.cjs} +237 -99
- package/dist/inspector-jY9O18z9.cjs.map +1 -0
- package/dist/mcp/index.cjs +237 -140
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +230 -134
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/production-server.d.ts +31 -0
- package/dist/{protocol-C7kTcBr_.cjs → protocol-C8pFDmcy.cjs} +8194 -8187
- package/dist/protocol-C8pFDmcy.cjs.map +1 -0
- package/dist/{protocol-BfAACnv0.js → protocol-CRqiPTLT.js} +8186 -8185
- package/dist/protocol-CRqiPTLT.js.map +1 -0
- package/dist/{use-app-CfP9VypY.js → use-app-Bfargfa3.js} +194 -94
- package/dist/use-app-Bfargfa3.js.map +1 -0
- package/dist/{use-app-CzcYw1Kz.cjs → use-app-CbsBEmwv.cjs} +254 -148
- package/dist/use-app-CbsBEmwv.cjs.map +1 -0
- package/package.json +27 -3
- package/template/README.md +17 -7
- package/template/_gitignore +2 -0
- package/template/dist/albums/albums.html +15 -15
- package/template/dist/albums/albums.json +1 -1
- package/template/dist/carousel/carousel.html +19 -19
- package/template/dist/carousel/carousel.json +1 -1
- package/template/dist/map/map.html +14 -14
- package/template/dist/map/map.json +1 -1
- package/template/dist/review/review.html +11 -11
- package/template/dist/review/review.json +1 -1
- package/template/node_modules/.bin/vitest +2 -2
- package/template/node_modules/.vite/deps/_metadata.json +3 -3
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +192 -91
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +231 -92
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +208 -105
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/_metadata.json +25 -25
- package/template/node_modules/.vite-mcp/deps/{protocol-B_qKkui_.js → protocol-BqGB4zBx.js} +45 -45
- package/template/node_modules/.vite-mcp/deps/protocol-BqGB4zBx.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/vitest.js +7 -7
- package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -1
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-chatgpt-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-claude-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-chatgpt-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-claude-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-chatgpt-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-claude-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-chatgpt-darwin.png +0 -0
- package/template/tests/e2e/visual.spec.ts-snapshots/albums-page-light-claude-darwin.png +0 -0
- package/template/tests/evals/.env.example +5 -0
- package/template/tests/evals/albums.eval.ts +28 -0
- package/template/tests/evals/carousel.eval.ts +26 -0
- package/template/tests/evals/eval.config.ts +26 -0
- package/template/tests/evals/map.eval.ts +23 -0
- package/template/tests/evals/review.eval.ts +48 -0
- package/dist/inspector-8nPV2A-z.cjs.map +0 -1
- package/dist/inspector-Cdo5BK2D.js.map +0 -1
- package/dist/protocol-BfAACnv0.js.map +0 -1
- package/dist/protocol-C7kTcBr_.cjs.map +0 -1
- package/dist/use-app-CfP9VypY.js.map +0 -1
- package/dist/use-app-CzcYw1Kz.cjs.map +0 -1
- package/template/node_modules/.vite-mcp/deps/protocol-B_qKkui_.js.map +0 -1
|
@@ -83,6 +83,16 @@ export interface ProductionServerConfig {
|
|
|
83
83
|
* where holding open SSE connections is unreliable. Defaults to `true`.
|
|
84
84
|
*/
|
|
85
85
|
enableJsonResponse?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Enable stateless mode for serverless and horizontally-scaled deployments.
|
|
88
|
+
*
|
|
89
|
+
* When `true`, every request creates a fresh MCP server instance with no
|
|
90
|
+
* session tracking. This means:
|
|
91
|
+
* - No in-memory session map (works across Lambda invocations, multiple instances)
|
|
92
|
+
* - No `mcp-session-id` validation (requests aren't tied to a specific instance)
|
|
93
|
+
* - The MCP SDK's stateless transport is used (`sessionIdGenerator: undefined`)
|
|
94
|
+
*/
|
|
95
|
+
stateless?: boolean;
|
|
86
96
|
}
|
|
87
97
|
/**
|
|
88
98
|
* Configuration for creating a Web Standard MCP handler (serverless/edge).
|
|
@@ -113,6 +123,16 @@ export interface WebHandlerConfig {
|
|
|
113
123
|
* where holding open SSE connections is unreliable. Defaults to `true`.
|
|
114
124
|
*/
|
|
115
125
|
enableJsonResponse?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Enable stateless mode for serverless and horizontally-scaled deployments.
|
|
128
|
+
*
|
|
129
|
+
* When `true`, every request creates a fresh MCP server instance with no
|
|
130
|
+
* session tracking. This means:
|
|
131
|
+
* - No in-memory session map (works across Lambda invocations, multiple instances)
|
|
132
|
+
* - No `mcp-session-id` validation (requests aren't tied to a specific instance)
|
|
133
|
+
* - The MCP SDK's stateless transport is used (`sessionIdGenerator: undefined`)
|
|
134
|
+
*/
|
|
135
|
+
stateless?: boolean;
|
|
116
136
|
}
|
|
117
137
|
/**
|
|
118
138
|
* Create an MCP server with production tool handlers and pre-built resources.
|
|
@@ -121,6 +141,17 @@ export interface WebHandlerConfig {
|
|
|
121
141
|
* Resources serve pre-built HTML with their _meta preserved.
|
|
122
142
|
*/
|
|
123
143
|
export declare function createProductionMcpServer(config: ProductionServerConfig): McpServer;
|
|
144
|
+
/**
|
|
145
|
+
* Detect the MCP host from HTTP request headers.
|
|
146
|
+
*
|
|
147
|
+
* ChatGPT sends `user-agent: openai-mcp/1.0.0` on all MCP HTTP requests.
|
|
148
|
+
* Claude sends `user-agent: Claude-User` and `x-anthropic-client: ClaudeAI`.
|
|
149
|
+
*
|
|
150
|
+
* Returns the `clientInfo.name` equivalent: `'openai-mcp'` or `'claude'`.
|
|
151
|
+
* Returns undefined if the host can't be identified.
|
|
152
|
+
*/
|
|
153
|
+
export declare function detectClientFromHeaders(headers: Headers): string | undefined;
|
|
154
|
+
export declare function detectClientFromHeaders(headers: Record<string, string | string[] | undefined>): string | undefined;
|
|
124
155
|
/**
|
|
125
156
|
* Create a request handler that manages MCP sessions over Streamable HTTP.
|
|
126
157
|
*
|