sunpeak 0.20.11 → 0.20.16

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 (70) hide show
  1. package/bin/commands/dev.mjs +3 -3
  2. package/bin/sunpeak.js +13 -8
  3. package/dist/chatgpt/index.cjs +1 -1
  4. package/dist/chatgpt/index.js +2 -2
  5. package/dist/claude/index.cjs +1 -1
  6. package/dist/claude/index.js +1 -1
  7. package/dist/host/chatgpt/index.cjs +1 -1
  8. package/dist/host/chatgpt/index.js +1 -1
  9. package/dist/index.cjs +5 -5
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +5 -5
  12. package/dist/index.js.map +1 -1
  13. package/dist/inspector/index.cjs +1 -1
  14. package/dist/inspector/index.js +2 -2
  15. package/dist/{inspector-JirXykqh.js → inspector-BVYIkjfw.js} +110 -16
  16. package/dist/inspector-BVYIkjfw.js.map +1 -0
  17. package/dist/{inspector-CjEFyXqc.cjs → inspector-mL_Ysqj6.cjs} +110 -16
  18. package/dist/inspector-mL_Ysqj6.cjs.map +1 -0
  19. package/dist/mcp/index.cjs +13 -13
  20. package/dist/mcp/index.cjs.map +1 -1
  21. package/dist/mcp/index.js +13 -13
  22. package/dist/mcp/index.js.map +1 -1
  23. package/dist/{protocol-VbxlTDik.js → protocol-C58brCtf.js} +51 -51
  24. package/dist/protocol-C58brCtf.js.map +1 -0
  25. package/dist/{protocol-WZSAhsV8.cjs → protocol-CFifOG2U.cjs} +51 -51
  26. package/dist/protocol-CFifOG2U.cjs.map +1 -0
  27. package/dist/{use-app-BEelk4Pj.cjs → use-app-BXVq24n8.cjs} +5 -5
  28. package/dist/{use-app-BEelk4Pj.cjs.map → use-app-BXVq24n8.cjs.map} +1 -1
  29. package/dist/{use-app-imsRg_Sq.js → use-app-L0OZBROc.js} +5 -5
  30. package/dist/{use-app-imsRg_Sq.js.map → use-app-L0OZBROc.js.map} +1 -1
  31. package/dist/{v4-81B3d_AO.cjs → v4-BtFbnniV.cjs} +1133 -403
  32. package/dist/v4-BtFbnniV.cjs.map +1 -0
  33. package/dist/{v4-zo4hA9Qs.js → v4-DfWETn4d.js} +1133 -403
  34. package/dist/v4-DfWETn4d.js.map +1 -0
  35. package/package.json +12 -12
  36. package/template/dist/albums/albums.html +42 -17
  37. package/template/dist/albums/albums.json +1 -1
  38. package/template/dist/carousel/carousel.html +42 -17
  39. package/template/dist/carousel/carousel.json +1 -1
  40. package/template/dist/map/map.html +337 -296
  41. package/template/dist/map/map.json +1 -1
  42. package/template/dist/review/review.html +42 -17
  43. package/template/dist/review/review.json +1 -1
  44. package/template/node_modules/.vite/deps/_metadata.json +3 -3
  45. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +4 -4
  46. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
  47. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +3 -3
  48. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
  49. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +4 -4
  50. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
  51. package/template/node_modules/.vite-mcp/deps/_metadata.json +30 -30
  52. package/template/node_modules/.vite-mcp/deps/{external-B0TEY49X.js → external-BzlnL8_g.js} +1132 -403
  53. package/template/node_modules/.vite-mcp/deps/external-BzlnL8_g.js.map +1 -0
  54. package/template/node_modules/.vite-mcp/deps/mapbox-gl.js +9470 -9295
  55. package/template/node_modules/.vite-mcp/deps/mapbox-gl.js.map +1 -1
  56. package/template/node_modules/.vite-mcp/deps/{protocol-C6_cc6NO.js → protocol-Depaaj0Z.js} +6 -6
  57. package/template/node_modules/.vite-mcp/deps/{protocol-C6_cc6NO.js.map → protocol-Depaaj0Z.js.map} +1 -1
  58. package/template/node_modules/.vite-mcp/deps/{v4-Dqc4MOHZ.js → v4-3k5wOzJw.js} +4 -3
  59. package/template/node_modules/.vite-mcp/deps/v4-3k5wOzJw.js.map +1 -0
  60. package/template/node_modules/.vite-mcp/deps/zod.js +3 -3
  61. package/template/node_modules/.vite-mcp/deps/zod.js.map +1 -1
  62. package/template/package.json +2 -2
  63. package/dist/inspector-CjEFyXqc.cjs.map +0 -1
  64. package/dist/inspector-JirXykqh.js.map +0 -1
  65. package/dist/protocol-VbxlTDik.js.map +0 -1
  66. package/dist/protocol-WZSAhsV8.cjs.map +0 -1
  67. package/dist/v4-81B3d_AO.cjs.map +0 -1
  68. package/dist/v4-zo4hA9Qs.js.map +0 -1
  69. package/template/node_modules/.vite-mcp/deps/external-B0TEY49X.js.map +0 -1
  70. package/template/node_modules/.vite-mcp/deps/v4-Dqc4MOHZ.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../chunk-CoPdw6nB.cjs");
