sunpeak 0.20.51 → 0.20.56

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 (67) hide show
  1. package/bin/commands/inspect.mjs +122 -17
  2. package/bin/lib/sandbox-server.mjs +34 -5
  3. package/bin/lib/test/base-config.mjs +8 -1
  4. package/dist/chatgpt/index.cjs +1 -1
  5. package/dist/chatgpt/index.js +1 -1
  6. package/dist/claude/index.cjs +1 -1
  7. package/dist/claude/index.js +1 -1
  8. package/dist/embed.css +2 -2
  9. package/dist/host/chatgpt/index.cjs +1 -1
  10. package/dist/host/chatgpt/index.js +1 -1
  11. package/dist/index.cjs +3 -3
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.js +3 -3
  14. package/dist/index.js.map +1 -1
  15. package/dist/inspector/index.cjs +1 -1
  16. package/dist/inspector/index.js +1 -1
  17. package/dist/{inspector-DQyl36w3.js → inspector-BYuRWH6c.js} +36 -7
  18. package/dist/inspector-BYuRWH6c.js.map +1 -0
  19. package/dist/{inspector-WPF8mKwk.cjs → inspector-CoBJOqh4.cjs} +36 -7
  20. package/dist/inspector-CoBJOqh4.cjs.map +1 -0
  21. package/dist/mcp/index.cjs +1 -1
  22. package/dist/mcp/index.cjs.map +1 -1
  23. package/dist/mcp/index.js +1 -1
  24. package/dist/mcp/index.js.map +1 -1
  25. package/dist/sandbox-proxy.html +34 -5
  26. package/dist/style.css +27 -27
  27. package/dist/{use-app-DzgUHmdH.cjs → use-app-DrKg-OJp.cjs} +2 -2
  28. package/dist/{use-app-DzgUHmdH.cjs.map → use-app-DrKg-OJp.cjs.map} +1 -1
  29. package/dist/{use-app-j3as_y6c.js → use-app-nZXXvUxc.js} +2 -2
  30. package/dist/{use-app-j3as_y6c.js.map → use-app-nZXXvUxc.js.map} +1 -1
  31. package/package.json +18 -18
  32. package/template/dist/albums/albums.html +1 -1
  33. package/template/dist/albums/albums.json +1 -1
  34. package/template/dist/carousel/carousel.html +1 -1
  35. package/template/dist/carousel/carousel.json +1 -1
  36. package/template/dist/map/map.html +536 -492
  37. package/template/dist/map/map.json +1 -1
  38. package/template/dist/review/review.html +1 -1
  39. package/template/dist/review/review.json +1 -1
  40. package/template/node_modules/.bin/vite +2 -2
  41. package/template/node_modules/.bin/vitest +2 -2
  42. package/template/node_modules/.vite/deps/_metadata.json +4 -4
  43. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +1 -1
  44. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
  45. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +1 -1
  46. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
  47. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +1 -1
  48. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
  49. package/template/node_modules/.vite-mcp/deps/_metadata.json +25 -25
  50. package/template/node_modules/.vite-mcp/deps/mapbox-gl.js +32928 -31943
  51. package/template/node_modules/.vite-mcp/deps/mapbox-gl.js.map +1 -1
  52. package/template/node_modules/.vite-mcp/deps/vitest.js +21 -21
  53. package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -1
  54. package/template/package.json +7 -7
  55. package/template/tests/e2e/albums.spec.ts +0 -26
  56. package/template/tests/e2e/carousel.spec.ts +7 -63
  57. package/template/tests/e2e/map.spec.ts +0 -28
  58. package/template/tests/e2e/review.spec.ts +8 -45
  59. package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-chatgpt-linux.png +0 -0
  60. package/template/tests/e2e/visual.spec.ts-snapshots/albums-dark-claude-linux.png +0 -0
  61. package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-chatgpt-linux.png +0 -0
  62. package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-claude-darwin.png +0 -0
  63. package/template/tests/e2e/visual.spec.ts-snapshots/albums-fullscreen-claude-linux.png +0 -0
  64. package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-chatgpt-linux.png +0 -0
  65. package/template/tests/e2e/visual.spec.ts-snapshots/albums-light-claude-linux.png +0 -0
  66. package/dist/inspector-DQyl36w3.js.map +0 -1
  67. package/dist/inspector-WPF8mKwk.cjs.map +0 -1
