sunpeak 0.20.2 → 0.20.6
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 +59 -89
- package/bin/commands/dev.mjs +23 -4
- package/bin/commands/inspect.mjs +111 -4
- package/bin/commands/new.mjs +33 -9
- package/bin/commands/test-init.mjs +25 -23
- package/bin/commands/test.mjs +4 -3
- package/bin/lib/eval/eval-runner.mjs +27 -1
- package/bin/lib/eval/model-registry.mjs +6 -1
- package/bin/lib/test/base-config.mjs +11 -4
- package/bin/sunpeak.js +16 -15
- 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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/inspector/index.cjs +1 -1
- package/dist/inspector/index.js +1 -1
- package/dist/{inspector-BBDa5yCm.js → inspector-60Na_Zc4.js} +2 -2
- package/dist/inspector-60Na_Zc4.js.map +1 -0
- package/dist/{inspector-DAA1Wiyh.cjs → inspector-D0qOqYX2.cjs} +2 -2
- package/dist/{inspector-BBDa5yCm.js.map → inspector-D0qOqYX2.cjs.map} +1 -1
- package/dist/mcp/index.cjs +24 -3
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +24 -3
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/types.d.ts +1 -0
- package/dist/{use-app-DPkj5Jp_.cjs → use-app-B33mckz4.cjs} +7 -3
- package/dist/use-app-B33mckz4.cjs.map +1 -0
- package/dist/{use-app-Cr0auUa1.js → use-app-kv5GQr0G.js} +7 -3
- package/dist/use-app-kv5GQr0G.js.map +1 -0
- package/package.json +3 -3
- package/template/README.md +21 -23
- package/template/dist/albums/albums.html +1 -1
- package/template/dist/albums/albums.json +1 -1
- package/template/dist/carousel/carousel.html +1 -1
- package/template/dist/carousel/carousel.json +1 -1
- package/template/dist/map/map.html +1 -1
- package/template/dist/map/map.json +1 -1
- package/template/dist/review/review.html +1 -1
- package/template/dist/review/review.json +1 -1
- package/template/node_modules/.vite/deps/_metadata.json +3 -3
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +6 -2
- 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 +1 -1
- 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 +6 -2
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/_metadata.json +22 -22
- package/template/package.json +2 -1
- package/template/tests/e2e/visual.spec.ts +2 -2
- package/template/tests/evals/albums.eval.ts +1 -1
- package/template/tests/evals/map.eval.ts +1 -1
- package/template/tests/evals/review.eval.ts +4 -2
- package/dist/inspector-DAA1Wiyh.cjs.map +0 -1
- package/dist/use-app-Cr0auUa1.js.map +0 -1
- package/dist/use-app-DPkj5Jp_.cjs.map +0 -1
package/dist/mcp/index.cjs
CHANGED
|
@@ -8681,7 +8681,7 @@ var StreamableHTTPServerTransport = class {
|
|
|
8681
8681
|
}
|
|
8682
8682
|
};
|
|
8683
8683
|
//#endregion
|
|
8684
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.
|
|
8684
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.6.0_@modelcontextprotocol+sdk@1.29.0_zod@4.3.6__react-_1fd7d0151a0915598274278e5ddb69e9/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js
|
|
8685
8685
|
var S = require_protocol.union([require_protocol.literal("light"), require_protocol.literal("dark")]).describe("Color theme preference for the host environment."), W = require_protocol.union([
|
|
8686
8686
|
require_protocol.literal("inline"),
|
|
8687
8687
|
require_protocol.literal("fullscreen"),
|
|
@@ -9277,6 +9277,26 @@ function injectViteCSP(existingMeta) {
|
|
|
9277
9277
|
};
|
|
9278
9278
|
}
|
|
9279
9279
|
var startupTimestamp = Date.now().toString(36);
|
|
9280
|
+
/**
|
|
9281
|
+
* Make all properties in a Zod raw shape optional.
|
|
9282
|
+
*
|
|
9283
|
+
* Tool schemas from `src/tools/*.ts` have required fields by default (e.g.
|
|
9284
|
+
* `z.string()`). The dev server needs to accept partial args because:
|
|
9285
|
+
* - Mock mode returns fixture data regardless of args
|
|
9286
|
+
* - Models may not send every required field
|
|
9287
|
+
* - The inspector's "Re-run" button sends args from the last run
|
|
9288
|
+
*
|
|
9289
|
+
* Making fields optional preserves property types/descriptions in `tools/list`
|
|
9290
|
+
* (so models know what args to send) while letting the SDK accept any subset.
|
|
9291
|
+
*/
|
|
9292
|
+
function makeSchemaOptional(shape) {
|
|
9293
|
+
const optional = {};
|
|
9294
|
+
for (const [key, value] of Object.entries(shape)) {
|
|
9295
|
+
const v = value;
|
|
9296
|
+
optional[key] = typeof v.optional === "function" ? v.optional() : value;
|
|
9297
|
+
}
|
|
9298
|
+
return optional;
|
|
9299
|
+
}
|
|
9280
9300
|
function createAppServer(config, simulations, viteMode) {
|
|
9281
9301
|
const { name = "sunpeak-app", version = "0.1.0", serverInfo } = config;
|
|
9282
9302
|
const mcpServer = new McpServer({
|
|
@@ -9350,6 +9370,7 @@ function createAppServer(config, simulations, viteMode) {
|
|
|
9350
9370
|
});
|
|
9351
9371
|
resourceHandles.set(resourceName, handle);
|
|
9352
9372
|
}
|
|
9373
|
+
const toolInputSchema = simulation.inputSchema ? makeSchemaOptional(simulation.inputSchema) : zod.z.object({}).passthrough();
|
|
9353
9374
|
const fullToolMeta = {
|
|
9354
9375
|
...toolMeta,
|
|
9355
9376
|
ui: {
|
|
@@ -9359,7 +9380,7 @@ function createAppServer(config, simulations, viteMode) {
|
|
|
9359
9380
|
};
|
|
9360
9381
|
const toolHandle = hZ(mcpServer, tool.name, {
|
|
9361
9382
|
description: tool.description,
|
|
9362
|
-
inputSchema:
|
|
9383
|
+
inputSchema: toolInputSchema,
|
|
9363
9384
|
...simulation.outputSchema ? { outputSchema: simulation.outputSchema } : {},
|
|
9364
9385
|
annotations: tool.annotations,
|
|
9365
9386
|
_meta: fullToolMeta
|
|
@@ -9424,7 +9445,7 @@ function createAppServer(config, simulations, viteMode) {
|
|
|
9424
9445
|
const realHandler = simulation.handler;
|
|
9425
9446
|
const plainToolConfig = {
|
|
9426
9447
|
description: tool.description,
|
|
9427
|
-
inputSchema: zod.z.object({}).passthrough(),
|
|
9448
|
+
inputSchema: simulation.inputSchema ? makeSchemaOptional(simulation.inputSchema) : zod.z.object({}).passthrough(),
|
|
9428
9449
|
...simulation.outputSchema ? { outputSchema: simulation.outputSchema } : {},
|
|
9429
9450
|
annotations: tool.annotations,
|
|
9430
9451
|
_meta: toolMeta
|