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.
- package/README.md +2 -1
- package/bin/commands/deploy.mjs +18 -8
- package/bin/commands/dev.mjs +60 -4
- package/bin/commands/login.mjs +73 -55
- package/bin/commands/logout.mjs +26 -12
- package/bin/commands/mcp.mjs +1 -1
- package/bin/commands/pull.mjs +60 -39
- package/bin/commands/push.mjs +73 -49
- package/bin/commands/upgrade.mjs +203 -0
- package/bin/sunpeak.js +68 -35
- package/dist/chatgpt/chatgpt-simulator.d.ts +2 -1
- package/dist/index.cjs +13 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -14
- package/dist/index.js.map +1 -1
- package/dist/mcp/entry.cjs +41 -9
- package/dist/mcp/entry.cjs.map +1 -1
- package/dist/mcp/entry.js +42 -10
- package/dist/mcp/entry.js.map +1 -1
- package/dist/mcp/index.cjs +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/{server-CziiHU7V.cjs → server-B9YgCQdS.cjs} +3 -2
- package/dist/{server-CziiHU7V.cjs.map → server-B9YgCQdS.cjs.map} +1 -1
- package/dist/{server-D8kyzuiq.js → server-DVmTC-SF.js} +3 -2
- package/dist/{server-D8kyzuiq.js.map → server-DVmTC-SF.js.map} +1 -1
- package/dist/style.css +62 -0
- package/dist/types/simulation.d.ts +1 -1
- package/package.json +1 -1
- package/template/.sunpeak/dev.tsx +78 -15
- package/template/.sunpeak/vite-env.d.ts +1 -0
- package/template/README.md +35 -20
- package/template/dist/albums.js +1 -1
- package/template/dist/albums.json +3 -2
- package/template/dist/carousel.js +1 -1
- package/template/dist/carousel.json +3 -2
- package/template/dist/confirmation.js +49 -0
- package/template/dist/confirmation.json +16 -0
- package/template/dist/counter.js +1 -1
- package/template/dist/counter.json +7 -2
- package/template/dist/map.js +1 -1
- package/template/dist/map.json +6 -3
- package/template/node_modules/.vite/deps/_metadata.json +19 -19
- package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/template/src/components/map/map-view.test.tsx +1 -1
- package/template/src/components/map/map-view.tsx +1 -1
- package/template/src/components/map/map.tsx +1 -1
- package/template/src/components/map/place-card.test.tsx +1 -1
- package/template/src/components/map/place-card.tsx +1 -1
- package/template/src/components/map/place-carousel.test.tsx +1 -1
- package/template/src/components/map/place-carousel.tsx +1 -1
- package/template/src/components/map/place-inspector.test.tsx +1 -1
- package/template/src/components/map/place-inspector.tsx +1 -1
- package/template/src/components/map/place-list.test.tsx +1 -1
- package/template/src/components/map/place-list.tsx +1 -1
- package/template/src/components/map/types.ts +18 -0
- package/template/src/resources/albums-resource.json +1 -1
- package/template/src/resources/carousel-resource.json +1 -1
- package/template/src/resources/confirmation-resource.json +12 -0
- package/template/src/resources/confirmation-resource.tsx +479 -0
- package/template/src/resources/counter-resource.json +4 -1
- package/template/src/resources/index.ts +39 -4
- package/template/src/resources/map-resource.json +7 -2
- package/template/src/simulations/albums-show-simulation.json +131 -0
- package/template/src/simulations/carousel-show-simulation.json +68 -0
- package/template/src/simulations/confirmation-diff-simulation.json +80 -0
- package/template/src/simulations/confirmation-post-simulation.json +56 -0
- package/template/src/simulations/confirmation-purchase-simulation.json +88 -0
- package/template/src/simulations/counter-show-simulation.json +20 -0
- package/template/src/simulations/index.ts +17 -12
- package/template/src/simulations/map-show-simulation.json +123 -0
- package/template/src/vite-env.d.ts +1 -0
- package/template/tsconfig.json +1 -1
- package/template/src/simulations/albums-simulation.ts +0 -147
- package/template/src/simulations/carousel-simulation.ts +0 -84
- package/template/src/simulations/counter-simulation.ts +0 -34
- package/template/src/simulations/map-simulation.ts +0 -154
package/dist/index.cjs
CHANGED
|
@@ -7585,6 +7585,8 @@ function Conversation({
|
|
|
7585
7585
|
}) {
|
|
7586
7586
|
const displayMode = useDisplayMode() ?? "inline";
|
|
7587
7587
|
const api = useWidgetAPI();
|
|
7588
|
+
const userAgent = useUserAgent();
|
|
7589
|
+
const isDesktop = (userAgent == null ? void 0 : userAgent.device.type) === "desktop";
|
|
7588
7590
|
const containerWidth = screenWidth === "full" ? "100%" : `${SCREEN_WIDTHS[screenWidth]}px`;
|
|
7589
7591
|
if (displayMode === "fullscreen") {
|
|
7590
7592
|
const handleClose = () => {
|
|
@@ -7614,8 +7616,8 @@ function Conversation({
|
|
|
7614
7616
|
children: /* @__PURE__ */ jsxRuntime.jsx(CloseBold, {})
|
|
7615
7617
|
}
|
|
7616
7618
|
) }),
|
|
7617
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-primary flex items-center justify-center text-base", children: appName }),
|
|
7618
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7619
|
+
isDesktop && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-primary flex items-center justify-center text-base", children: appName }),
|
|
7620
|
+
isDesktop && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7619
7621
|
Button,
|
|
7620
7622
|
{
|
|
7621
7623
|
variant: "outline",
|
|
@@ -7947,11 +7949,8 @@ function ChatGPTSimulator({
|
|
|
7947
7949
|
}) {
|
|
7948
7950
|
const [screenWidth, setScreenWidth] = React__namespace.useState("full");
|
|
7949
7951
|
const isMobileWidth = (width) => width === "mobile-s" || width === "mobile-l";
|
|
7950
|
-
const
|
|
7951
|
-
const
|
|
7952
|
-
simulations.length > 0 ? getSimulationKey(simulations[0]) : ""
|
|
7953
|
-
);
|
|
7954
|
-
const selectedSim = simulations.find((sim) => getSimulationKey(sim) === selectedKey);
|
|
7952
|
+
const [selectedIndex, setSelectedIndex] = React__namespace.useState(0);
|
|
7953
|
+
const selectedSim = simulations[selectedIndex];
|
|
7955
7954
|
const userMessage = selectedSim == null ? void 0 : selectedSim.userMessage;
|
|
7956
7955
|
const mock = React.useMemo(
|
|
7957
7956
|
() => initMockOpenAI({
|
|
@@ -7983,7 +7982,7 @@ function ChatGPTSimulator({
|
|
|
7983
7982
|
mock.widgetState = ((_j = selectedSim.simulationGlobals) == null ? void 0 : _j.widgetState) ?? null;
|
|
7984
7983
|
mock.toolOutput = ((_k = selectedSim.toolCall) == null ? void 0 : _k.structuredContent) ?? null;
|
|
7985
7984
|
}
|
|
7986
|
-
}, [
|
|
7985
|
+
}, [selectedIndex, selectedSim, mock]);
|
|
7987
7986
|
const theme = useTheme() ?? DEFAULT_THEME;
|
|
7988
7987
|
const displayMode = useDisplayMode() ?? DEFAULT_DISPLAY_MODE;
|
|
7989
7988
|
const locale = useLocale() ?? "en-US";
|
|
@@ -8073,7 +8072,7 @@ function ChatGPTSimulator({
|
|
|
8073
8072
|
setViewParamsError("");
|
|
8074
8073
|
}
|
|
8075
8074
|
}, [
|
|
8076
|
-
|
|
8075
|
+
selectedIndex,
|
|
8077
8076
|
toolInput,
|
|
8078
8077
|
toolOutput,
|
|
8079
8078
|
toolResponseMetadata,
|
|
@@ -8112,13 +8111,13 @@ function ChatGPTSimulator({
|
|
|
8112
8111
|
simulations.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(SidebarControl, { label: "Simulation", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8113
8112
|
SidebarSelect,
|
|
8114
8113
|
{
|
|
8115
|
-
value:
|
|
8116
|
-
onChange: (value) =>
|
|
8117
|
-
options: simulations.map((sim) => {
|
|
8114
|
+
value: String(selectedIndex),
|
|
8115
|
+
onChange: (value) => setSelectedIndex(Number(value)),
|
|
8116
|
+
options: simulations.map((sim, index2) => {
|
|
8118
8117
|
const resourceTitle = sim.resource.title || sim.resource.name;
|
|
8119
8118
|
const toolTitle = sim.tool.title || sim.tool.name;
|
|
8120
8119
|
return {
|
|
8121
|
-
value:
|
|
8120
|
+
value: String(index2),
|
|
8122
8121
|
label: `${resourceTitle}: ${toolTitle}`
|
|
8123
8122
|
};
|
|
8124
8123
|
})
|
|
@@ -8439,7 +8438,7 @@ function ChatGPTSimulator({
|
|
|
8439
8438
|
resourceMeta: selectedSim == null ? void 0 : selectedSim.resource._meta,
|
|
8440
8439
|
children: content
|
|
8441
8440
|
},
|
|
8442
|
-
|
|
8441
|
+
selectedIndex
|
|
8443
8442
|
)
|
|
8444
8443
|
}
|
|
8445
8444
|
) });
|