sunpeak 0.16.24 → 0.16.28
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/bin/commands/build.mjs +0 -1
- package/bin/commands/dev.mjs +98 -5
- package/bin/commands/start.mjs +3 -2
- package/bin/lib/live/browser-auth.mjs +53 -17
- package/bin/lib/live/global-setup.mjs +107 -99
- package/bin/lib/live/host-page.mjs +63 -11
- package/bin/lib/live/live-config.mjs +1 -1
- package/bin/lib/sandbox-server.mjs +304 -0
- package/dist/chatgpt/chatgpt-conversation.d.ts +3 -7
- package/dist/chatgpt/globals.css +28 -9
- package/dist/chatgpt/index.cjs +55 -24
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.js +31 -25
- package/dist/chatgpt/index.js.map +1 -1
- package/dist/chunk-9hOWP6kD.cjs +64 -0
- package/dist/chunk-D6g4UhsZ.js +35 -0
- package/dist/claude/claude-conversation.d.ts +3 -2
- package/dist/claude/index.cjs +4 -4
- package/dist/claude/index.js +3 -5
- package/dist/discovery-BxKCIgG5.cjs +332 -0
- package/dist/discovery-BxKCIgG5.cjs.map +1 -0
- package/dist/discovery-Du4LHrih.js +261 -0
- package/dist/discovery-Du4LHrih.js.map +1 -0
- package/dist/host/chatgpt/index.cjs +171 -65
- package/dist/host/chatgpt/index.cjs.map +1 -1
- package/dist/host/chatgpt/index.js +170 -70
- package/dist/host/chatgpt/index.js.map +1 -1
- package/dist/host/index.cjs +47 -19
- package/dist/host/index.cjs.map +1 -1
- package/dist/host/index.js +47 -24
- package/dist/host/index.js.map +1 -1
- package/dist/index.cjs +3103 -3725
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3026 -3746
- package/dist/index.js.map +1 -1
- package/dist/lib/discovery-cli.cjs +117 -131
- package/dist/lib/discovery-cli.cjs.map +1 -1
- package/dist/lib/discovery-cli.js +107 -111
- package/dist/lib/discovery-cli.js.map +1 -1
- package/dist/mcp/favicon.d.ts +3 -1
- package/dist/mcp/index.cjs +9821 -10270
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +9801 -10268
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/production-server.d.ts +7 -1
- package/dist/mcp/types.d.ts +30 -1
- package/dist/protocol-DJmRaBzO.js +11080 -0
- package/dist/{protocol-DkDHRwOW.cjs.map → protocol-DJmRaBzO.js.map} +1 -1
- package/dist/protocol-jbxhzcnS.cjs +11493 -0
- package/dist/protocol-jbxhzcnS.cjs.map +1 -0
- package/dist/simulator/hosts.d.ts +11 -2
- package/dist/simulator/iframe-resource.d.ts +8 -1
- package/dist/simulator/index.cjs +79 -36
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.js +43 -37
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/mcp-app-host.d.ts +17 -0
- package/dist/simulator/sandbox-proxy.d.ts +38 -0
- package/dist/simulator/simulator.d.ts +7 -1
- package/dist/simulator/use-simulator-state.d.ts +2 -4
- package/dist/simulator-BYIH-xqQ.cjs +3701 -0
- package/dist/simulator-BYIH-xqQ.cjs.map +1 -0
- package/dist/simulator-CmgNnWBO.js +3575 -0
- package/dist/simulator-CmgNnWBO.js.map +1 -0
- package/dist/simulator-url-BDGD4vZD.cjs +69 -0
- package/dist/simulator-url-BDGD4vZD.cjs.map +1 -0
- package/dist/simulator-url-Bkxj43yT.js +64 -0
- package/dist/simulator-url-Bkxj43yT.js.map +1 -0
- package/dist/style.css +28 -9
- package/dist/use-app-D2h-aiyr.cjs +940 -0
- package/dist/use-app-D2h-aiyr.cjs.map +1 -0
- package/dist/use-app-X7JbGskk.js +598 -0
- package/dist/use-app-X7JbGskk.js.map +1 -0
- package/package.json +8 -8
- package/template/.sunpeak/dev.tsx +9 -3
- package/template/node_modules/.bin/vite +2 -2
- package/template/node_modules/.bin/vitest +2 -2
- package/template/package.json +5 -5
- package/template/playwright.config.ts +10 -5
- package/template/src/server.ts +16 -2
- package/template/src/tools/show-albums.ts +17 -0
- package/template/tests/e2e/albums.spec.ts +37 -5
- package/template/tests/e2e/carousel.spec.ts +6 -6
- package/template/tests/e2e/global-setup.ts +6 -21
- package/template/tests/e2e/map.spec.ts +11 -11
- package/template/tests/e2e/review.spec.ts +24 -24
- package/dist/claude/index.cjs.map +0 -1
- package/dist/claude/index.js.map +0 -1
- package/dist/discovery-BVqD-JsT.js +0 -224
- package/dist/discovery-BVqD-JsT.js.map +0 -1
- package/dist/discovery-D1gpaVz4.cjs +0 -223
- package/dist/discovery-D1gpaVz4.cjs.map +0 -1
- package/dist/index-B7Qw3Vhh.js +0 -29
- package/dist/index-B7Qw3Vhh.js.map +0 -1
- package/dist/index-BEHP_bM8.js +0 -41
- package/dist/index-BEHP_bM8.js.map +0 -1
- package/dist/index-SfudQ9Y_.cjs +0 -28
- package/dist/index-SfudQ9Y_.cjs.map +0 -1
- package/dist/index-XKHXfBiD.cjs +0 -40
- package/dist/index-XKHXfBiD.cjs.map +0 -1
- package/dist/protocol-DkDHRwOW.cjs +0 -12221
- package/dist/protocol-uge7qFev.js +0 -12223
- package/dist/protocol-uge7qFev.js.map +0 -1
- package/dist/simulator-BCq2iOT-.js +0 -3262
- package/dist/simulator-BCq2iOT-.js.map +0 -1
- package/dist/simulator-DRUsm6IZ.cjs +0 -3277
- package/dist/simulator-DRUsm6IZ.cjs.map +0 -1
- package/dist/simulator-url-DcSYRl-P.cjs +0 -53
- package/dist/simulator-url-DcSYRl-P.cjs.map +0 -1
- package/dist/simulator-url-j_XV3EoP.js +0 -54
- package/dist/simulator-url-j_XV3EoP.js.map +0 -1
- package/dist/use-app-C9gpzIQO.js +0 -349
- package/dist/use-app-C9gpzIQO.js.map +0 -1
- package/dist/use-app-D09O2swh.cjs +0 -348
- package/dist/use-app-D09O2swh.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
-
import { AuthInfo, CallToolResult, ToolHandlerExtra } from './types.js';
|
|
3
|
+
import { AuthInfo, CallToolResult, ServerConfig, ToolHandlerExtra } from './types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Enable or disable structured JSON logging.
|
|
6
6
|
*
|
|
@@ -25,6 +25,8 @@ export interface ProductionTool {
|
|
|
25
25
|
};
|
|
26
26
|
/** Zod shape from the `schema` export (passed to SDK as inputSchema) */
|
|
27
27
|
schema?: Record<string, unknown>;
|
|
28
|
+
/** Zod shape from the `outputSchema` export (passed to SDK as outputSchema) */
|
|
29
|
+
outputSchema?: Record<string, unknown>;
|
|
28
30
|
/** Handler from the `default` export */
|
|
29
31
|
handler: (args: Record<string, unknown>, extra: ToolHandlerExtra) => CallToolResult | Promise<CallToolResult> | string | Promise<string>;
|
|
30
32
|
}
|
|
@@ -60,6 +62,8 @@ export interface ProductionServerConfig {
|
|
|
60
62
|
name?: string;
|
|
61
63
|
/** Server version reported to hosts */
|
|
62
64
|
version?: string;
|
|
65
|
+
/** Full server identity (overrides name/version when provided). */
|
|
66
|
+
serverInfo?: ServerConfig;
|
|
63
67
|
/** Tool registrations with real handlers */
|
|
64
68
|
tools: ProductionTool[];
|
|
65
69
|
/** Resource registrations with pre-built HTML */
|
|
@@ -75,6 +79,8 @@ export interface WebHandlerConfig {
|
|
|
75
79
|
name?: string;
|
|
76
80
|
/** Server version reported to hosts */
|
|
77
81
|
version?: string;
|
|
82
|
+
/** Full server identity (overrides name/version when provided). */
|
|
83
|
+
serverInfo?: ServerConfig;
|
|
78
84
|
/** Tool registrations with real handlers */
|
|
79
85
|
tools: ProductionTool[];
|
|
80
86
|
/** Resource registrations with pre-built HTML */
|
package/dist/mcp/types.d.ts
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
|
-
import { Resource, Tool, ServerRequest, ServerNotification } from '@modelcontextprotocol/sdk/types.js';
|
|
1
|
+
import { Resource, Tool, Implementation, ServerRequest, ServerNotification } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
3
3
|
import { ToolConfig } from '@modelcontextprotocol/ext-apps/server';
|
|
4
4
|
import { ServerToolMock } from '../types/simulation';
|
|
5
5
|
export type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
export type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Server identity configuration, exported from `src/server.ts` as `server`.
|
|
9
|
+
*
|
|
10
|
+
* All fields from the MCP SDK's `Implementation` type are supported:
|
|
11
|
+
* `name`, `version`, `title`, `description`, `websiteUrl`, `icons`.
|
|
12
|
+
*
|
|
13
|
+
* Icons must be **64x64 PNG** for ChatGPT compatibility. Use a `data:` URI
|
|
14
|
+
* to embed the icon inline so the host doesn't need to fetch it separately.
|
|
15
|
+
* Light/dark theme variants are supported via the `theme` field.
|
|
16
|
+
*
|
|
17
|
+
* If omitted, a default sunpeak icon is used.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* export const server: ServerConfig = {
|
|
22
|
+
* name: 'my-app',
|
|
23
|
+
* version: '1.0.0',
|
|
24
|
+
* description: 'My MCP app',
|
|
25
|
+
* icons: [
|
|
26
|
+
* { src: 'data:image/png;base64,...', mimeType: 'image/png', sizes: ['64x64'] },
|
|
27
|
+
* { src: 'data:image/png;base64,...', mimeType: 'image/png', sizes: ['64x64'], theme: 'dark' },
|
|
28
|
+
* ],
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export type ServerConfig = Partial<Implementation>;
|
|
7
33
|
/**
|
|
8
34
|
* Extra context passed to tool handlers as the second argument.
|
|
9
35
|
*
|
|
@@ -41,6 +67,7 @@ export interface SimulationWithDist {
|
|
|
41
67
|
structuredContent?: unknown;
|
|
42
68
|
isError?: boolean;
|
|
43
69
|
};
|
|
70
|
+
outputSchema?: unknown;
|
|
44
71
|
handler?: (args: Record<string, unknown>, extra: unknown) => unknown | Promise<unknown>;
|
|
45
72
|
serverTools?: Record<string, ServerToolMock>;
|
|
46
73
|
}
|
|
@@ -62,6 +89,8 @@ export interface MCPServerHandle {
|
|
|
62
89
|
export interface MCPServerConfig {
|
|
63
90
|
name?: string;
|
|
64
91
|
version?: string;
|
|
92
|
+
/** Full server identity (overrides name/version when provided). */
|
|
93
|
+
serverInfo?: ServerConfig;
|
|
65
94
|
port?: number;
|
|
66
95
|
/** HMR WebSocket port (used for CSP injection in dev mode). */
|
|
67
96
|
hmrPort?: number;
|