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.
Files changed (116) hide show
  1. package/bin/commands/build.mjs +0 -1
  2. package/bin/commands/dev.mjs +98 -5
  3. package/bin/commands/start.mjs +3 -2
  4. package/bin/lib/live/browser-auth.mjs +53 -17
  5. package/bin/lib/live/global-setup.mjs +107 -99
  6. package/bin/lib/live/host-page.mjs +63 -11
  7. package/bin/lib/live/live-config.mjs +1 -1
  8. package/bin/lib/sandbox-server.mjs +304 -0
  9. package/dist/chatgpt/chatgpt-conversation.d.ts +3 -7
  10. package/dist/chatgpt/globals.css +28 -9
  11. package/dist/chatgpt/index.cjs +55 -24
  12. package/dist/chatgpt/index.cjs.map +1 -1
  13. package/dist/chatgpt/index.js +31 -25
  14. package/dist/chatgpt/index.js.map +1 -1
  15. package/dist/chunk-9hOWP6kD.cjs +64 -0
  16. package/dist/chunk-D6g4UhsZ.js +35 -0
  17. package/dist/claude/claude-conversation.d.ts +3 -2
  18. package/dist/claude/index.cjs +4 -4
  19. package/dist/claude/index.js +3 -5
  20. package/dist/discovery-BxKCIgG5.cjs +332 -0
  21. package/dist/discovery-BxKCIgG5.cjs.map +1 -0
  22. package/dist/discovery-Du4LHrih.js +261 -0
  23. package/dist/discovery-Du4LHrih.js.map +1 -0
  24. package/dist/host/chatgpt/index.cjs +171 -65
  25. package/dist/host/chatgpt/index.cjs.map +1 -1
  26. package/dist/host/chatgpt/index.js +170 -70
  27. package/dist/host/chatgpt/index.js.map +1 -1
  28. package/dist/host/index.cjs +47 -19
  29. package/dist/host/index.cjs.map +1 -1
  30. package/dist/host/index.js +47 -24
  31. package/dist/host/index.js.map +1 -1
  32. package/dist/index.cjs +3103 -3725
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.js +3026 -3746
  35. package/dist/index.js.map +1 -1
  36. package/dist/lib/discovery-cli.cjs +117 -131
  37. package/dist/lib/discovery-cli.cjs.map +1 -1
  38. package/dist/lib/discovery-cli.js +107 -111
  39. package/dist/lib/discovery-cli.js.map +1 -1
  40. package/dist/mcp/favicon.d.ts +3 -1
  41. package/dist/mcp/index.cjs +9821 -10270
  42. package/dist/mcp/index.cjs.map +1 -1
  43. package/dist/mcp/index.d.ts +2 -2
  44. package/dist/mcp/index.js +9801 -10268
  45. package/dist/mcp/index.js.map +1 -1
  46. package/dist/mcp/production-server.d.ts +7 -1
  47. package/dist/mcp/types.d.ts +30 -1
  48. package/dist/protocol-DJmRaBzO.js +11080 -0
  49. package/dist/{protocol-DkDHRwOW.cjs.map → protocol-DJmRaBzO.js.map} +1 -1
  50. package/dist/protocol-jbxhzcnS.cjs +11493 -0
  51. package/dist/protocol-jbxhzcnS.cjs.map +1 -0
  52. package/dist/simulator/hosts.d.ts +11 -2
  53. package/dist/simulator/iframe-resource.d.ts +8 -1
  54. package/dist/simulator/index.cjs +79 -36
  55. package/dist/simulator/index.cjs.map +1 -1
  56. package/dist/simulator/index.js +43 -37
  57. package/dist/simulator/index.js.map +1 -1
  58. package/dist/simulator/mcp-app-host.d.ts +17 -0
  59. package/dist/simulator/sandbox-proxy.d.ts +38 -0
  60. package/dist/simulator/simulator.d.ts +7 -1
  61. package/dist/simulator/use-simulator-state.d.ts +2 -4
  62. package/dist/simulator-BYIH-xqQ.cjs +3701 -0
  63. package/dist/simulator-BYIH-xqQ.cjs.map +1 -0
  64. package/dist/simulator-CmgNnWBO.js +3575 -0
  65. package/dist/simulator-CmgNnWBO.js.map +1 -0
  66. package/dist/simulator-url-BDGD4vZD.cjs +69 -0
  67. package/dist/simulator-url-BDGD4vZD.cjs.map +1 -0
  68. package/dist/simulator-url-Bkxj43yT.js +64 -0
  69. package/dist/simulator-url-Bkxj43yT.js.map +1 -0
  70. package/dist/style.css +28 -9
  71. package/dist/use-app-D2h-aiyr.cjs +940 -0
  72. package/dist/use-app-D2h-aiyr.cjs.map +1 -0
  73. package/dist/use-app-X7JbGskk.js +598 -0
  74. package/dist/use-app-X7JbGskk.js.map +1 -0
  75. package/package.json +8 -8
  76. package/template/.sunpeak/dev.tsx +9 -3
  77. package/template/node_modules/.bin/vite +2 -2
  78. package/template/node_modules/.bin/vitest +2 -2
  79. package/template/package.json +5 -5
  80. package/template/playwright.config.ts +10 -5
  81. package/template/src/server.ts +16 -2
  82. package/template/src/tools/show-albums.ts +17 -0
  83. package/template/tests/e2e/albums.spec.ts +37 -5
  84. package/template/tests/e2e/carousel.spec.ts +6 -6
  85. package/template/tests/e2e/global-setup.ts +6 -21
  86. package/template/tests/e2e/map.spec.ts +11 -11
  87. package/template/tests/e2e/review.spec.ts +24 -24
  88. package/dist/claude/index.cjs.map +0 -1
  89. package/dist/claude/index.js.map +0 -1
  90. package/dist/discovery-BVqD-JsT.js +0 -224
  91. package/dist/discovery-BVqD-JsT.js.map +0 -1
  92. package/dist/discovery-D1gpaVz4.cjs +0 -223
  93. package/dist/discovery-D1gpaVz4.cjs.map +0 -1
  94. package/dist/index-B7Qw3Vhh.js +0 -29
  95. package/dist/index-B7Qw3Vhh.js.map +0 -1
  96. package/dist/index-BEHP_bM8.js +0 -41
  97. package/dist/index-BEHP_bM8.js.map +0 -1
  98. package/dist/index-SfudQ9Y_.cjs +0 -28
  99. package/dist/index-SfudQ9Y_.cjs.map +0 -1
  100. package/dist/index-XKHXfBiD.cjs +0 -40
  101. package/dist/index-XKHXfBiD.cjs.map +0 -1
  102. package/dist/protocol-DkDHRwOW.cjs +0 -12221
  103. package/dist/protocol-uge7qFev.js +0 -12223
  104. package/dist/protocol-uge7qFev.js.map +0 -1
  105. package/dist/simulator-BCq2iOT-.js +0 -3262
  106. package/dist/simulator-BCq2iOT-.js.map +0 -1
  107. package/dist/simulator-DRUsm6IZ.cjs +0 -3277
  108. package/dist/simulator-DRUsm6IZ.cjs.map +0 -1
  109. package/dist/simulator-url-DcSYRl-P.cjs +0 -53
  110. package/dist/simulator-url-DcSYRl-P.cjs.map +0 -1
  111. package/dist/simulator-url-j_XV3EoP.js +0 -54
  112. package/dist/simulator-url-j_XV3EoP.js.map +0 -1
  113. package/dist/use-app-C9gpzIQO.js +0 -349
  114. package/dist/use-app-C9gpzIQO.js.map +0 -1
  115. package/dist/use-app-D09O2swh.cjs +0 -348
  116. 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 */
@@ -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;