sunpeak 0.19.4 → 0.19.12

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 +6 -4
  2. package/bin/commands/dev.mjs +1 -1
  3. package/bin/commands/inspect.mjs +1 -1
  4. package/bin/commands/new.mjs +92 -10
  5. package/bin/commands/start.mjs +3 -1
  6. package/bin/commands/test-init.mjs +548 -76
  7. package/bin/commands/test.mjs +401 -4
  8. package/bin/lib/eval/eval-providers.mjs +34 -0
  9. package/bin/lib/eval/eval-reporter.mjs +105 -0
  10. package/bin/lib/eval/eval-runner.mjs +362 -0
  11. package/bin/lib/eval/eval-types.d.mts +168 -0
  12. package/bin/lib/eval/eval-vitest-plugin.mjs +147 -0
  13. package/bin/lib/eval/model-registry.mjs +73 -0
  14. package/bin/lib/inspect/inspect-config.mjs +1 -1
  15. package/bin/lib/sandbox-server.mjs +5 -2
  16. package/bin/lib/test/test-config.mjs +1 -1
  17. package/bin/sunpeak.js +1 -0
  18. package/dist/chatgpt/index.cjs +1 -1
  19. package/dist/chatgpt/index.js +1 -1
  20. package/dist/claude/index.cjs +1 -1
  21. package/dist/claude/index.js +1 -1
  22. package/dist/host/chatgpt/index.cjs +1 -1
  23. package/dist/host/chatgpt/index.js +1 -1
  24. package/dist/index.cjs +2 -2
  25. package/dist/index.js +2 -2
  26. package/dist/inspector/index.cjs +1 -1
  27. package/dist/inspector/index.js +1 -1
  28. package/dist/{inspector-Bp9jrHIu.js → inspector-D5DckQuU.js} +19 -19
  29. package/dist/{inspector-Bp9jrHIu.js.map → inspector-D5DckQuU.js.map} +1 -1
  30. package/dist/{inspector-Cvq3yjNL.cjs → inspector-jY9O18z9.cjs} +19 -19
  31. package/dist/{inspector-Cvq3yjNL.cjs.map → inspector-jY9O18z9.cjs.map} +1 -1
  32. package/dist/mcp/index.cjs +2 -2
  33. package/dist/mcp/index.cjs.map +1 -1
  34. package/dist/mcp/index.js +2 -2
  35. package/dist/mcp/index.js.map +1 -1
  36. package/dist/{use-app-Ck5kR1Sf.js → use-app-Bfargfa3.js} +2 -2
  37. package/dist/{use-app-Ck5kR1Sf.js.map → use-app-Bfargfa3.js.map} +1 -1
  38. package/dist/{use-app-DHYiev3D.cjs → use-app-CbsBEmwv.cjs} +2 -2
  39. package/dist/{use-app-DHYiev3D.cjs.map → use-app-CbsBEmwv.cjs.map} +1 -1
  40. package/package.json +32 -2
  41. package/template/README.md +17 -7
  42. package/template/_gitignore +2 -0
  43. package/template/dist/albums/albums.html +1 -1
  44. package/template/dist/albums/albums.json +1 -1
  45. package/template/dist/carousel/carousel.html +1 -1
  46. package/template/dist/carousel/carousel.json +1 -1
  47. package/template/dist/map/map.html +1 -1
  48. package/template/dist/map/map.json +1 -1
  49. package/template/dist/review/review.html +1 -1
  50. package/template/dist/review/review.json +1 -1
  51. package/template/node_modules/.bin/vitest +2 -2
  52. package/template/node_modules/.vite/deps/_metadata.json +3 -3
  53. package/template/node_modules/.vite-mcp/deps/_metadata.json +20 -20
  54. package/template/node_modules/.vite-mcp/deps/vitest.js +7 -7
  55. package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -1
  56. package/template/tests/evals/_env.example +5 -0
  57. package/template/tests/evals/albums.eval.ts +31 -0
  58. package/template/tests/evals/carousel.eval.ts +16 -0
  59. package/template/tests/evals/eval.config.ts +26 -0
  60. package/template/tests/evals/map.eval.ts +16 -0
  61. package/template/tests/evals/review.eval.ts +53 -0