3
- const require_inspector = require("../inspector-CjEFyXqc.cjs");
3
+ const require_inspector = require("../inspector-mL_Ysqj6.cjs");
4
4
  const require_inspector_url = require("../inspector-url-CCgv8H74.cjs");
5
5
  const require_discovery = require("../discovery-C9fQVb1u.cjs");
6
6
  //#region src/inspector/index.ts
@@ -1,5 +1,5 @@
1
- import { I as __exportAll } from "../v4-zo4hA9Qs.js";
2
- import { _ as McpAppHost, a as SidebarControl, b as getRegisteredHosts, c as SidebarTextarea, d as ThemeProvider, f as useThemeContext, g as extractResourceCSP, h as IframeResource, i as SidebarCollapsibleControl, l as SidebarToggle, m as useInspectorState, n as resolveServerToolResult, o as SidebarInput, p as useMcpConnection, r as SidebarCheckbox, s as SidebarSelect, t as Inspector, u as SimpleSidebar, v as SCREEN_WIDTHS, x as registerHostShell, y as getHostShell } from "../inspector-JirXykqh.js";
1
+ import { I as __exportAll } from "../v4-DfWETn4d.js";
2
+ import { _ as McpAppHost, a as SidebarControl, b as getRegisteredHosts, c as SidebarTextarea, d as ThemeProvider, f as useThemeContext, g as extractResourceCSP, h as IframeResource, i as SidebarCollapsibleControl, l as SidebarToggle, m as useInspectorState, n as resolveServerToolResult, o as SidebarInput, p as useMcpConnection, r as SidebarCheckbox, s as SidebarSelect, t as Inspector, u as SimpleSidebar, v as SCREEN_WIDTHS, x as registerHostShell, y as getHostShell } from "../inspector-BVYIkjfw.js";
3
3
  import { t as createInspectorUrl } from "../inspector-url-CyQcuBI9.js";
4
4
  import { c as toPascalCase, i as findResourceKey, n as extractSimulationKey, r as findResourceDirs, s as getComponentName, t as extractResourceKey } from "../discovery-Cgoegt62.js";
5
5
  //#region src/inspector/index.ts
