sunpeak 0.16.29 → 0.17.2
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/dev.mjs +169 -342
- package/bin/commands/inspect.mjs +763 -0
- package/bin/commands/new.mjs +2 -2
- package/bin/lib/inspect/inspect-config.d.mts +20 -0
- package/bin/lib/inspect/inspect-config.mjs +76 -0
- package/bin/lib/live/global-setup.mjs +6 -1
- package/bin/sunpeak.js +11 -1
- package/dist/chatgpt/globals.css +8 -0
- package/dist/chatgpt/index.cjs +3 -11
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.d.ts +2 -2
- package/dist/chatgpt/index.js +4 -8
- package/dist/chatgpt/index.js.map +1 -1
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/discovery-Cgoegt62.js +114 -0
- package/dist/discovery-Cgoegt62.js.map +1 -0
- package/dist/discovery-Clu4uHp1.cjs +161 -0
- package/dist/discovery-Clu4uHp1.cjs.map +1 -0
- package/dist/index.cjs +1 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/discovery-cli.cjs +1 -1
- package/dist/lib/discovery-cli.js +1 -1
- package/dist/lib/discovery.d.ts +7 -67
- package/dist/lib/index.d.ts +0 -1
- package/dist/mcp/index.cjs +34 -23
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +34 -23
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/types.d.ts +5 -0
- package/dist/simulator/index.cjs +5 -11
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.d.ts +4 -2
- package/dist/simulator/index.js +5 -8
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/simple-sidebar.d.ts +7 -4
- package/dist/simulator/simulator-url.d.ts +8 -0
- package/dist/simulator/simulator.d.ts +15 -2
- package/dist/simulator/use-mcp-connection.d.ts +19 -0
- package/dist/{simulator-DIVvI69i.cjs → simulator-CH9hs0N6.cjs} +129 -21
- package/dist/simulator-CH9hs0N6.cjs.map +1 -0
- package/dist/{simulator-C7mkK7Sz.js → simulator-Dl8B-Ljb.js} +124 -22
- package/dist/simulator-Dl8B-Ljb.js.map +1 -0
- package/dist/{simulator-url-BDGD4vZD.cjs → simulator-url-CozKF1jf.cjs} +3 -1
- package/dist/simulator-url-CozKF1jf.cjs.map +1 -0
- package/dist/{simulator-url-Bkxj43yT.js → simulator-url-KoS_ToP6.js} +3 -1
- package/dist/simulator-url-KoS_ToP6.js.map +1 -0
- package/dist/style.css +8 -0
- package/package.json +11 -3
- package/template/dist/albums/albums.html +105 -0
- package/template/dist/albums/albums.json +16 -0
- package/template/dist/carousel/carousel.html +105 -0
- package/template/dist/carousel/carousel.json +16 -0
- package/template/dist/map/map.html +3060 -0
- package/template/dist/map/map.json +22 -0
- package/template/dist/review/review.html +105 -0
- package/template/dist/review/review.json +16 -0
- package/template/dist/server.js +15 -0
- package/template/dist/tools/review-diff.js +50 -0
- package/template/dist/tools/review-post.js +50 -0
- package/template/dist/tools/review-purchase.js +61 -0
- package/template/dist/tools/review.js +31 -0
- package/template/dist/tools/show-albums.js +56 -0
- package/template/dist/tools/show-carousel.js +41 -0
- package/template/dist/tools/show-map.js +47 -0
- package/template/node_modules/.vite/deps/_metadata.json +8 -0
- package/template/node_modules/.vite/deps/package.json +3 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +500 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +563 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +575 -0
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/@testing-library_react.js +11363 -0
- package/template/node_modules/.vite-mcp/deps/@testing-library_react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/_metadata.json +130 -0
- package/template/node_modules/.vite-mcp/deps/chunk-BoAXSpZd.js +33 -0
- package/template/node_modules/.vite-mcp/deps/client-CU1wWud4.js +14385 -0
- package/template/node_modules/.vite-mcp/deps/client-CU1wWud4.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/clsx.js +18 -0
- package/template/node_modules/.vite-mcp/deps/clsx.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/dist-uWX8WbjY.js +505 -0
- package/template/node_modules/.vite-mcp/deps/dist-uWX8WbjY.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-react.js +1461 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-wheel-gestures.js +536 -0
- package/template/node_modules/.vite-mcp/deps/embla-carousel-wheel-gestures.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/magic-string.es-Cklsmr-5.js +1013 -0
- package/template/node_modules/.vite-mcp/deps/magic-string.es-Cklsmr-5.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/mapbox-gl.js +46311 -0
- package/template/node_modules/.vite-mcp/deps/mapbox-gl.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/package.json +3 -0
- package/template/node_modules/.vite-mcp/deps/protocol-CTflwIfG.js +2090 -0
- package/template/node_modules/.vite-mcp/deps/protocol-CTflwIfG.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react-dom.js +186 -0
- package/template/node_modules/.vite-mcp/deps/react-dom.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react-dom_client.js +2 -0
- package/template/node_modules/.vite-mcp/deps/react.js +769 -0
- package/template/node_modules/.vite-mcp/deps/react.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-dev-runtime.js +205 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-dev-runtime.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-runtime.js +209 -0
- package/template/node_modules/.vite-mcp/deps/react_jsx-runtime.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/schemas-NsgmY9QV.js +12157 -0
- package/template/node_modules/.vite-mcp/deps/schemas-NsgmY9QV.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/tailwind-merge.js +2025 -0
- package/template/node_modules/.vite-mcp/deps/tailwind-merge.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/vitest.js +14021 -0
- package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -0
- package/template/node_modules/.vite-mcp/deps/zod.js +624 -0
- package/template/node_modules/.vite-mcp/deps/zod.js.map +1 -0
- package/template/src/tools/review-diff.test.ts +5 -1
- package/template/src/tools/review-diff.ts +1 -1
- package/template/src/tools/review-post.test.ts +5 -1
- package/template/src/tools/review-post.ts +1 -1
- package/template/src/tools/review-purchase.test.ts +5 -1
- package/template/src/tools/review-purchase.ts +1 -1
- package/template/src/tools/review.test.ts +5 -1
- package/template/src/tools/review.ts +1 -1
- package/template/src/tools/show-albums.test.ts +5 -1
- package/template/src/tools/show-albums.ts +1 -1
- package/template/src/tools/show-carousel.test.ts +5 -1
- package/template/src/tools/show-carousel.ts +1 -1
- package/template/src/tools/show-map.test.ts +5 -1
- package/template/src/tools/show-map.ts +1 -1
- package/dist/discovery-BxKCIgG5.cjs +0 -332
- package/dist/discovery-BxKCIgG5.cjs.map +0 -1
- package/dist/discovery-Du4LHrih.js +0 -261
- package/dist/discovery-Du4LHrih.js.map +0 -1
- package/dist/simulator-C7mkK7Sz.js.map +0 -1
- package/dist/simulator-DIVvI69i.cjs.map +0 -1
- package/dist/simulator-url-BDGD4vZD.cjs.map +0 -1
- package/dist/simulator-url-Bkxj43yT.js.map +0 -1
- package/template/.sunpeak/dev.tsx +0 -79
- package/template/.sunpeak/resource-loader.html +0 -20
- package/template/.sunpeak/resource-loader.tsx +0 -57
- package/template/index.html +0 -14
- package/template/src/resources/index.ts +0 -17
package/dist/mcp/index.js
CHANGED
|
@@ -9179,14 +9179,16 @@ function createAppServer(config, simulations, viteMode) {
|
|
|
9179
9179
|
};
|
|
9180
9180
|
const toolHandle = uZ(mcpServer, tool.name, {
|
|
9181
9181
|
description: tool.description,
|
|
9182
|
+
inputSchema: z.object({}).passthrough(),
|
|
9182
9183
|
...simulation.outputSchema ? { outputSchema: simulation.outputSchema } : {},
|
|
9184
|
+
annotations: tool.annotations,
|
|
9183
9185
|
_meta: fullToolMeta
|
|
9184
|
-
}, async (extra) => {
|
|
9185
|
-
const args = extra.request?.params?.arguments ?? {};
|
|
9186
|
+
}, async (args, extra) => {
|
|
9186
9187
|
const argKeys = Object.keys(args);
|
|
9187
9188
|
const argsStr = argKeys.length > 0 ? `{${argKeys.join(", ")}}` : "{}";
|
|
9189
|
+
const hasMockResult = toolResult?.structuredContent != null;
|
|
9188
9190
|
const realHandler = simulation.handler;
|
|
9189
|
-
if (realHandler) {
|
|
9191
|
+
if (realHandler && !hasMockResult) {
|
|
9190
9192
|
console.log(`[MCP] CallTool: ${tool.name}${argsStr} → live handler`);
|
|
9191
9193
|
try {
|
|
9192
9194
|
const result = await realHandler(args, extra);
|
|
@@ -9207,8 +9209,7 @@ function createAppServer(config, simulations, viteMode) {
|
|
|
9207
9209
|
};
|
|
9208
9210
|
}
|
|
9209
9211
|
}
|
|
9210
|
-
|
|
9211
|
-
console.log(`[MCP] CallTool: ${tool.name}${argsStr} → ${hasStructuredContent ? "structured" : "text"}`);
|
|
9212
|
+
console.log(`[MCP] CallTool: ${tool.name}${argsStr} → ${hasMockResult ? "structured" : "text"}`);
|
|
9212
9213
|
return {
|
|
9213
9214
|
content: [{
|
|
9214
9215
|
type: "text",
|
|
@@ -9446,15 +9447,20 @@ function runMCPServer(config) {
|
|
|
9446
9447
|
viteServer.ws.handleUpgrade(request, socket, head);
|
|
9447
9448
|
});
|
|
9448
9449
|
httpServer.on("clientError", (err, socket) => {
|
|
9449
|
-
console.error("HTTP client error", err);
|
|
9450
|
+
if (err.code !== "ECONNRESET") console.error("HTTP client error", err);
|
|
9450
9451
|
socket.end("HTTP/1.1 400 Bad Request\r\n\r\n");
|
|
9451
9452
|
});
|
|
9453
|
+
let resolveReady;
|
|
9454
|
+
const ready = new Promise((resolve) => {
|
|
9455
|
+
resolveReady = resolve;
|
|
9456
|
+
});
|
|
9452
9457
|
const onListening = () => {
|
|
9453
9458
|
const actualPort = httpServer.address().port;
|
|
9454
9459
|
localDevServerUrl = `http://localhost:${actualPort}`;
|
|
9455
9460
|
console.log(`Sunpeak MCP server listening on http://localhost:${actualPort}`);
|
|
9456
9461
|
console.log(` MCP endpoint: http://localhost:${actualPort}${MCP_PATH$1}`);
|
|
9457
9462
|
if (viteMode) console.log(` Vite HMR: enabled (source files served with hot reload)`);
|
|
9463
|
+
resolveReady();
|
|
9458
9464
|
};
|
|
9459
9465
|
httpServer.on("error", (err) => {
|
|
9460
9466
|
if (err.code === "EADDRINUSE") {
|
|
@@ -9476,25 +9482,30 @@ function runMCPServer(config) {
|
|
|
9476
9482
|
};
|
|
9477
9483
|
process.on("SIGTERM", () => void shutdown());
|
|
9478
9484
|
process.on("SIGINT", () => void shutdown());
|
|
9479
|
-
return {
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9485
|
+
return {
|
|
9486
|
+
ready,
|
|
9487
|
+
invalidateResources() {
|
|
9488
|
+
if (sessions.size === 0) return;
|
|
9489
|
+
const tunnelSessions = [...sessions].filter(([, s]) => !s.isLocal);
|
|
9490
|
+
if (tunnelSessions.length === 0) return;
|
|
9491
|
+
const timestamp = Date.now().toString(36);
|
|
9492
|
+
for (const [, session] of tunnelSessions) {
|
|
9493
|
+
for (const [name, handle] of session.resourceHandles) handle.update({ uri: `ui://${name}-${timestamp}` });
|
|
9494
|
+
for (const { handle, resourceName, toolMeta } of session.toolHandles) {
|
|
9495
|
+
const newUri = `ui://${resourceName}-${timestamp}`;
|
|
9496
|
+
handle.update({ _meta: {
|
|
9497
|
+
...toolMeta,
|
|
9498
|
+
ui: {
|
|
9499
|
+
...toolMeta.ui,
|
|
9500
|
+
resourceUri: newUri
|
|
9501
|
+
},
|
|
9502
|
+
"ui/resourceUri": newUri
|
|
9503
|
+
} });
|
|
9504
|
+
}
|
|
9494
9505
|
}
|
|
9506
|
+
console.log(`[MCP] Cache-busted ${tunnelSessions.length} tunnel session(s) with timestamp ${timestamp}`);
|
|
9495
9507
|
}
|
|
9496
|
-
|
|
9497
|
-
} };
|
|
9508
|
+
};
|
|
9498
9509
|
}
|
|
9499
9510
|
//#endregion
|
|
9500
9511
|
//#region src/mcp/production-server.ts
|