@@ -3996,7 +3996,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
3996
3996
  onChange: setProdResources,
3997
3997
  label: "Prod Resources",
3998
3998
  tooltip: "Load resources from dist/ builds instead of HMR",
3999
- docsPath: "api-reference/cli/dev#prod-tools-and-prod-resources-flags"
3999
+ docsPath: "app-framework/cli/dev#prod-tools-and-prod-resources-flags"
4000
4000
  }),
4001
4001
  hasTools && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4002
4002
  className: "grid grid-cols-2 gap-2",
@@ -4004,7 +4004,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4004
4004
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4005
4005
  label: "Tool",
4006
4006
  tooltip: "Tool to inspect",
4007
- docsPath: "api-reference/cli/dev",
4007
+ docsPath: "app-framework/cli/dev",
4008
4008
  "data-testid": "tool-selector",
4009
4009
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarSelect, {
4010
4010
  value: selectedToolName,
@@ -4018,7 +4018,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4018
4018
  })
4019
4019
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4020
4020
  label: selectedToolInfo && selectedToolInfo.fixtureSimNames.length > 0 ? "Simulation" : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
4021
- href: `${DOCS_BASE_URL}/api-reference/simulations/simulation`,
4021
+ href: `${DOCS_BASE_URL}/testing/simulations`,
4022
4022
  target: "_blank",
4023
4023
  rel: "noopener noreferrer",
4024
4024
  className: "no-underline transition-colors",
@@ -4032,7 +4032,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4032
4032
  children: "Simulation"
4033
4033
  }),
4034
4034
  tooltip: selectedToolInfo && selectedToolInfo.fixtureSimNames.length > 0 ? "Test fixture with mock data" : "Create simulations for faster testing",
4035
- docsPath: "api-reference/simulations/simulation",
4035
+ docsPath: "testing/simulations",
4036
4036
  "data-testid": "simulation-selector",
