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.
Files changed (61) hide show
  1. package/README.md +59 -89
  2. package/bin/commands/dev.mjs +23 -4
  3. package/bin/commands/inspect.mjs +111 -4
  4. package/bin/commands/new.mjs +33 -9
  5. package/bin/commands/test-init.mjs +25 -23
  6. package/bin/commands/test.mjs +4 -3
  7. package/bin/lib/eval/eval-runner.mjs +27 -1
  8. package/bin/lib/eval/model-registry.mjs +6 -1
  9. package/bin/lib/test/base-config.mjs +11 -4
  10. package/bin/sunpeak.js +16 -15
  11. package/dist/chatgpt/index.cjs +1 -1
  12. package/dist/chatgpt/index.js +1 -1
  13. package/dist/claude/index.cjs +1 -1
  14. package/dist/claude/index.js +1 -1
  15. package/dist/host/chatgpt/index.cjs +1 -1
  16. package/dist/host/chatgpt/index.js +1 -1
  17. package/dist/index.cjs +3 -3
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.js +3 -3
  20. package/dist/index.js.map +1 -1
  21. package/dist/inspector/index.cjs +1 -1
  22. package/dist/inspector/index.js +1 -1
  23. package/dist/{inspector-BBDa5yCm.js → inspector-60Na_Zc4.js} +2 -2
  24. package/dist/inspector-60Na_Zc4.js.map +1 -0
  25. package/dist/{inspector-DAA1Wiyh.cjs → inspector-D0qOqYX2.cjs} +2 -2
  26. package/dist/{inspector-BBDa5yCm.js.map → inspector-D0qOqYX2.cjs.map} +1 -1
  27. package/dist/mcp/index.cjs +24 -3
  28. package/dist/mcp/index.cjs.map +1 -1
  29. package/dist/mcp/index.js +24 -3
  30. package/dist/mcp/index.js.map +1 -1
  31. package/dist/mcp/types.d.ts +1 -0
  32. package/dist/{use-app-DPkj5Jp_.cjs → use-app-B33mckz4.cjs} +7 -3
  33. package/dist/use-app-B33mckz4.cjs.map +1 -0
  34. package/dist/{use-app-Cr0auUa1.js → use-app-kv5GQr0G.js} +7 -3
  35. package/dist/use-app-kv5GQr0G.js.map +1 -0
  36. package/package.json +3 -3
  37. package/template/README.md +21 -23
  38. package/template/dist/albums/albums.html +1 -1
  39. package/template/dist/albums/albums.json +1 -1
  40. package/template/dist/carousel/carousel.html +1 -1
  41. package/template/dist/carousel/carousel.json +1 -1
  42. package/template/dist/map/map.html +1 -1
  43. package/template/dist/map/map.json +1 -1
  44. package/template/dist/review/review.html +1 -1
  45. package/template/dist/review/review.json +1 -1
  46. package/template/node_modules/.vite/deps/_metadata.json +3 -3
  47. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +6 -2
  48. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
  49. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +1 -1
  50. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
  51. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +6 -2
  52. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
  53. package/template/node_modules/.vite-mcp/deps/_metadata.json +22 -22
  54. package/template/package.json +2 -1
  55. package/template/tests/e2e/visual.spec.ts +2 -2
  56. package/template/tests/evals/albums.eval.ts +1 -1
  57. package/template/tests/evals/map.eval.ts +1 -1
  58. package/template/tests/evals/review.eval.ts +4 -2
  59. package/dist/inspector-DAA1Wiyh.cjs.map +0 -1
  60. package/dist/use-app-Cr0auUa1.js.map +0 -1
  61. package/dist/use-app-DPkj5Jp_.cjs.map +0 -1
package/dist/mcp/index.js CHANGED
@@ -8677,7 +8677,7 @@ var StreamableHTTPServerTransport = class {
8677
8677
  }
8678
8678
  };
8679
8679
  //#endregion
8680
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.5.0_@modelcontextprotocol+sdk@1.29.0_zod@4.3.6__react-_a8a8e071c354e7dd6f62871eadf46f99/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js
8680
+ //#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
8681
8681
  var S = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), W = union([
8682
8682
  literal("inline"),
8683
8683
  literal("fullscreen"),
@@ -9273,6 +9273,26 @@ function injectViteCSP(existingMeta) {
9273
9273
  };
9274
9274
  }
9275
9275
  var startupTimestamp = Date.now().toString(36);
9276
+ /**
9277
+ * Make all properties in a Zod raw shape optional.
9278
+ *
9279
+ * Tool schemas from `src/tools/*.ts` have required fields by default (e.g.
9280
+ * `z.string()`). The dev server needs to accept partial args because:
9281
+ * - Mock mode returns fixture data regardless of args
9282
+ * - Models may not send every required field
9283
+ * - The inspector's "Re-run" button sends args from the last run
9284
+ *
9285
+ * Making fields optional preserves property types/descriptions in `tools/list`
9286
+ * (so models know what args to send) while letting the SDK accept any subset.
9287
+ */
9288
+ function makeSchemaOptional(shape) {
9289
+ const optional = {};
9290
+ for (const [key, value] of Object.entries(shape)) {
9291
+ const v = value;
9292
+ optional[key] = typeof v.optional === "function" ? v.optional() : value;
9293
+ }
9294
+ return optional;
9295
+ }
9276
9296
  function createAppServer(config, simulations, viteMode) {
9277
9297
  const { name = "sunpeak-app", version = "0.1.0", serverInfo } = config;
9278
9298
  const mcpServer = new McpServer({
@@ -9346,6 +9366,7 @@ function createAppServer(config, simulations, viteMode) {
9346
9366
  });
9347
9367
  resourceHandles.set(resourceName, handle);
9348
9368
  }
9369
+ const toolInputSchema = simulation.inputSchema ? makeSchemaOptional(simulation.inputSchema) : z.object({}).passthrough();
9349
9370
  const fullToolMeta = {
9350
9371
  ...toolMeta,
9351
9372
  ui: {
@@ -9355,7 +9376,7 @@ function createAppServer(config, simulations, viteMode) {
9355
9376
  };
9356
9377
  const toolHandle = hZ(mcpServer, tool.name, {
9357
9378
  description: tool.description,
9358
- inputSchema: z.object({}).passthrough(),
9379
+ inputSchema: toolInputSchema,
9359
9380
  ...simulation.outputSchema ? { outputSchema: simulation.outputSchema } : {},
9360
9381
  annotations: tool.annotations,
9361
9382
  _meta: fullToolMeta
@@ -9420,7 +9441,7 @@ function createAppServer(config, simulations, viteMode) {
9420
9441
  const realHandler = simulation.handler;
9421
9442
  const plainToolConfig = {
9422
9443
  description: tool.description,
9423
- inputSchema: z.object({}).passthrough(),
9444
+ inputSchema: simulation.inputSchema ? makeSchemaOptional(simulation.inputSchema) : z.object({}).passthrough(),
9424
9445
  ...simulation.outputSchema ? { outputSchema: simulation.outputSchema } : {},
9425
9446
  annotations: tool.annotations,
9426
9447
  _meta: toolMeta