sunpeak 0.7.11 → 0.8.4

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 (76) hide show
  1. package/README.md +2 -1
  2. package/bin/commands/deploy.mjs +18 -8
  3. package/bin/commands/dev.mjs +60 -4
  4. package/bin/commands/login.mjs +73 -55
  5. package/bin/commands/logout.mjs +26 -12
  6. package/bin/commands/mcp.mjs +1 -1
  7. package/bin/commands/pull.mjs +60 -39
  8. package/bin/commands/push.mjs +73 -49
  9. package/bin/commands/upgrade.mjs +203 -0
  10. package/bin/sunpeak.js +68 -35
  11. package/dist/chatgpt/chatgpt-simulator.d.ts +2 -1
  12. package/dist/index.cjs +13 -14
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.js +13 -14
  15. package/dist/index.js.map +1 -1
  16. package/dist/mcp/entry.cjs +41 -9
  17. package/dist/mcp/entry.cjs.map +1 -1
  18. package/dist/mcp/entry.js +42 -10
  19. package/dist/mcp/entry.js.map +1 -1
  20. package/dist/mcp/index.cjs +1 -1
  21. package/dist/mcp/index.js +1 -1
  22. package/dist/{server-CziiHU7V.cjs → server-B9YgCQdS.cjs} +3 -2
  23. package/dist/{server-CziiHU7V.cjs.map → server-B9YgCQdS.cjs.map} +1 -1
  24. package/dist/{server-D8kyzuiq.js → server-DVmTC-SF.js} +3 -2
  25. package/dist/{server-D8kyzuiq.js.map → server-DVmTC-SF.js.map} +1 -1
  26. package/dist/style.css +62 -0
  27. package/dist/types/simulation.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/template/.sunpeak/dev.tsx +78 -15
  30. package/template/.sunpeak/vite-env.d.ts +1 -0
  31. package/template/README.md +35 -20
  32. package/template/dist/albums.js +1 -1
  33. package/template/dist/albums.json +3 -2
  34. package/template/dist/carousel.js +1 -1
  35. package/template/dist/carousel.json +3 -2
  36. package/template/dist/confirmation.js +49 -0
  37. package/template/dist/confirmation.json +16 -0
  38. package/template/dist/counter.js +1 -1
  39. package/template/dist/counter.json +7 -2
  40. package/template/dist/map.js +1 -1
  41. package/template/dist/map.json +6 -3
  42. package/template/node_modules/.vite/deps/_metadata.json +19 -19
  43. package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  44. package/template/src/components/map/map-view.test.tsx +1 -1
  45. package/template/src/components/map/map-view.tsx +1 -1
  46. package/template/src/components/map/map.tsx +1 -1
  47. package/template/src/components/map/place-card.test.tsx +1 -1
  48. package/template/src/components/map/place-card.tsx +1 -1
  49. package/template/src/components/map/place-carousel.test.tsx +1 -1
  50. package/template/src/components/map/place-carousel.tsx +1 -1
  51. package/template/src/components/map/place-inspector.test.tsx +1 -1
  52. package/template/src/components/map/place-inspector.tsx +1 -1
  53. package/template/src/components/map/place-list.test.tsx +1 -1
  54. package/template/src/components/map/place-list.tsx +1 -1
  55. package/template/src/components/map/types.ts +18 -0
  56. package/template/src/resources/albums-resource.json +1 -1
  57. package/template/src/resources/carousel-resource.json +1 -1
  58. package/template/src/resources/confirmation-resource.json +12 -0
  59. package/template/src/resources/confirmation-resource.tsx +479 -0
  60. package/template/src/resources/counter-resource.json +4 -1
  61. package/template/src/resources/index.ts +39 -4
  62. package/template/src/resources/map-resource.json +7 -2
  63. package/template/src/simulations/albums-show-simulation.json +131 -0
  64. package/template/src/simulations/carousel-show-simulation.json +68 -0
  65. package/template/src/simulations/confirmation-diff-simulation.json +80 -0
  66. package/template/src/simulations/confirmation-post-simulation.json +56 -0
  67. package/template/src/simulations/confirmation-purchase-simulation.json +88 -0
  68. package/template/src/simulations/counter-show-simulation.json +20 -0
  69. package/template/src/simulations/index.ts +17 -12
  70. package/template/src/simulations/map-show-simulation.json +123 -0
  71. package/template/src/vite-env.d.ts +1 -0
  72. package/template/tsconfig.json +1 -1
  73. package/template/src/simulations/albums-simulation.ts +0 -147
  74. package/template/src/simulations/carousel-simulation.ts +0 -84
  75. package/template/src/simulations/counter-simulation.ts +0 -34
  76. package/template/src/simulations/map-simulation.ts +0 -154