4037
4037
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarSelect, {
4038
4038
  value: activeSimulationName ?? "__none__",
@@ -4052,7 +4052,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4052
4052
  children: [registeredHosts.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4053
4053
  label: "Host",
4054
4054
  tooltip: "Host runtime to simulate",
4055
- docsPath: "api-reference/functions/host-detection",
4055
+ docsPath: "app-framework/functions/host-detection",
4056
4056
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarSelect, {
4057
4057
  value: state.activeHost,
4058
4058
  onChange: (value) => state.setActiveHost(value),
@@ -4064,7 +4064,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4064
4064
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4065
4065
  label: "Width",
4066
4066
  tooltip: "Chat width",
4067
- docsPath: "api-reference/simulations/inspector",
4067
+ docsPath: "testing/inspector",
4068
4068
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarSelect, {
4069
4069
  value: state.screenWidth,
4070
4070
  onChange: (value) => state.setScreenWidth(value),
@@ -4093,7 +4093,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4093
4093
  label: "Host Context",
4094
4094
  defaultCollapsed: false,
4095
4095
  tooltip: "Host-provided environment",
4096
- docsPath: "api-reference/hooks/use-host-context",
4096
+ docsPath: "app-framework/hooks/use-host-context",
4097
4097
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4098
4098
  className: "space-y-1",
4099
4099
  children: [
@@ -4102,7 +4102,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4102
4102
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4103
4103
  label: "Theme",
4104
4104
  tooltip: "Host color theme",
4105
- docsPath: "api-reference/hooks/use-theme",
4105
+ docsPath: "app-framework/hooks/use-theme",
4106
4106
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarToggle, {
4107
4107
  value: state.theme,
4108
4108
  onChange: (value) => state.setTheme(value),
@@ -4117,7 +4117,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4117
4117
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4118
4118
  label: "Locale",
4119
4119
  tooltip: "BCP 47 language tag",
4120
- docsPath: "api-reference/hooks/use-locale",
4120
+ docsPath: "app-framework/hooks/use-locale",
4121
4121
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarInput, {
4122
4122
  applyOnBlur: true,
4123
4123
  value: state.locale,
@@ -4129,7 +4129,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4129
4129
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4130
4130
  label: "Display Mode",
4131
4131
  tooltip: "Host resource rendering paradigm",
4132
- docsPath: "api-reference/hooks/use-display-mode",
4132
+ docsPath: "app-framework/hooks/use-display-mode",
4133
4133
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarToggle, {
4134
4134
  value: state.displayMode,
4135
4135
  onChange: (value) => state.setDisplayMode(value),
@@ -4156,7 +4156,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4156
4156
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4157
4157
  label: "Platform",
4158
4158
  tooltip: "End user device platform",
4159
- docsPath: "api-reference/hooks/use-platform",
4159
+ docsPath: "app-framework/hooks/use-platform",
4160
4160
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarSelect, {
4161
4161
  value: state.platform,
4162
4162
  onChange: (value) => {
@@ -4194,7 +4194,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4194
4194
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4195
4195
  label: "Capabilities",
4196
4196
  tooltip: "End user device capabilities",
4197
- docsPath: "api-reference/hooks/use-device-capabilities",
4197
+ docsPath: "app-framework/hooks/use-device-capabilities",
4198
4198
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4199
4199
  className: "flex gap-2",
4200
4200
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarCheckbox, {
@@ -4213,7 +4213,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4213
4213
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4214
4214
  label: "Time Zone",
4215
4215
  tooltip: "End user IANA time zone",
4216
- docsPath: "api-reference/hooks/use-time-zone",
4216
+ docsPath: "app-framework/hooks/use-time-zone",
4217
4217
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarInput, {
4218
4218
  applyOnBlur: true,
4219
4219
  value: state.timeZone,
@@ -4224,7 +4224,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4224
4224
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4225
4225
  label: "Container Dimensions",
4226
4226
  tooltip: "Host-enforced size constraints (px)",
4227
- docsPath: "api-reference/hooks/use-viewport",
4227
+ docsPath: "app-framework/hooks/use-viewport",
4228
4228
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4229
4229
  className: "grid grid-cols-4 gap-1",
4230
4230
  children: [
@@ -4274,7 +4274,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4274
4274
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarControl, {
4275
4275
  label: "Safe Area Insets",
4276
4276
  tooltip: "Device safe area padding (px)",
4277
- docsPath: "api-reference/hooks/use-safe-area",
4277
+ docsPath: "app-framework/hooks/use-safe-area",
4278
4278
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4279
4279
  className: "grid grid-cols-4 gap-1",
4280
4280
  children: [
@@ -4356,7 +4356,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4356
4356
  label: "App Context",
4357
4357
  defaultCollapsed: true,
4358
4358
  tooltip: "App-provided context shared with the model",
4359
- docsPath: "api-reference/hooks/use-app-state",
4359
+ docsPath: "app-framework/hooks/use-app-state",
4360
4360
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarTextarea, {
4361
4361
  value: state.modelContextJson,
4362
4362
  onChange: (json) => state.validateJSON(json, state.setModelContextJson, state.setModelContextError),
@@ -4372,7 +4372,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4372
4372
  label: "Tool Input (JSON)",
4373
4373
  defaultCollapsed: false,
4374
4374
  tooltip: "Arguments passed to the tool",
4375
- docsPath: "api-reference/hooks/use-tool-data",
4375
+ docsPath: "app-framework/hooks/use-tool-data",
4376
4376
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarTextarea, {
4377
4377
  value: state.toolInputJson,
4378
4378
  onChange: (json) => state.validateJSON(json, state.setToolInputJson, state.setToolInputError),
@@ -4386,7 +4386,7 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4386
4386
  label: "Tool Result (JSON)",
4387
4387
  defaultCollapsed: false,
4388
4388
  tooltip: "Structured content returned by the tool",
4389
- docsPath: "api-reference/hooks/use-tool-data",
4389
+ docsPath: "app-framework/hooks/use-tool-data",
4390
4390
  "data-testid": "tool-result-section",
4391
4391
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarTextarea, {
4392
4392
  value: state.toolResultJson,
@@ -4548,4 +4548,4 @@ Object.defineProperty(exports, "useThemeContext", {
4548
4548
  }
4549
4549
  });
4550
4550
 
4551
- //# sourceMappingURL=inspector-Cvq3yjNL.cjs.map
4551
+ //# sourceMappingURL=inspector-jY9O18z9.cjs.map