@@ -1,5 +1,5 @@
1
- import { L as __require, _ as record, a as array, b as unknown, f as never, i as _undefined, m as object, o as boolean, p as number, u as literal, v as string, y as union } from "./v4-zo4hA9Qs.js";
2
- import { B as ResourceLinkSchema, C as ListPromptsRequestSchema, D as ListResourcesRequestSchema, E as ListResourceTemplatesResultSchema, F as PingRequestSchema, G as ToolSchema, I as PromptListChangedNotificationSchema, L as ReadResourceRequestSchema, N as LoggingMessageNotificationSchema, O as ListResourcesResultSchema, R as ReadResourceResultSchema, T as ListResourceTemplatesRequestSchema, V as ResourceListChangedNotificationSchema, W as ToolListChangedNotificationSchema, a as CallToolResultSchema, c as CreateMessageRequestSchema, i as CallToolRequestSchema, j as ListToolsResultSchema, m as EmbeddedResourceSchema, s as ContentBlockSchema, t as Protocol, v as ImplementationSchema, w as ListPromptsResultSchema, x as JSONRPCMessageSchema, z as RequestIdSchema } from "./protocol-VbxlTDik.js";
1
+ import { L as __require, _ as record, a as array, b as unknown, f as never, i as _undefined, m as object, o as boolean, p as number, u as literal, v as string, y as union } from "./v4-DfWETn4d.js";
2
+ import { B as ResourceLinkSchema, C as ListPromptsRequestSchema, D as ListResourcesRequestSchema, E as ListResourceTemplatesResultSchema, F as PingRequestSchema, G as ToolSchema, I as PromptListChangedNotificationSchema, L as ReadResourceRequestSchema, N as LoggingMessageNotificationSchema, O as ListResourcesResultSchema, R as ReadResourceResultSchema, T as ListResourceTemplatesRequestSchema, V as ResourceListChangedNotificationSchema, W as ToolListChangedNotificationSchema, a as CallToolResultSchema, c as CreateMessageRequestSchema, i as CallToolRequestSchema, j as ListToolsResultSchema, m as EmbeddedResourceSchema, s as ContentBlockSchema, t as Protocol, v as ImplementationSchema, w as ListPromptsResultSchema, x as JSONRPCMessageSchema, z as RequestIdSchema } from "./protocol-C58brCtf.js";
3
3
  import * as React from "react";