@@ -4571,7 +4571,7 @@ registerHostShell({
4571
4571
  }`
4572
4572
  });
4573
4573
  //#endregion
4574
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.7.3_@modelcontextprotocol+sdk@1.29.0_zod@4.4.3__react-_eeb2b05587eabe4742497eb1f1b87bd3/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js
4574
+ //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.7.4_@modelcontextprotocol+sdk@1.29.0_zod@4.4.3__react-_bc4d5adeaec14d46b9a46bfff8177b13/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js
4575
4575
  ((X) => typeof __require < "u" ? __require : typeof Proxy < "u" ? new Proxy(X, { get: (Y, Z) => (typeof __require < "u" ? __require : Y)[Z] }) : X)(function(X) {
4576
4576
  if (typeof __require < "u") return __require.apply(this, arguments);
4577
4577
  throw Error("Dynamic require of \"" + X + "\" is not supported");
@@ -5692,6 +5692,15 @@ iframe { border: none; width: 100%; height: 100%; display: block; }
5692
5692
  var innerFrame = null;
5693
5693
  var innerWindow = null;
5694
5694
  var platformScript = ${escapedPlatformScript};
5695
+ var DEFAULT_INNER_SANDBOX =
5696
+ 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox';
5697
+ var ALLOWED_INNER_SANDBOX_TOKENS = {
5698
+ 'allow-scripts': true,
5699
+ 'allow-same-origin': true,
5700
+ 'allow-forms': true,
5701
+ 'allow-popups': true,
5702
+ 'allow-popups-to-escape-sandbox': true
5703
+ };
5695
5704
 
5696
5705
  // Relay messages between parent (host) and inner iframe (app)
5697
5706
  window.addEventListener('message', function(event) {
@@ -5770,8 +5779,7 @@ iframe { border: none; width: 100%; height: 100%; display: block; }
5770
5779
  if (innerFrame) innerFrame.remove();
5771
5780
 
5772
5781
  innerFrame = document.createElement('iframe');
5773
- innerFrame.sandbox = params.sandbox ||
5774
- 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox';
5782
+ innerFrame.sandbox = sanitizeInnerSandbox(params.sandbox);
5775
5783
  if (params.allow) innerFrame.allow = params.allow;
5776
5784
  document.body.appendChild(innerFrame);
5777
5785
  innerWindow = innerFrame.contentWindow;
@@ -5786,14 +5794,15 @@ iframe { border: none; width: 100%; height: 100%; display: block; }
5786
5794
  }
5787
5795
 
5788
5796
  function createInnerFrameWithSrc(params) {
5797
+ var safeSrc = normalizeInnerSrc(params && params.src);
5798
+ if (!safeSrc) return;
5789
5799
  clearInterval(readyInterval);
5790
5800
  if (innerFrame) innerFrame.remove();
5791
5801
 
5792
5802
  innerFrame = document.createElement('iframe');
5793
- innerFrame.sandbox =
5794
- 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox';
5803
+ innerFrame.sandbox = DEFAULT_INNER_SANDBOX;
5795
5804
  if (params.allow) innerFrame.allow = params.allow;
5796
- innerFrame.src = params.src;
5805
+ innerFrame.src = safeSrc;
5797
5806
  innerFrame.style.height = '100%';
5798
5807
 
5799
5808
  // Set color-scheme on the inner iframe to match the host theme.
@@ -5855,6 +5864,26 @@ iframe { border: none; width: 100%; height: 100%; display: block; }
5855
5864
  innerWindow = innerFrame.contentWindow;
5856
5865
  }
5857
5866
 
5867
+ function sanitizeInnerSandbox(value) {
5868
+ if (typeof value !== 'string' || !value.trim()) return DEFAULT_INNER_SANDBOX;
5869
+ var tokens = value.trim().split(/\\s+/);
5870
+ for (var i = 0; i < tokens.length; i++) {
5871
+ if (!ALLOWED_INNER_SANDBOX_TOKENS[tokens[i]]) return DEFAULT_INNER_SANDBOX;
5872
+ }
5873
+ return tokens.join(' ');
5874
+ }
5875
+
5876
+ function normalizeInnerSrc(value) {
5877
+ if (typeof value !== 'string') return null;
5878
+ try {
5879
+ var url = new URL(value, window.location.href);
5880
+ if (url.protocol !== 'http:' && url.protocol !== 'https:') return null;
5881
+ return url.toString();
5882
+ } catch(e) {
5883
+ return null;
5884
+ }
5885
+ }
5886
+
5858
5887
  // Paint fence responder — same as in iframe-resource.ts
5859
5888
  var PAINT_FENCE_SCRIPT = 'window.addEventListener("message",function(e){' +
5860
5889
  'if(e.data&&e.data.method==="sunpeak/fence"){' +
@@ -9613,4 +9642,4 @@ function Inspector({ children, app, simulations: initialSimulationsProp = EMPTY_
9613
9642
  //#endregion
9614
9643
  export { McpAppHost as C, registerHostShell as D, getRegisteredHosts as E, cn as O, extractResourceCSP as S, getHostShell as T, DEVICE_PRESETS as _, SidebarCollapsibleControl as a, isDevicePresetSelection as b, SidebarSelect as c, SimpleSidebar as d, ThemeProvider as f, CUSTOM_DEVICE_PRESET as g, useInspectorState as h, SidebarCheckbox as i, DEFAULT_STYLE_VARIABLES as k, SidebarTextarea as l, useMcpConnection as m, flattenAppToSimulations as n, SidebarControl as o, useThemeContext as p, resolveServerToolResult as r, SidebarInput as s, Inspector as t, SidebarToggle as u, DEVICE_PRESET_BY_ID as v, SCREEN_WIDTHS as w, IframeResource as x, getDevicePreset as y };
9615
9644
 
9616
- //# sourceMappingURL=inspector-DQyl36w3.js.map
9645
+ //# sourceMappingURL=inspector-BYuRWH6c.js.map