package/dist/index.js CHANGED
@@ -7566,6 +7566,8 @@ function Conversation({
7566
7566
  }) {
7567
7567
  const displayMode = useDisplayMode() ?? "inline";
7568
7568
  const api = useWidgetAPI();
7569
+ const userAgent = useUserAgent();
7570
+ const isDesktop = (userAgent == null ? void 0 : userAgent.device.type) === "desktop";
7569
7571
  const containerWidth = screenWidth === "full" ? "100%" : `${SCREEN_WIDTHS[screenWidth]}px`;
7570
7572
  if (displayMode === "fullscreen") {
7571
7573
  const handleClose = () => {
@@ -7595,8 +7597,8 @@ function Conversation({
7595
7597
  children: /* @__PURE__ */ jsx(CloseBold, {})
7596
7598
  }
7597
7599
  ) }),
7598
- /* @__PURE__ */ jsx("div", { className: "text-primary flex items-center justify-center text-base", children: appName }),
7599
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxs(
7600
+ isDesktop && /* @__PURE__ */ jsx("div", { className: "text-primary flex items-center justify-center text-base", children: appName }),
7601
+ isDesktop && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxs(
7600
7602
  Button,
7601
7603
  {
7602
7604
  variant: "outline",
@@ -7928,11 +7930,8 @@ function ChatGPTSimulator({
7928
7930
  }) {
7929
7931
  const [screenWidth, setScreenWidth] = React.useState("full");
7930
7932
  const isMobileWidth = (width) => width === "mobile-s" || width === "mobile-l";
7931
- const getSimulationKey = (sim) => `${sim.resource.name}-${sim.tool.name}`;
7932
- const [selectedKey, setSelectedKey] = React.useState(
7933
- simulations.length > 0 ? getSimulationKey(simulations[0]) : ""
7934
- );
7935
- const selectedSim = simulations.find((sim) => getSimulationKey(sim) === selectedKey);
7933
+ const [selectedIndex, setSelectedIndex] = React.useState(0);
7934
+ const selectedSim = simulations[selectedIndex];
7936
7935
  const userMessage = selectedSim == null ? void 0 : selectedSim.userMessage;
7937
7936
  const mock = useMemo(
7938
7937
  () => initMockOpenAI({
@@ -7964,7 +7963,7 @@ function ChatGPTSimulator({
7964
7963
  mock.widgetState = ((_j = selectedSim.simulationGlobals) == null ? void 0 : _j.widgetState) ?? null;
7965
7964
  mock.toolOutput = ((_k = selectedSim.toolCall) == null ? void 0 : _k.structuredContent) ?? null;
7966
7965
  }
7967
- }, [selectedKey, selectedSim, mock]);
7966
+ }, [selectedIndex, selectedSim, mock]);
7968
7967
  const theme = useTheme() ?? DEFAULT_THEME;
7969
7968
  const displayMode = useDisplayMode() ?? DEFAULT_DISPLAY_MODE;
7970
7969
  const locale = useLocale() ?? "en-US";
@@ -8054,7 +8053,7 @@ function ChatGPTSimulator({
8054
8053
  setViewParamsError("");
8055
8054
  }
8056
8055
  }, [
8057
- selectedKey,
8056
+ selectedIndex,
8058
8057
  toolInput,
8059
8058
  toolOutput,
8060
8059
  toolResponseMetadata,
@@ -8093,13 +8092,13 @@ function ChatGPTSimulator({
8093
8092
  simulations.length > 0 && /* @__PURE__ */ jsx(SidebarControl, { label: "Simulation", children: /* @__PURE__ */ jsx(
8094
8093
  SidebarSelect,
8095
8094
  {
8096
- value: selectedKey,
8097
- onChange: (value) => setSelectedKey(value),
8098
- options: simulations.map((sim) => {
8095
+ value: String(selectedIndex),
8096
+ onChange: (value) => setSelectedIndex(Number(value)),
8097
+ options: simulations.map((sim, index2) => {
8099
8098
  const resourceTitle = sim.resource.title || sim.resource.name;
8100
8099
  const toolTitle = sim.tool.title || sim.tool.name;
8101
8100
  return {
8102
- value: getSimulationKey(sim),
8101
+ value: String(index2),
8103
8102
  label: `${resourceTitle}: ${toolTitle}`
8104
8103
  };
8105
8104
  })
@@ -8420,7 +8419,7 @@ function ChatGPTSimulator({
8420
8419
  resourceMeta: selectedSim == null ? void 0 : selectedSim.resource._meta,
8421
8420
  children: content
8422
8421
  },
8423
- selectedKey
8422
+ selectedIndex
8424
8423
  )
8425
8424
  }
8426
8425
  ) });