4
4
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -809,7 +809,7 @@ registerHostShell({
809
809
  }`
810
810
  });
811
811
  //#endregion
812
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.7.0_@modelcontextprotocol+sdk@1.29.0_zod@4.3.6__react-_68ee6585f5c29b7de065f869051c80dc/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js
812
+ //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.7.1_@modelcontextprotocol+sdk@1.29.0_zod@4.4.1__react-_92433c7acac2d73b76b395fab111ea67/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js
813
813
  ((X) => typeof __require < "u" ? __require : typeof Proxy < "u" ? new Proxy(X, { get: (Y, Z) => (typeof __require < "u" ? __require : Y)[Z] }) : X)(function(X) {
814
814
  if (typeof __require < "u") return __require.apply(this, arguments);
815
815
  throw Error("Dynamic require of \"" + X + "\" is not supported");
@@ -2588,6 +2588,7 @@ function parseUrlParams() {
2588
2588
  left: safeAreaLeft ? Number(safeAreaLeft) : 0,
2589
2589
  right: safeAreaRight ? Number(safeAreaRight) : 0
2590
2590
  } : void 0;
2591
+ const autoRun = params.get("autoRun") === "true" ? true : void 0;
2591
2592
  return {
2592
2593
  simulation,
2593
2594
  tool,
@@ -2603,9 +2604,63 @@ function parseUrlParams() {
2603
2604
  host: host ?? void 0,
2604
2605
  prodResources,
2605
2606
  sidebar,
2606
- devOverlay
2607
+ devOverlay,
2608
+ autoRun
2607
2609
  };
2608
2610
  }
2611
+ var PREFS_KEY = "sunpeak-inspector-prefs";
2612
+ var VALID_THEMES = new Set(["light", "dark"]);
2613
+ var VALID_DISPLAY_MODES = new Set([
2614
+ "inline",
2615
+ "pip",
2616
+ "fullscreen"
2617
+ ]);
2618
+ var VALID_PLATFORMS = new Set([
2619
+ "web",
2620
+ "desktop",
2621
+ "mobile"
2622
+ ]);
2623
+ var VALID_SCREEN_WIDTHS = new Set([
2624
+ "mobile-s",
2625
+ "mobile-l",
2626
+ "tablet",
2627
+ "full"
2628
+ ]);
2629
+ function sanitizeStoredPrefs(raw) {
2630
+ if (!raw || typeof raw !== "object") return {};
2631
+ const obj = raw;
2632
+ const prefs = {};
2633
+ if (typeof obj.theme === "string" && VALID_THEMES.has(obj.theme)) prefs.theme = obj.theme;
2634
+ if (typeof obj.locale === "string") prefs.locale = obj.locale;
2635
+ if (typeof obj.displayMode === "string" && VALID_DISPLAY_MODES.has(obj.displayMode)) prefs.displayMode = obj.displayMode;
2636
+ if (typeof obj.containerMaxHeight === "number" && Number.isFinite(obj.containerMaxHeight)) prefs.containerMaxHeight = obj.containerMaxHeight;
2637
+ if (typeof obj.containerMaxWidth === "number" && Number.isFinite(obj.containerMaxWidth)) prefs.containerMaxWidth = obj.containerMaxWidth;
2638
+ if (obj.safeAreaInsets && typeof obj.safeAreaInsets === "object") {
2639
+ const insets = obj.safeAreaInsets;
2640
+ if (typeof insets.top === "number" && typeof insets.bottom === "number" && typeof insets.left === "number" && typeof insets.right === "number") prefs.safeAreaInsets = {
2641
+ top: insets.top,
2642
+ bottom: insets.bottom,
2643
+ left: insets.left,
2644
+ right: insets.right
2645
+ };
2646
+ }
2647
+ if (typeof obj.activeHost === "string") prefs.activeHost = obj.activeHost;
2648
+ if (typeof obj.platform === "string" && VALID_PLATFORMS.has(obj.platform)) prefs.platform = obj.platform;
2649
+ if (typeof obj.hover === "boolean") prefs.hover = obj.hover;
2650
+ if (typeof obj.touch === "boolean") prefs.touch = obj.touch;
2651
+ if (typeof obj.screenWidth === "string" && VALID_SCREEN_WIDTHS.has(obj.screenWidth)) prefs.screenWidth = obj.screenWidth;
2652
+ return prefs;
2653
+ }
2654
+ function readStoredPrefs() {
2655
+ if (typeof window === "undefined") return {};
2656
+ try {
2657
+ const raw = localStorage.getItem(PREFS_KEY);
2658
+ if (!raw) return {};
2659
+ return sanitizeStoredPrefs(JSON.parse(raw));
2660
+ } catch {
2661
+ return {};
2662
+ }
2663
+ }
2609
2664
  function useInspectorState({ simulations, defaultHost = "chatgpt" }) {
2610
2665
  const simulationNames = Object.keys(simulations).filter((name) => simulations[name].resource).sort((a, b) => {
2611
2666
  const simA = simulations[a];
@@ -2617,9 +2672,11 @@ function useInspectorState({ simulations, defaultHost = "chatgpt" }) {
2617
2672
  return labelA.localeCompare(labelB);
2618
2673
  });
2619
2674
  const urlParams = useMemo(() => parseUrlParams(), []);
2620
- const [screenWidth, setScreenWidth] = useState("full");
2675
+ const autoRun = urlParams.autoRun === true;
2676
+ const storedPrefs = useMemo(() => autoRun ? {} : readStoredPrefs(), [autoRun]);
2677
+ const [screenWidth, setScreenWidth] = useState(storedPrefs.screenWidth ?? "full");
2621
2678
  const isMobileWidth = (width) => width === "mobile-s" || width === "mobile-l";
2622
- const [activeHost, setActiveHost] = useState(urlParams.host ?? defaultHost);
2679
+ const [activeHost, setActiveHost] = useState(urlParams.host ?? storedPrefs.activeHost ?? defaultHost);
2623
2680
  const [selectedSimulationName, setSelectedSimulationName] = useState(useMemo(() => {
2624
2681
  const defaultName = simulationNames[0] ?? "";
2625
2682
  if (!urlParams.simulation) return defaultName;
@@ -2630,23 +2687,60 @@ function useInspectorState({ simulations, defaultHost = "chatgpt" }) {
2630
2687
  simulationNames
2631
2688
  ]));
2632
2689
  const selectedSim = simulations[selectedSimulationName];
2633
- const [theme, setTheme] = useState(urlParams.theme ?? DEFAULT_THEME);
2634
- const [displayMode, _setDisplayMode] = useState(urlParams.displayMode ?? DEFAULT_DISPLAY_MODE);
2635
- const [locale, setLocale] = useState(urlParams.locale ?? "en-US");
2690
+ const [theme, setTheme] = useState(urlParams.theme ?? storedPrefs.theme ?? DEFAULT_THEME);
2691
+ const [displayMode, _setDisplayMode] = useState(urlParams.displayMode ?? storedPrefs.displayMode ?? DEFAULT_DISPLAY_MODE);
2692
+ const [locale, setLocale] = useState(urlParams.locale ?? storedPrefs.locale ?? "en-US");
2636
2693
  const [containerHeight, setContainerHeight] = useState(void 0);
2637
2694
  const [containerWidth, setContainerWidth] = useState(void 0);
2638
- const [containerMaxHeight, setContainerMaxHeight] = useState(urlParams.containerMaxHeight);
2639
- const [containerMaxWidth, setContainerMaxWidth] = useState(urlParams.containerMaxWidth);
2640
- const [platform, setPlatform] = useState(urlParams.platform ?? DEFAULT_PLATFORM);
2641
- const [hover, setHover] = useState(urlParams.deviceCapabilities?.hover ?? true);
2642
- const [touch, setTouch] = useState(urlParams.deviceCapabilities?.touch ?? false);
2643
- const [safeAreaInsets, setSafeAreaInsets] = useState(urlParams.safeAreaInsets ?? {
2695
+ const [containerMaxHeight, setContainerMaxHeight] = useState(urlParams.containerMaxHeight ?? storedPrefs.containerMaxHeight);
2696
+ const [containerMaxWidth, setContainerMaxWidth] = useState(urlParams.containerMaxWidth ?? storedPrefs.containerMaxWidth);
2697
+ const [platform, setPlatform] = useState(urlParams.platform ?? storedPrefs.platform ?? DEFAULT_PLATFORM);
2698
+ const [hover, setHover] = useState(urlParams.deviceCapabilities?.hover ?? storedPrefs.hover ?? true);
2699
+ const [touch, setTouch] = useState(urlParams.deviceCapabilities?.touch ?? storedPrefs.touch ?? false);
2700
+ const [safeAreaInsets, setSafeAreaInsets] = useState(urlParams.safeAreaInsets ?? storedPrefs.safeAreaInsets ?? {
2644
2701
  top: 0,
2645
2702
  bottom: 0,
2646
2703
  left: 0,
2647
2704
  right: 0
2648
2705
  });
2649
2706
  const [timeZone, setTimeZone] = useState(() => Intl.DateTimeFormat().resolvedOptions().timeZone);
2707
+ const isFirstRender = useRef(true);
2708
+ useEffect(() => {
2709
+ if (isFirstRender.current) {
2710
+ isFirstRender.current = false;
2711
+ return;
2712
+ }
2713
+ if (autoRun) return;
2714
+ try {
2715
+ const prefs = {
2716
+ theme,
2717
+ locale,
2718
+ displayMode,
2719
+ containerMaxHeight,
2720
+ containerMaxWidth,
2721
+ safeAreaInsets,
2722
+ activeHost,
2723
+ platform,
2724
+ hover,
2725
+ touch,
2726
+ screenWidth
2727
+ };
2728
+ localStorage.setItem(PREFS_KEY, JSON.stringify(prefs));
2729
+ } catch {}
2730
+ }, [
2731
+ autoRun,
2732
+ theme,
2733
+ locale,
2734
+ displayMode,
2735
+ containerMaxHeight,
2736
+ containerMaxWidth,
2737
+ safeAreaInsets,
2738
+ activeHost,
2739
+ platform,
2740
+ hover,
2741
+ touch,
2742
+ screenWidth
2743
+ ]);
2650
2744
  const [measuredContentWidth, setMeasuredContentWidth] = useState(void 0);
2651
2745
  const handleContentWidthChange = useCallback((width) => {
2652
2746
  setMeasuredContentWidth(width);
@@ -4495,4 +4589,4 @@ function Inspector({ children, simulations: initialSimulations = {}, appName = "
4495
4589
  //#endregion
4496
4590
  export { DEFAULT_STYLE_VARIABLES as S, McpAppHost as _, SidebarControl as a, getRegisteredHosts as b, SidebarTextarea as c, ThemeProvider as d, useThemeContext as f, extractResourceCSP as g, IframeResource as h, SidebarCollapsibleControl as i, SidebarToggle as l, useInspectorState as m, resolveServerToolResult as n, SidebarInput as o, useMcpConnection as p, SidebarCheckbox as r, SidebarSelect as s, Inspector as t, SimpleSidebar as u, SCREEN_WIDTHS as v, registerHostShell as x, getHostShell as y };
4497
4591
 
4498
- //# sourceMappingURL=inspector-JirXykqh.js.map
4592
+ //# sourceMappingURL=inspector-BVYIkjfw.js.map