sunpeak 0.18.7 → 0.18.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 (76) hide show
  1. package/README.md +12 -0
  2. package/bin/commands/dev.mjs +3 -3
  3. package/bin/commands/inspect.mjs +4 -1
  4. package/bin/lib/sandbox-server.mjs +31 -1
  5. package/dist/chatgpt/index.cjs +1 -2
  6. package/dist/chatgpt/index.js +1 -2
  7. package/dist/claude/index.cjs +1 -2
  8. package/dist/claude/index.js +1 -2
  9. package/dist/host/chatgpt/index.cjs +1 -2
  10. package/dist/host/chatgpt/index.cjs.map +1 -1
  11. package/dist/host/chatgpt/index.js +1 -2
  12. package/dist/host/chatgpt/index.js.map +1 -1
  13. package/dist/index.cjs +93 -93
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.js +54 -54
  16. package/dist/index.js.map +1 -1
  17. package/dist/inspector/hosts.d.ts +12 -0
  18. package/dist/inspector/index.cjs +1 -2
  19. package/dist/inspector/index.js +1 -2
  20. package/dist/{inspector-CKc58UuI.cjs → inspector-8nPV2A-z.cjs} +104 -54
  21. package/dist/inspector-8nPV2A-z.cjs.map +1 -0
  22. package/dist/{inspector-DZrN0kej.js → inspector-Cdo5BK2D.js} +103 -53
  23. package/dist/inspector-Cdo5BK2D.js.map +1 -0
  24. package/dist/mcp/index.cjs +85 -71
  25. package/dist/mcp/index.cjs.map +1 -1
  26. package/dist/mcp/index.js +79 -65
  27. package/dist/mcp/index.js.map +1 -1
  28. package/dist/{protocol-DJmRaBzO.js → protocol-BfAACnv0.js} +14 -9
  29. package/dist/{protocol-DJmRaBzO.js.map → protocol-BfAACnv0.js.map} +1 -1
  30. package/dist/{protocol-jbxhzcnS.cjs → protocol-C7kTcBr_.cjs} +14 -9
  31. package/dist/{protocol-jbxhzcnS.cjs.map → protocol-C7kTcBr_.cjs.map} +1 -1
  32. package/dist/style.css +36 -1
  33. package/dist/{use-app-BNbz1uzj.js → use-app-CfP9VypY.js} +107 -56
  34. package/dist/use-app-CfP9VypY.js.map +1 -0
  35. package/dist/{use-app-Dqh20JPP.cjs → use-app-CzcYw1Kz.cjs} +165 -114
  36. package/dist/use-app-CzcYw1Kz.cjs.map +1 -0
  37. package/package.json +7 -7
  38. package/template/README.md +12 -0
  39. package/template/dist/albums/albums.html +16 -15
  40. package/template/dist/albums/albums.json +1 -1
  41. package/template/dist/carousel/carousel.html +20 -19
  42. package/template/dist/carousel/carousel.json +1 -1
  43. package/template/dist/map/map.html +7 -6
  44. package/template/dist/map/map.json +1 -1
  45. package/template/dist/review/review.html +6 -5
  46. package/template/dist/review/review.json +1 -1
  47. package/template/node_modules/.bin/vite +2 -2
  48. package/template/node_modules/.bin/vitest +2 -2
  49. package/template/node_modules/.vite/deps/_metadata.json +4 -4
  50. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +49 -49
  51. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
  52. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +49 -49
  53. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
  54. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +89 -89
  55. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
  56. package/template/node_modules/.vite-mcp/deps/@testing-library_react.js +9 -6
  57. package/template/node_modules/.vite-mcp/deps/@testing-library_react.js.map +1 -1
  58. package/template/node_modules/.vite-mcp/deps/_metadata.json +26 -26
  59. package/template/node_modules/.vite-mcp/deps/{protocol-CTflwIfG.js → protocol-B_qKkui_.js} +14 -9
  60. package/template/node_modules/.vite-mcp/deps/protocol-B_qKkui_.js.map +1 -0
  61. package/template/node_modules/.vite-mcp/deps/vitest.js +366 -128
  62. package/template/node_modules/.vite-mcp/deps/vitest.js.map +1 -1
  63. package/template/package.json +2 -2
  64. package/template/src/resources/carousel/carousel.test.tsx +16 -2
  65. package/template/src/resources/carousel/carousel.tsx +42 -14
  66. package/template/src/resources/carousel/components/carousel.tsx +20 -0
  67. package/template/src/resources/carousel/components/index.ts +1 -0
  68. package/template/src/resources/carousel/components/place-detail.tsx +153 -0
  69. package/template/tests/e2e/carousel.spec.ts +125 -0
  70. package/template/tests/live/carousel.spec.ts +2 -2
  71. package/template/tests/simulations/show-carousel.json +54 -5
  72. package/dist/inspector-CKc58UuI.cjs.map +0 -1
  73. package/dist/inspector-DZrN0kej.js.map +0 -1
  74. package/dist/use-app-BNbz1uzj.js.map +0 -1
  75. package/dist/use-app-Dqh20JPP.cjs.map +0 -1
  76. package/template/node_modules/.vite-mcp/deps/protocol-CTflwIfG.js.map +0 -1
package/dist/style.css CHANGED
@@ -100,6 +100,7 @@
100
100
  --tracking-wide: .025em;
101
101
  --leading-tight: 1.25;
102
102
  --leading-normal: 1.5;
103
+ --leading-relaxed: 1.625;
103
104
  --radius-md: .375rem;
104
105
  --radius-lg: .5rem;
105
106
  --radius-xl: .75rem;
@@ -662,6 +663,10 @@
662
663
  margin-bottom: calc(var(--spacing) * 3);
663
664
  }
664
665
 
666
+ .ml-1 {
667
+ margin-left: calc(var(--spacing) * 1);
668
+ }
669
+
665
670
  .line-clamp-2 {
666
671
  -webkit-line-clamp: 2;
667
672
  -webkit-box-orient: vertical;
@@ -926,7 +931,7 @@
926
931
  flex: none;
927
932
  }
928
933
 
929
- .flex-shrink-0 {
934
+ .flex-shrink-0, .shrink-0 {
930
935
  flex-shrink: 0;
931
936
  }
932
937
 
@@ -972,6 +977,10 @@
972
977
  appearance: none;
973
978
  }
974
979
 
980
+ .grid-cols-1 {
981
+ grid-template-columns: repeat(1, minmax(0, 1fr));
982
+ }
983
+
975
984
  .grid-cols-2 {
976
985
  grid-template-columns: repeat(2, minmax(0, 1fr));
977
986
  }
@@ -1206,6 +1215,11 @@
1206
1215
  border-bottom-width: 1px;
1207
1216
  }
1208
1217
 
1218
+ .border-l-2 {
1219
+ border-left-style: var(--tw-border-style);
1220
+ border-left-width: 2px;
1221
+ }
1222
+
1209
1223
  .border-\[var\(--color-border-danger\)\] {
1210
1224
  border-color: var(--color-border-danger);
1211
1225
  }
@@ -1442,6 +1456,10 @@
1442
1456
  padding-inline: calc(var(--spacing) * 2);
1443
1457
  }
1444
1458
 
1459
+ .px-2\.5 {
1460
+ padding-inline: calc(var(--spacing) * 2.5);
1461
+ }
1462
+
1445
1463
  .px-3 {
1446
1464
  padding-inline: calc(var(--spacing) * 3);
1447
1465
  }
@@ -1502,6 +1520,10 @@
1502
1520
  padding-right: calc(var(--spacing) * 12);
1503
1521
  }
1504
1522
 
1523
+ .pb-2 {
1524
+ padding-bottom: calc(var(--spacing) * 2);
1525
+ }
1526
+
1505
1527
  .pb-3 {
1506
1528
  padding-bottom: calc(var(--spacing) * 3);
1507
1529
  }
@@ -1514,6 +1536,10 @@
1514
1536
  padding-bottom: calc(var(--spacing) * 10);
1515
1537
  }
1516
1538
 
1539
+ .pl-4 {
1540
+ padding-left: calc(var(--spacing) * 4);
1541
+ }
1542
+
1517
1543
  .text-center {
1518
1544
  text-align: center;
1519
1545
  }
@@ -1591,6 +1617,11 @@
1591
1617
  line-height: var(--leading-normal);
1592
1618
  }
1593
1619
 
1620
+ .leading-relaxed {
1621
+ --tw-leading: var(--leading-relaxed);
1622
+ line-height: var(--leading-relaxed);
1623
+ }
1624
+
1594
1625
  .leading-tight {
1595
1626
  --tw-leading: var(--leading-tight);
1596
1627
  line-height: var(--leading-tight);
@@ -1641,6 +1672,10 @@
1641
1672
  white-space: pre-wrap;
1642
1673
  }
1643
1674
 
1675
+ .text-\[var\(--color-border-tertiary\)\] {
1676
+ color: var(--color-border-tertiary);
1677
+ }
1678
+
1644
1679
  .text-\[var\(--color-text-danger\)\] {
1645
1680
  color: var(--color-text-danger);
1646
1681
  }
@@ -1,8 +1,8 @@
1
- import { $ as literal, D as ListResourcesResultSchema, I as ReadResourceResultSchema, L as RequestIdSchema, N as PingRequestSchema, Q as boolean, R as ResourceLinkSchema, U as ToolSchema, X as _undefined, Z as array, _ as ImplementationSchema, a as CallToolResultSchema, at as unknown, b as JSONRPCMessageSchema, et as number, i as CallToolRequestSchema, it as union, k as ListToolsRequestSchema, m as EmptyResultSchema, nt as record, p as EmbeddedResourceSchema, rt as string, s as ContentBlockSchema, t as Protocol, tt as object } from "./protocol-DJmRaBzO.js";
1
+ import { $ as literal, D as ListResourcesResultSchema, I as ReadResourceResultSchema, L as RequestIdSchema, N as PingRequestSchema, Q as boolean, R as ResourceLinkSchema, U as ToolSchema, X as _undefined, Z as array, _ as ImplementationSchema, a as CallToolResultSchema, at as unknown, b as JSONRPCMessageSchema, et as number, i as CallToolRequestSchema, it as union, k as ListToolsRequestSchema, m as EmptyResultSchema, nt as record, p as EmbeddedResourceSchema, rt as string, s as ContentBlockSchema, t as Protocol, tt as object } from "./protocol-BfAACnv0.js";
2
2
  import { createContext, useContext, useEffect, useState } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
- //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.3.1_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__react-_cd1fb28fd87e0bddd0a29eba0721855d/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js
5
- var W = "2026-01-26", d = "ui/open-link", h = "ui/download-file", m = "ui/message", r = "ui/notifications/size-changed", p = "ui/notifications/tool-input", z = "ui/notifications/tool-input-partial", c = "ui/notifications/tool-result", n = "ui/notifications/tool-cancelled", a = "ui/notifications/host-context-changed", o = "ui/notifications/request-teardown", s = "ui/resource-teardown", t = "ui/initialize", e = "ui/notifications/initialized", QQ = "ui/request-display-mode";
4
+ //#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.3.2_@modelcontextprotocol+sdk@1.29.0_zod@4.3.6__react-_38e5f6c50a4ca9cf3f1dffc73a60c951/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js
5
+ var E = "2026-01-26", y = "ui/open-link", u = "ui/download-file", f = "ui/message", m = "ui/notifications/size-changed", i = "ui/notifications/tool-input", z = "ui/notifications/tool-input-partial", l = "ui/notifications/tool-result", r = "ui/notifications/tool-cancelled", c = "ui/notifications/host-context-changed", p = "ui/notifications/request-teardown", n = "ui/resource-teardown", a = "ui/initialize", o = "ui/notifications/initialized", s = "ui/request-display-mode";
6
6
  var K = class {
7
7
  eventTarget;
8
8
  eventSource;
@@ -36,11 +36,11 @@ var K = class {
36
36
  onmessage;
37
37
  sessionId;
38
38
  setProtocolVersion;
39
- }, b = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), J = union([
39
+ }, v = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), D = union([
40
40
  literal("inline"),
41
41
  literal("fullscreen"),
42
42
  literal("pip")
43
- ]).describe("Display mode for UI presentation."), GQ = record(union([
43
+ ]).describe("Display mode for UI presentation."), DQ = record(union([
44
44
  literal("--color-background-primary"),
45
45
  literal("--color-background-secondary"),
46
46
  literal("--color-background-tertiary"),
@@ -135,7 +135,7 @@ Individual style keys are optional - hosts may provide any subset of these value
135
135
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
136
136
 
137
137
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
138
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), VQ = object({
138
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), JQ = object({
139
139
  method: literal("ui/open-link"),
140
140
  params: object({ url: string().describe("URL to open in the host's browser") })
141
141
  }), B = object({ isError: boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough(), _ = object({ isError: boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).") }).passthrough(), O = object({ isError: boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough();
@@ -156,7 +156,7 @@ var G = object({
156
156
  microphone: object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),
157
157
  geolocation: object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),
158
158
  clipboardWrite: object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")
159
- }), jQ = object({
159
+ }), GQ = object({
160
160
  method: literal("ui/notifications/size-changed"),
161
161
  params: object({
162
162
  width: number().optional().describe("New width in pixels."),
@@ -171,13 +171,13 @@ var G = object({
171
171
  }), A = object({
172
172
  method: literal("ui/notifications/tool-cancelled"),
173
173
  params: object({ reason: string().optional().describe("Optional reason for the cancellation (e.g., \"user action\", \"timeout\").") })
174
- }), k = object({ fonts: string().optional() }), C = object({
175
- variables: GQ.optional().describe("CSS variables for theming the app."),
176
- css: k.optional().describe("CSS blocks that apps can inject.")
174
+ }), b = object({ fonts: string().optional() }), k = object({
175
+ variables: DQ.optional().describe("CSS variables for theming the app."),
176
+ css: b.optional().describe("CSS blocks that apps can inject.")
177
177
  }), F = object({
178
178
  method: literal("ui/resource-teardown"),
179
179
  params: object({})
180
- }), EQ = record(string(), unknown()), L = object({
180
+ }), VQ = record(string(), unknown()), L = object({
181
181
  text: object({}).optional().describe("Host supports text content blocks."),
182
182
  image: object({}).optional().describe("Host supports image content blocks."),
183
183
  audio: object({}).optional().describe("Host supports audio content blocks."),
@@ -187,7 +187,7 @@ var G = object({
187
187
  }), WQ = object({
188
188
  method: literal("ui/notifications/request-teardown"),
189
189
  params: object({}).optional()
190
- }), x = object({
190
+ }), C = object({
191
191
  experimental: object({}).optional().describe("Experimental features (structure TBD)."),
192
192
  openLinks: object({}).optional().describe("Host supports opening external URLs."),
193
193
  downloadFile: object({}).optional().describe("Host supports file downloads via ui/download-file."),
@@ -200,14 +200,14 @@ var G = object({
200
200
  }).optional().describe("Sandbox configuration applied by the host."),
201
201
  updateModelContext: L.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),
202
202
  message: L.optional().describe("Host supports receiving content messages (ui/message) from the view.")
203
- }), g = object({
203
+ }), x = object({
204
204
  experimental: object({}).optional().describe("Experimental features (structure TBD)."),
205
205
  tools: object({ listChanged: boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."),
206
- availableDisplayModes: array(J).optional().describe("Display modes the app supports.")
207
- }), zQ = object({
206
+ availableDisplayModes: array(D).optional().describe("Display modes the app supports.")
207
+ }), NQ = object({
208
208
  method: literal("ui/notifications/initialized"),
209
209
  params: object({}).optional()
210
- }), LQ = object({
210
+ }), jQ = object({
211
211
  csp: G.optional().describe("Content Security Policy configuration for UI resources."),
212
212
  permissions: V.optional().describe("Sandbox permissions requested by the UI resource."),
213
213
  domain: string().optional().describe(`Dedicated origin for view sandbox.
@@ -226,20 +226,20 @@ Boolean requesting whether a visible border and background is provided by the ho
226
226
  - \`true\`: request visible border + background
227
227
  - \`false\`: request no visible border + background
228
228
  - omitted: host decides border`)
229
- }), BQ = object({
229
+ }), EQ = object({
230
230
  method: literal("ui/request-display-mode"),
231
- params: object({ mode: J.describe("The display mode being requested.") })
232
- }), P = object({ mode: J.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), S = union([literal("model"), literal("app")]).describe("Tool visibility scope - who can access the tool."), _Q = object({
231
+ params: object({ mode: D.describe("The display mode being requested.") })
232
+ }), P = object({ mode: D.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), g = union([literal("model"), literal("app")]).describe("Tool visibility scope - who can access the tool."), zQ = object({
233
233
  resourceUri: string().optional(),
234
- visibility: array(S).optional().describe(`Who can access this tool. Default: ["model", "app"]
234
+ visibility: array(g).optional().describe(`Who can access this tool. Default: ["model", "app"]
235
235
  - "model": Tool visible to and callable by the agent
236
236
  - "app": Tool callable by the app from this server only`)
237
237
  });
238
238
  object({ mimeTypes: array(string()).optional().describe("Array of supported MIME types for UI resources.\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.") });
239
- var OQ = object({
239
+ var LQ = object({
240
240
  method: literal("ui/download-file"),
241
241
  params: object({ contents: array(union([EmbeddedResourceSchema, ResourceLinkSchema])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.") })
242
- }), IQ = object({
242
+ }), BQ = object({
243
243
  method: literal("ui/message"),
244
244
  params: object({
245
245
  role: literal("user").describe("Message role, currently only \"user\" is supported."),
@@ -263,10 +263,10 @@ var q = object({
263
263
  id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."),
264
264
  tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.")
265
265
  }).optional().describe("Metadata of the tool call that instantiated this App."),
266
- theme: b.optional().describe("Current color theme preference."),
267
- styles: C.optional().describe("Style configuration for theming the app."),
268
- displayMode: J.optional().describe("How the UI is currently displayed."),
269
- availableDisplayModes: array(J).optional().describe("Display modes the host supports."),
266
+ theme: v.optional().describe("Current color theme preference."),
267
+ styles: k.optional().describe("Style configuration for theming the app."),
268
+ displayMode: D.optional().describe("How the UI is currently displayed."),
269
+ availableDisplayModes: array(D).optional().describe("Display modes the host supports."),
270
270
  containerDimensions: union([object({ height: number().describe("Fixed container height in pixels.") }), object({ maxHeight: union([number(), _undefined()]).optional().describe("Maximum container height in pixels.") })]).and(union([object({ width: number().describe("Fixed container width in pixels.") }), object({ maxWidth: union([number(), _undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
271
271
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),
272
272
  locale: string().optional().describe("User's language and region preference in BCP 47 format."),
@@ -290,44 +290,44 @@ container holding the app. Specify either width or maxWidth, and either height o
290
290
  }).passthrough(), R = object({
291
291
  method: literal("ui/notifications/host-context-changed"),
292
292
  params: T.describe("Partial context update containing only changed fields.")
293
- }), AQ = object({
293
+ }), OQ = object({
294
294
  method: literal("ui/update-model-context"),
295
295
  params: object({
296
296
  content: array(ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."),
297
297
  structuredContent: record(string(), unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")
298
298
  })
299
- }), FQ = object({
299
+ }), IQ = object({
300
300
  method: literal("ui/initialize"),
301
301
  params: object({
302
302
  appInfo: ImplementationSchema.describe("App identification (name and version)."),
303
- appCapabilities: g.describe("Features and capabilities this app provides."),
303
+ appCapabilities: x.describe("Features and capabilities this app provides."),
304
304
  protocolVersion: string().describe("Protocol version this app supports.")
305
305
  })
306
306
  }), U = object({
307
307
  protocolVersion: string().describe("Negotiated protocol version string (e.g., \"2025-11-21\")."),
308
308
  hostInfo: ImplementationSchema.describe("Host application identification and version."),
309
- hostCapabilities: x.describe("Features and capabilities provided by the host."),
309
+ hostCapabilities: C.describe("Features and capabilities provided by the host."),
310
310
  hostContext: T.describe("Rich context about the host environment.")
311
311
  }).passthrough();
312
- function PQ() {
312
+ function wQ() {
313
313
  let X = document.documentElement.getAttribute("data-theme");
314
314
  if (X === "dark" || X === "light") return X;
315
315
  return document.documentElement.classList.contains("dark") ? "dark" : "light";
316
316
  }
317
- function qQ(X) {
317
+ function AQ(X) {
318
318
  let Y = document.documentElement;
319
319
  Y.setAttribute("data-theme", X), Y.style.colorScheme = X;
320
320
  }
321
- function TQ(X, Y = document.documentElement) {
321
+ function FQ(X, Y = document.documentElement) {
322
322
  for (let [Z, $] of Object.entries(X)) if ($ !== void 0) Y.style.setProperty(Z, $);
323
323
  }
324
- function RQ(X) {
324
+ function PQ(X) {
325
325
  if (document.getElementById("__mcp-host-fonts")) return;
326
326
  let Z = document.createElement("style");
327
327
  Z.id = "__mcp-host-fonts", Z.textContent = X, document.head.appendChild(Z);
328
328
  }
329
- var MX = "ui/resourceUri", vX = "text/html;profile=mcp-app";
330
- var gQ = class extends Protocol {
329
+ var RX = "ui/resourceUri", UX = "text/html;profile=mcp-app";
330
+ var kQ = class extends Protocol {
331
331
  _appInfo;
332
332
  _capabilities;
333
333
  options;
@@ -473,20 +473,20 @@ var gQ = class extends Protocol {
473
473
  if (X) return;
474
474
  X = !0, requestAnimationFrame(() => {
475
475
  X = !1;
476
- let D = document.documentElement, y = D.style.width, u = D.style.height;
477
- D.style.width = "fit-content", D.style.height = "max-content";
478
- let H = D.getBoundingClientRect();
479
- D.style.width = y, D.style.height = u;
480
- let f = window.innerWidth - D.clientWidth, j = Math.ceil(H.width + f), E = Math.ceil(H.height);
481
- if (j !== Y || E !== Z) Y = j, Z = E, this.sendSizeChanged({
476
+ let J = document.documentElement, S = J.style.height;
477
+ J.style.height = "max-content";
478
+ let N = Math.ceil(J.getBoundingClientRect().height);
479
+ J.style.height = S;
480
+ let j = Math.ceil(window.innerWidth);
481
+ if (j !== Y || N !== Z) Y = j, Z = N, this.sendSizeChanged({
482
482
  width: j,
483
- height: E
483
+ height: N
484
484
  });
485
485
  });
486
486
  };
487
487
  $();
488
- let N = new ResizeObserver($);
489
- return N.observe(document.documentElement), N.observe(document.body), () => N.disconnect();
488
+ let W = new ResizeObserver($);
489
+ return W.observe(document.documentElement), W.observe(document.body), () => W.disconnect();
490
490
  }
491
491
  async connect(X = new K(window.parent, window.parent), Y) {
492
492
  if (this.transport) throw Error("App is already connected. Call close() before connecting again.");
@@ -497,7 +497,7 @@ var gQ = class extends Protocol {
497
497
  params: {
498
498
  appCapabilities: this._capabilities,
499
499
  appInfo: this._appInfo,
500
- protocolVersion: W
500
+ protocolVersion: E
501
501
  }
502
502
  }, U, Y);
503
503
  if (Z === void 0) throw Error(`Server sent invalid initialize result: ${Z}`);
@@ -518,6 +518,11 @@ var gQ = class extends Protocol {
518
518
  *
519
519
  * The provider preserves the App instance across React Fast Refresh (HMR)
520
520
  * by storing it at module scope, matching the previous useApp() behavior.
521
+ *
522
+ * Connection resilience: if the initial PostMessage handshake doesn't complete
523
+ * within a timeout, the provider automatically retries with exponential backoff.
524
+ * This handles race conditions where the host iframe bridge isn't ready when the
525
+ * app first mounts (common on first load in ChatGPT and Claude).
521
526
  */
522
527
  var defaultState = {
523
528
  app: null,
@@ -527,6 +532,58 @@ var defaultState = {
527
532
  var AppContext = createContext(defaultState);
528
533
  var _app = null;
529
534
  var _connecting = null;
535
+ /** Timeout for a single connection attempt (ms). */
536
+ var CONNECT_TIMEOUT_MS = 5e3;
537
+ /** Maximum number of retry attempts before giving up. */
538
+ var MAX_RETRIES = 3;
539
+ /** Base delay for exponential backoff between retries (ms). */
540
+ var RETRY_BASE_DELAY_MS = 500;
541
+ /**
542
+ * Race a promise against a timeout. Rejects with a TimeoutError if the
543
+ * promise doesn't settle within `ms` milliseconds.
544
+ */
545
+ function withTimeout(promise, ms) {
546
+ return new Promise((resolve, reject) => {
547
+ const timer = setTimeout(() => reject(/* @__PURE__ */ new Error("Connection timed out")), ms);
548
+ promise.then((v) => {
549
+ clearTimeout(timer);
550
+ resolve(v);
551
+ }, (e) => {
552
+ clearTimeout(timer);
553
+ reject(e);
554
+ });
555
+ });
556
+ }
557
+ /**
558
+ * Attempt to connect to the host with timeout and retries.
559
+ * Each attempt creates a fresh transport + App instance so stale PostMessage
560
+ * listeners from a previous failed attempt don't interfere.
561
+ */
562
+ async function connectWithRetry(appInfo, capabilities, onAppCreated) {
563
+ let lastError = null;
564
+ for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
565
+ if (attempt > 0) {
566
+ const delay = RETRY_BASE_DELAY_MS * 2 ** (attempt - 1);
567
+ await new Promise((r) => setTimeout(r, delay));
568
+ }
569
+ let transport = null;
570
+ try {
571
+ transport = new K(window.parent, window.parent);
572
+ const newApp = new kQ(appInfo, capabilities);
573
+ onAppCreated?.(newApp);
574
+ await withTimeout(newApp.connect(transport), CONNECT_TIMEOUT_MS);
575
+ return newApp;
576
+ } catch (err) {
577
+ if (transport) try {
578
+ await transport.close();
579
+ } catch {}
580
+ lastError = err instanceof Error ? err : /* @__PURE__ */ new Error("Connection failed");
581
+ if (attempt < MAX_RETRIES) console.warn(`[sunpeak] Connection attempt ${attempt + 1}/${MAX_RETRIES + 1} failed, retrying...`, lastError.message);
582
+ }
583
+ }
584
+ console.error("[sunpeak] All connection attempts failed. Try refreshing the page or opening a new chat.\nTroubleshooting: https://sunpeak.ai/docs/guides/troubleshooting");
585
+ throw lastError ?? /* @__PURE__ */ new Error("Failed to connect");
586
+ }
530
587
  function AppProvider({ appInfo, capabilities, onAppCreated, children }) {
531
588
  const [state, setState] = useState(() => _app ? {
532
589
  app: _app,
@@ -545,15 +602,9 @@ function AppProvider({ appInfo, capabilities, onAppCreated, children }) {
545
602
  cancelled = true;
546
603
  };
547
604
  }
548
- if (!_connecting) _connecting = (async () => {
549
- const transport = new K(window.parent, window.parent);
550
- const newApp = new gQ(appInfo, capabilities ?? {});
551
- onAppCreated?.(newApp);
552
- await newApp.connect(transport);
553
- _app = newApp;
554
- return newApp;
555
- })();
605
+ if (!_connecting) _connecting = connectWithRetry(appInfo, capabilities ?? {}, onAppCreated);
556
606
  _connecting.then((connectedApp) => {
607
+ _app = connectedApp;
557
608
  if (!cancelled) setState({
558
609
  app: connectedApp,
559
610
  isConnected: true,
@@ -602,6 +653,6 @@ function useApp() {
602
653
  return useContext(AppContext).app;
603
654
  }
604
655
  //#endregion
605
- export { s as $, V as A, e as B, QQ as C, T as D, S as E, _Q as F, k as G, gQ as H, a as I, o as J, m as K, b as L, W as M, WQ as N, TQ as O, _ as P, r as Q, c as R, PQ as S, RQ as T, h as U, g as V, jQ as W, q as X, p as Y, qQ as Z, LQ as _, B as a, zQ as at, OQ as b, EQ as c, G as d, t as et, I as f, L as g, K as h, AQ as i, z as it, VQ as j, U as k, F as l, J as m, AppProvider as n, w as nt, BQ as o, IQ as p, n as q, A as r, x as rt, C as s, useApp as t, vX as tt, FQ as u, MX as v, R as w, P as x, O as y, d as z };
656
+ export { v as $, UX as A, i as B, OQ as C, RX as D, R as E, a as F, m as G, k as H, b as I, p as J, n as K, c as L, VQ as M, WQ as N, T as O, _ as P, u as Q, f as R, O as S, PQ as T, kQ as U, jQ as V, l as W, r as X, q as Y, s as Z, JQ as _, B as a, zQ as at, LQ as b, D as c, F as d, w as et, FQ as f, IQ as g, I as h, AQ as i, z as it, V as j, U as k, E as l, GQ as m, AppProvider as n, x as nt, BQ as o, G as p, o as q, A as r, y as rt, C as s, useApp as t, wQ as tt, EQ as u, K as v, P as w, NQ as x, L as y, g as z };
606
657
 
607
- //# sourceMappingURL=use-app-BNbz1uzj.js.map
658
+ //# sourceMappingURL=use-app-CfP9VypY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-app-CfP9VypY.js","names":["t","Q.union","Q.literal","Q.record","Q.string","Q.undefined","Q.object","Q.boolean","Q.array","Q.number","Q.unknown","QQ","YQ","H","e","XQ","ZQ","M","qQ","vQ","TQ","MQ","RQ","bQ","HQ","UQ"],"sources":["../../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.3.2_@modelcontextprotocol+sdk@1.29.0_zod@4.3.6__react-_38e5f6c50a4ca9cf3f1dffc73a60c951/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js","../src/hooks/app-context.tsx","../src/hooks/use-app.ts"],"sourcesContent":["import{Protocol as qQ}from\"@modelcontextprotocol/sdk/shared/protocol.js\";import{CallToolRequestSchema as TQ,CallToolResultSchema as RQ,EmptyResultSchema as UQ,ListResourcesResultSchema as HQ,ListToolsRequestSchema as MQ,PingRequestSchema as vQ,ReadResourceResultSchema as bQ}from\"@modelcontextprotocol/sdk/types.js\";import{JSONRPCMessageSchema as t}from\"@modelcontextprotocol/sdk/types.js\";var E=\"2026-01-26\",y=\"ui/open-link\",u=\"ui/download-file\",f=\"ui/message\",d=\"ui/notifications/sandbox-proxy-ready\",h=\"ui/notifications/sandbox-resource-ready\",m=\"ui/notifications/size-changed\",i=\"ui/notifications/tool-input\",z=\"ui/notifications/tool-input-partial\",l=\"ui/notifications/tool-result\",r=\"ui/notifications/tool-cancelled\",c=\"ui/notifications/host-context-changed\",p=\"ui/notifications/request-teardown\",n=\"ui/resource-teardown\",a=\"ui/initialize\",o=\"ui/notifications/initialized\",s=\"ui/request-display-mode\";class K{eventTarget;eventSource;messageListener;constructor(X=window.parent,Y){this.eventTarget=X;this.eventSource=Y;this.messageListener=(Z)=>{if(Y&&Z.source!==this.eventSource){console.debug(\"Ignoring message from unknown source\",Z);return}let $=t.safeParse(Z.data);if($.success)console.debug(\"Parsed message\",$.data),this.onmessage?.($.data);else if(Z.data?.jsonrpc!==\"2.0\")console.debug(\"Ignoring non-JSON-RPC message\",$.error.message,Z);else console.error(\"Failed to parse message\",$.error.message,Z),this.onerror?.(Error(\"Invalid JSON-RPC message received: \"+$.error.message))}}async start(){window.addEventListener(\"message\",this.messageListener)}async send(X,Y){if(X.method!==z)console.debug(\"Sending message\",X);this.eventTarget.postMessage(X,\"*\")}async close(){window.removeEventListener(\"message\",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}import{z as Q}from\"zod/v4\";import{ContentBlockSchema as H,CallToolResultSchema as e,EmbeddedResourceSchema as QQ,ImplementationSchema as M,RequestIdSchema as XQ,ResourceLinkSchema as YQ,ToolSchema as ZQ}from\"@modelcontextprotocol/sdk/types.js\";var v=Q.union([Q.literal(\"light\"),Q.literal(\"dark\")]).describe(\"Color theme preference for the host environment.\"),D=Q.union([Q.literal(\"inline\"),Q.literal(\"fullscreen\"),Q.literal(\"pip\")]).describe(\"Display mode for UI presentation.\"),$Q=Q.union([Q.literal(\"--color-background-primary\"),Q.literal(\"--color-background-secondary\"),Q.literal(\"--color-background-tertiary\"),Q.literal(\"--color-background-inverse\"),Q.literal(\"--color-background-ghost\"),Q.literal(\"--color-background-info\"),Q.literal(\"--color-background-danger\"),Q.literal(\"--color-background-success\"),Q.literal(\"--color-background-warning\"),Q.literal(\"--color-background-disabled\"),Q.literal(\"--color-text-primary\"),Q.literal(\"--color-text-secondary\"),Q.literal(\"--color-text-tertiary\"),Q.literal(\"--color-text-inverse\"),Q.literal(\"--color-text-ghost\"),Q.literal(\"--color-text-info\"),Q.literal(\"--color-text-danger\"),Q.literal(\"--color-text-success\"),Q.literal(\"--color-text-warning\"),Q.literal(\"--color-text-disabled\"),Q.literal(\"--color-border-primary\"),Q.literal(\"--color-border-secondary\"),Q.literal(\"--color-border-tertiary\"),Q.literal(\"--color-border-inverse\"),Q.literal(\"--color-border-ghost\"),Q.literal(\"--color-border-info\"),Q.literal(\"--color-border-danger\"),Q.literal(\"--color-border-success\"),Q.literal(\"--color-border-warning\"),Q.literal(\"--color-border-disabled\"),Q.literal(\"--color-ring-primary\"),Q.literal(\"--color-ring-secondary\"),Q.literal(\"--color-ring-inverse\"),Q.literal(\"--color-ring-info\"),Q.literal(\"--color-ring-danger\"),Q.literal(\"--color-ring-success\"),Q.literal(\"--color-ring-warning\"),Q.literal(\"--font-sans\"),Q.literal(\"--font-mono\"),Q.literal(\"--font-weight-normal\"),Q.literal(\"--font-weight-medium\"),Q.literal(\"--font-weight-semibold\"),Q.literal(\"--font-weight-bold\"),Q.literal(\"--font-text-xs-size\"),Q.literal(\"--font-text-sm-size\"),Q.literal(\"--font-text-md-size\"),Q.literal(\"--font-text-lg-size\"),Q.literal(\"--font-heading-xs-size\"),Q.literal(\"--font-heading-sm-size\"),Q.literal(\"--font-heading-md-size\"),Q.literal(\"--font-heading-lg-size\"),Q.literal(\"--font-heading-xl-size\"),Q.literal(\"--font-heading-2xl-size\"),Q.literal(\"--font-heading-3xl-size\"),Q.literal(\"--font-text-xs-line-height\"),Q.literal(\"--font-text-sm-line-height\"),Q.literal(\"--font-text-md-line-height\"),Q.literal(\"--font-text-lg-line-height\"),Q.literal(\"--font-heading-xs-line-height\"),Q.literal(\"--font-heading-sm-line-height\"),Q.literal(\"--font-heading-md-line-height\"),Q.literal(\"--font-heading-lg-line-height\"),Q.literal(\"--font-heading-xl-line-height\"),Q.literal(\"--font-heading-2xl-line-height\"),Q.literal(\"--font-heading-3xl-line-height\"),Q.literal(\"--border-radius-xs\"),Q.literal(\"--border-radius-sm\"),Q.literal(\"--border-radius-md\"),Q.literal(\"--border-radius-lg\"),Q.literal(\"--border-radius-xl\"),Q.literal(\"--border-radius-full\"),Q.literal(\"--border-width-regular\"),Q.literal(\"--shadow-hairline\"),Q.literal(\"--shadow-sm\"),Q.literal(\"--shadow-md\"),Q.literal(\"--shadow-lg\")]).describe(\"CSS variable keys available to MCP apps for theming.\"),DQ=Q.record($Q.describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Q.union([Q.string(),Q.undefined()]).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.\n\nIndividual style keys are optional - hosts may provide any subset of these values.\nValues are strings containing CSS values (colors, sizes, font stacks, etc.).\n\nNote: This type uses \\`Record<K, string | undefined>\\` rather than \\`Partial<Record<K, string>>\\`\nfor compatibility with Zod schema generation. Both are functionally equivalent for validation.`),JQ=Q.object({method:Q.literal(\"ui/open-link\"),params:Q.object({url:Q.string().describe(\"URL to open in the host's browser\")})}),B=Q.object({isError:Q.boolean().optional().describe(\"True if the host failed to open the URL (e.g., due to security policy).\")}).passthrough(),_=Q.object({isError:Q.boolean().optional().describe(\"True if the download failed (e.g., user cancelled or host denied).\")}).passthrough(),O=Q.object({isError:Q.boolean().optional().describe(\"True if the host rejected or failed to deliver the message.\")}).passthrough(),KQ=Q.object({method:Q.literal(\"ui/notifications/sandbox-proxy-ready\"),params:Q.object({})}),G=Q.object({connectDomains:Q.array(Q.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:Q.array(Q.string()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:Q.array(Q.string()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:Q.array(Q.string()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),V=Q.object({camera:Q.object({}).optional().describe(\"Request camera access.\\n\\nMaps to Permission Policy `camera` feature.\"),microphone:Q.object({}).optional().describe(\"Request microphone access.\\n\\nMaps to Permission Policy `microphone` feature.\"),geolocation:Q.object({}).optional().describe(\"Request geolocation access.\\n\\nMaps to Permission Policy `geolocation` feature.\"),clipboardWrite:Q.object({}).optional().describe(\"Request clipboard write access.\\n\\nMaps to Permission Policy `clipboard-write` feature.\")}),GQ=Q.object({method:Q.literal(\"ui/notifications/size-changed\"),params:Q.object({width:Q.number().optional().describe(\"New width in pixels.\"),height:Q.number().optional().describe(\"New height in pixels.\")})}),I=Q.object({method:Q.literal(\"ui/notifications/tool-input\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Complete tool call arguments as key-value pairs.\")).optional().describe(\"Complete tool call arguments as key-value pairs.\")})}),w=Q.object({method:Q.literal(\"ui/notifications/tool-input-partial\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Partial tool call arguments (incomplete, may change).\")).optional().describe(\"Partial tool call arguments (incomplete, may change).\")})}),A=Q.object({method:Q.literal(\"ui/notifications/tool-cancelled\"),params:Q.object({reason:Q.string().optional().describe('Optional reason for the cancellation (e.g., \"user action\", \"timeout\").')})}),b=Q.object({fonts:Q.string().optional()}),k=Q.object({variables:DQ.optional().describe(\"CSS variables for theming the app.\"),css:b.optional().describe(\"CSS blocks that apps can inject.\")}),F=Q.object({method:Q.literal(\"ui/resource-teardown\"),params:Q.object({})}),VQ=Q.record(Q.string(),Q.unknown()),L=Q.object({text:Q.object({}).optional().describe(\"Host supports text content blocks.\"),image:Q.object({}).optional().describe(\"Host supports image content blocks.\"),audio:Q.object({}).optional().describe(\"Host supports audio content blocks.\"),resource:Q.object({}).optional().describe(\"Host supports resource content blocks.\"),resourceLink:Q.object({}).optional().describe(\"Host supports resource link content blocks.\"),structuredContent:Q.object({}).optional().describe(\"Host supports structured content.\")}),WQ=Q.object({method:Q.literal(\"ui/notifications/request-teardown\"),params:Q.object({}).optional()}),C=Q.object({experimental:Q.object({}).optional().describe(\"Experimental features (structure TBD).\"),openLinks:Q.object({}).optional().describe(\"Host supports opening external URLs.\"),downloadFile:Q.object({}).optional().describe(\"Host supports file downloads via ui/download-file.\"),serverTools:Q.object({listChanged:Q.boolean().optional().describe(\"Host supports tools/list_changed notifications.\")}).optional().describe(\"Host can proxy tool calls to the MCP server.\"),serverResources:Q.object({listChanged:Q.boolean().optional().describe(\"Host supports resources/list_changed notifications.\")}).optional().describe(\"Host can proxy resource reads to the MCP server.\"),logging:Q.object({}).optional().describe(\"Host accepts log messages.\"),sandbox:Q.object({permissions:V.optional().describe(\"Permissions granted by the host (camera, microphone, geolocation).\"),csp:G.optional().describe(\"CSP domains approved by the host.\")}).optional().describe(\"Sandbox configuration applied by the host.\"),updateModelContext:L.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:L.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\")}),x=Q.object({experimental:Q.object({}).optional().describe(\"Experimental features (structure TBD).\"),tools:Q.object({listChanged:Q.boolean().optional().describe(\"App supports tools/list_changed notifications.\")}).optional().describe(\"App exposes MCP-style tools that the host can call.\"),availableDisplayModes:Q.array(D).optional().describe(\"Display modes the app supports.\")}),NQ=Q.object({method:Q.literal(\"ui/notifications/initialized\"),params:Q.object({}).optional()}),jQ=Q.object({csp:G.optional().describe(\"Content Security Policy configuration for UI resources.\"),permissions:V.optional().describe(\"Sandbox permissions requested by the UI resource.\"),domain:Q.string().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Q.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)}),EQ=Q.object({method:Q.literal(\"ui/request-display-mode\"),params:Q.object({mode:D.describe(\"The display mode being requested.\")})}),P=Q.object({mode:D.describe(\"The display mode that was actually set. May differ from requested if not supported.\")}).passthrough(),g=Q.union([Q.literal(\"model\"),Q.literal(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\"),zQ=Q.object({resourceUri:Q.string().optional(),visibility:Q.array(g).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`)}),hQ=Q.object({mimeTypes:Q.array(Q.string()).optional().describe('Array of supported MIME types for UI resources.\\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.')}),LQ=Q.object({method:Q.literal(\"ui/download-file\"),params:Q.object({contents:Q.array(Q.union([QQ,YQ])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})}),BQ=Q.object({method:Q.literal(\"ui/message\"),params:Q.object({role:Q.literal(\"user\").describe('Message role, currently only \"user\" is supported.'),content:Q.array(H).describe(\"Message content blocks (text, image, etc.).\")})}),_Q=Q.object({method:Q.literal(\"ui/notifications/sandbox-resource-ready\"),params:Q.object({html:Q.string().describe(\"HTML content to load into the inner iframe.\"),sandbox:Q.string().optional().describe(\"Optional override for the inner iframe's sandbox attribute.\"),csp:G.optional().describe(\"CSP configuration from resource metadata.\"),permissions:V.optional().describe(\"Sandbox permissions from resource metadata.\")})}),q=Q.object({method:Q.literal(\"ui/notifications/tool-result\"),params:e.describe(\"Standard MCP tool execution result.\")}),T=Q.object({toolInfo:Q.object({id:XQ.optional().describe(\"JSON-RPC id of the tools/call request.\"),tool:ZQ.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:v.optional().describe(\"Current color theme preference.\"),styles:k.optional().describe(\"Style configuration for theming the app.\"),displayMode:D.optional().describe(\"How the UI is currently displayed.\"),availableDisplayModes:Q.array(D).optional().describe(\"Display modes the host supports.\"),containerDimensions:Q.union([Q.object({height:Q.number().describe(\"Fixed container height in pixels.\")}),Q.object({maxHeight:Q.union([Q.number(),Q.undefined()]).optional().describe(\"Maximum container height in pixels.\")})]).and(Q.union([Q.object({width:Q.number().describe(\"Fixed container width in pixels.\")}),Q.object({maxWidth:Q.union([Q.number(),Q.undefined()]).optional().describe(\"Maximum container width in pixels.\")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Q.string().optional().describe(\"User's language and region preference in BCP 47 format.\"),timeZone:Q.string().optional().describe(\"User's timezone in IANA format.\"),userAgent:Q.string().optional().describe(\"Host application identifier.\"),platform:Q.union([Q.literal(\"web\"),Q.literal(\"desktop\"),Q.literal(\"mobile\")]).optional().describe(\"Platform type for responsive design decisions.\"),deviceCapabilities:Q.object({touch:Q.boolean().optional().describe(\"Whether the device supports touch input.\"),hover:Q.boolean().optional().describe(\"Whether the device supports hover interactions.\")}).optional().describe(\"Device input capabilities.\"),safeAreaInsets:Q.object({top:Q.number().describe(\"Top safe area inset in pixels.\"),right:Q.number().describe(\"Right safe area inset in pixels.\"),bottom:Q.number().describe(\"Bottom safe area inset in pixels.\"),left:Q.number().describe(\"Left safe area inset in pixels.\")}).optional().describe(\"Mobile safe area boundaries in pixels.\")}).passthrough(),R=Q.object({method:Q.literal(\"ui/notifications/host-context-changed\"),params:T.describe(\"Partial context update containing only changed fields.\")}),OQ=Q.object({method:Q.literal(\"ui/update-model-context\"),params:Q.object({content:Q.array(H).optional().describe(\"Context content blocks (text, image, etc.).\"),structuredContent:Q.record(Q.string(),Q.unknown().describe(\"Structured content for machine-readable context data.\")).optional().describe(\"Structured content for machine-readable context data.\")})}),IQ=Q.object({method:Q.literal(\"ui/initialize\"),params:Q.object({appInfo:M.describe(\"App identification (name and version).\"),appCapabilities:x.describe(\"Features and capabilities this app provides.\"),protocolVersion:Q.string().describe(\"Protocol version this app supports.\")})}),U=Q.object({protocolVersion:Q.string().describe('Negotiated protocol version string (e.g., \"2025-11-21\").'),hostInfo:M.describe(\"Host application identification and version.\"),hostCapabilities:C.describe(\"Features and capabilities provided by the host.\"),hostContext:T.describe(\"Rich context about the host environment.\")}).passthrough();function wQ(){let X=document.documentElement.getAttribute(\"data-theme\");if(X===\"dark\"||X===\"light\")return X;return document.documentElement.classList.contains(\"dark\")?\"dark\":\"light\"}function AQ(X){let Y=document.documentElement;Y.setAttribute(\"data-theme\",X),Y.style.colorScheme=X}function FQ(X,Y=document.documentElement){for(let[Z,$]of Object.entries(X))if($!==void 0)Y.style.setProperty(Z,$)}function PQ(X){if(document.getElementById(\"__mcp-host-fonts\"))return;let Z=document.createElement(\"style\");Z.id=\"__mcp-host-fonts\",Z.textContent=X,document.head.appendChild(Z)}var RX=\"ui/resourceUri\",UX=\"text/html;profile=mcp-app\";class kQ extends qQ{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;constructor(X,Y={},Z={autoResize:!0}){super(Z);this._appInfo=X;this._capabilities=Y;this.options=Z;this.setRequestHandler(vQ,($)=>{return console.log(\"Received ping:\",$.params),{}}),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(X){this.setNotificationHandler(I,(Y)=>X(Y.params))}set ontoolinputpartial(X){this.setNotificationHandler(w,(Y)=>X(Y.params))}set ontoolresult(X){this.setNotificationHandler(q,(Y)=>X(Y.params))}set ontoolcancelled(X){this.setNotificationHandler(A,(Y)=>X(Y.params))}set onhostcontextchanged(X){this.setNotificationHandler(R,(Y)=>{this._hostContext={...this._hostContext,...Y.params},X(Y.params)})}set onteardown(X){this.setRequestHandler(F,(Y,Z)=>X(Y.params,Z))}set oncalltool(X){this.setRequestHandler(TQ,(Y,Z)=>X(Y.params,Z))}set onlisttools(X){this.setRequestHandler(MQ,(Y,Z)=>X(Y.params,Z))}assertCapabilityForMethod(X){}assertRequestHandlerCapability(X){switch(X){case\"tools/call\":case\"tools/list\":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${X})`);return;case\"ping\":case\"ui/resource-teardown\":return;default:throw Error(`No handler for method ${X} registered`)}}assertNotificationCapability(X){}assertTaskCapability(X){throw Error(\"Tasks are not supported in MCP Apps\")}assertTaskHandlerCapability(X){throw Error(\"Task handlers are not supported in MCP Apps\")}async callServerTool(X,Y){if(typeof X===\"string\")throw Error(`callServerTool() expects an object as its first argument, but received a string (\"${X}\"). Did you mean: callServerTool({ name: \"${X}\", arguments: { ... } })?`);return await this.request({method:\"tools/call\",params:X},RQ,Y)}async readServerResource(X,Y){return await this.request({method:\"resources/read\",params:X},bQ,Y)}async listServerResources(X,Y){return await this.request({method:\"resources/list\",params:X},HQ,Y)}sendMessage(X,Y){return this.request({method:\"ui/message\",params:X},O,Y)}sendLog(X){return this.notification({method:\"notifications/message\",params:X})}updateModelContext(X,Y){return this.request({method:\"ui/update-model-context\",params:X},UQ,Y)}openLink(X,Y){return this.request({method:\"ui/open-link\",params:X},B,Y)}sendOpenLink=this.openLink;downloadFile(X,Y){return this.request({method:\"ui/download-file\",params:X},_,Y)}requestTeardown(X={}){return this.notification({method:\"ui/notifications/request-teardown\",params:X})}requestDisplayMode(X,Y){return this.request({method:\"ui/request-display-mode\",params:X},P,Y)}sendSizeChanged(X){return this.notification({method:\"ui/notifications/size-changed\",params:X})}setupSizeChangedNotifications(){let X=!1,Y=0,Z=0,$=()=>{if(X)return;X=!0,requestAnimationFrame(()=>{X=!1;let J=document.documentElement,S=J.style.height;J.style.height=\"max-content\";let N=Math.ceil(J.getBoundingClientRect().height);J.style.height=S;let j=Math.ceil(window.innerWidth);if(j!==Y||N!==Z)Y=j,Z=N,this.sendSizeChanged({width:j,height:N})})};$();let W=new ResizeObserver($);return W.observe(document.documentElement),W.observe(document.body),()=>W.disconnect()}async connect(X=new K(window.parent,window.parent),Y){if(this.transport)throw Error(\"App is already connected. Call close() before connecting again.\");await super.connect(X);try{let Z=await this.request({method:\"ui/initialize\",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:E}},U,Y);if(Z===void 0)throw Error(`Server sent invalid initialize result: ${Z}`);if(this._hostCapabilities=Z.hostCapabilities,this._hostInfo=Z.hostInfo,this._hostContext=Z.hostContext,await this.notification({method:\"ui/notifications/initialized\"}),this.options?.autoResize)this.setupSizeChangedNotifications()}catch(Z){throw this.close(),Z}}}export{wQ as getDocumentTheme,FQ as applyHostStyleVariables,PQ as applyHostFonts,AQ as applyDocumentTheme,l as TOOL_RESULT_METHOD,z as TOOL_INPUT_PARTIAL_METHOD,i as TOOL_INPUT_METHOD,r as TOOL_CANCELLED_METHOD,m as SIZE_CHANGED_METHOD,h as SANDBOX_RESOURCE_READY_METHOD,d as SANDBOX_PROXY_READY_METHOD,RX as RESOURCE_URI_META_KEY,n as RESOURCE_TEARDOWN_METHOD,UX as RESOURCE_MIME_TYPE,p as REQUEST_TEARDOWN_METHOD,s as REQUEST_DISPLAY_MODE_METHOD,K as PostMessageTransport,y as OPEN_LINK_METHOD,OQ as McpUiUpdateModelContextRequestSchema,g as McpUiToolVisibilitySchema,q as McpUiToolResultNotificationSchema,zQ as McpUiToolMetaSchema,w as McpUiToolInputPartialNotificationSchema,I as McpUiToolInputNotificationSchema,A as McpUiToolCancelledNotificationSchema,v as McpUiThemeSchema,L as McpUiSupportedContentBlockModalitiesSchema,GQ as McpUiSizeChangedNotificationSchema,_Q as McpUiSandboxResourceReadyNotificationSchema,KQ as McpUiSandboxProxyReadyNotificationSchema,VQ as McpUiResourceTeardownResultSchema,F as McpUiResourceTeardownRequestSchema,V as McpUiResourcePermissionsSchema,jQ as McpUiResourceMetaSchema,G as McpUiResourceCspSchema,WQ as McpUiRequestTeardownNotificationSchema,P as McpUiRequestDisplayModeResultSchema,EQ as McpUiRequestDisplayModeRequestSchema,B as McpUiOpenLinkResultSchema,JQ as McpUiOpenLinkRequestSchema,O as McpUiMessageResultSchema,BQ as McpUiMessageRequestSchema,NQ as McpUiInitializedNotificationSchema,U as McpUiInitializeResultSchema,IQ as McpUiInitializeRequestSchema,k as McpUiHostStylesSchema,b as McpUiHostCssSchema,T as McpUiHostContextSchema,R as McpUiHostContextChangedNotificationSchema,C as McpUiHostCapabilitiesSchema,_ as McpUiDownloadFileResultSchema,LQ as McpUiDownloadFileRequestSchema,D as McpUiDisplayModeSchema,x as McpUiAppCapabilitiesSchema,f as MESSAGE_METHOD,E as LATEST_PROTOCOL_VERSION,a as INITIALIZE_METHOD,o as INITIALIZED_METHOD,c as HOST_CONTEXT_CHANGED_METHOD,u as DOWNLOAD_FILE_METHOD,kQ as App};\n","/**\n * React Context for sharing the MCP App instance across the component tree.\n *\n * AppProvider handles connecting to the MCP Apps host and provides the App\n * instance via context. All sunpeak hooks read from this context internally,\n * so consumers never need to pass `app` as a parameter.\n *\n * The provider preserves the App instance across React Fast Refresh (HMR)\n * by storing it at module scope, matching the previous useApp() behavior.\n *\n * Connection resilience: if the initial PostMessage handshake doesn't complete\n * within a timeout, the provider automatically retries with exponential backoff.\n * This handles race conditions where the host iframe bridge isn't ready when the\n * app first mounts (common on first load in ChatGPT and Claude).\n */\nimport { createContext, useState, useEffect, type ReactNode } from 'react';\nimport { App, PostMessageTransport } from '@modelcontextprotocol/ext-apps';\n\nexport interface AppProviderProps {\n appInfo: { name: string; version: string };\n capabilities?: Record<string, unknown>;\n onAppCreated?: (app: App) => void;\n children: ReactNode;\n}\n\nexport interface AppState {\n app: App | null;\n isConnected: boolean;\n error: Error | null;\n}\n\nconst defaultState: AppState = { app: null, isConnected: false, error: null };\n\nexport const AppContext = createContext<AppState>(defaultState);\n\n// Module-level App persistence.\n// During React Fast Refresh the component file is hot-swapped but this module\n// is NOT re-evaluated, so these variables survive across HMR cycles.\n// On a full page reload they reset to null, triggering a fresh connection.\nlet _app: App | null = null;\nlet _connecting: Promise<App> | null = null;\n\n/** Timeout for a single connection attempt (ms). */\nconst CONNECT_TIMEOUT_MS = 5_000;\n/** Maximum number of retry attempts before giving up. */\nconst MAX_RETRIES = 3;\n/** Base delay for exponential backoff between retries (ms). */\nconst RETRY_BASE_DELAY_MS = 500;\n\n/**\n * Race a promise against a timeout. Rejects with a TimeoutError if the\n * promise doesn't settle within `ms` milliseconds.\n */\nfunction withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => reject(new Error('Connection timed out')), ms);\n promise.then(\n (v) => {\n clearTimeout(timer);\n resolve(v);\n },\n (e) => {\n clearTimeout(timer);\n reject(e);\n }\n );\n });\n}\n\n/**\n * Attempt to connect to the host with timeout and retries.\n * Each attempt creates a fresh transport + App instance so stale PostMessage\n * listeners from a previous failed attempt don't interfere.\n */\nasync function connectWithRetry(\n appInfo: { name: string; version: string },\n capabilities: Record<string, unknown>,\n onAppCreated?: (app: App) => void\n): Promise<App> {\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {\n if (attempt > 0) {\n const delay = RETRY_BASE_DELAY_MS * 2 ** (attempt - 1);\n await new Promise((r) => setTimeout(r, delay));\n }\n\n let transport: PostMessageTransport | null = null;\n try {\n transport = new PostMessageTransport(window.parent, window.parent);\n const newApp = new App(appInfo, capabilities);\n onAppCreated?.(newApp);\n await withTimeout(newApp.connect(transport), CONNECT_TIMEOUT_MS);\n return newApp;\n } catch (err) {\n // Clean up the transport's PostMessage listener so it doesn't linger.\n if (transport) {\n try {\n await transport.close();\n } catch {\n /* ignore close errors */\n }\n }\n lastError = err instanceof Error ? err : new Error('Connection failed');\n if (attempt < MAX_RETRIES) {\n console.warn(\n `[sunpeak] Connection attempt ${attempt + 1}/${MAX_RETRIES + 1} failed, retrying...`,\n lastError.message\n );\n }\n }\n }\n\n console.error(\n '[sunpeak] All connection attempts failed. Try refreshing the page or opening a new chat.\\n' +\n 'Troubleshooting: https://sunpeak.ai/docs/guides/troubleshooting'\n );\n throw lastError ?? new Error('Failed to connect');\n}\n\nexport function AppProvider({ appInfo, capabilities, onAppCreated, children }: AppProviderProps) {\n const [state, setState] = useState<AppState>(() =>\n _app ? { app: _app, isConnected: true, error: null } : defaultState\n );\n\n useEffect(() => {\n let cancelled = false;\n\n // Already connected (HMR re-run or StrictMode double-mount) — reuse.\n if (_app) {\n setState({ app: _app, isConnected: true, error: null });\n return () => {\n cancelled = true;\n };\n }\n\n // Connection already in flight (StrictMode double-mount) — wait for it.\n if (!_connecting) {\n _connecting = connectWithRetry(appInfo, capabilities ?? {}, onAppCreated);\n }\n\n _connecting.then(\n (connectedApp) => {\n _app = connectedApp;\n if (!cancelled) {\n setState({ app: connectedApp, isConnected: true, error: null });\n }\n },\n (err) => {\n _connecting = null;\n if (!cancelled) {\n setState({\n app: null,\n isConnected: false,\n error: err instanceof Error ? err : new Error('Failed to connect'),\n });\n }\n }\n );\n\n return () => {\n cancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- connect once, persist across HMR\n }, []);\n\n return <AppContext.Provider value={state}>{children}</AppContext.Provider>;\n}\n","import { useContext } from 'react';\nimport { AppContext } from './app-context';\nimport type { App } from '@modelcontextprotocol/ext-apps';\n\n/**\n * Access the MCP App instance from context.\n *\n * Returns the connected App instance, or `null` while the connection\n * is being established. Must be used inside an `<AppProvider>`.\n *\n * Most hooks read from context internally, so you only need `useApp()`\n * for direct SDK method calls like `app.requestDisplayMode()`.\n *\n * @example\n * ```tsx\n * import { useApp } from 'sunpeak';\n *\n * function MyComponent() {\n * const app = useApp();\n * const handleFullscreen = () => app?.requestDisplayMode({ mode: 'fullscreen' });\n * return <button onClick={handleFullscreen}>Fullscreen</button>;\n * }\n * ```\n */\nexport function useApp(): App | null {\n return useContext(AppContext).app;\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAAsY,IAAI,IAAE,cAAa,IAAE,gBAAe,IAAE,oBAAmB,IAAE,cAAkG,IAAE,iCAAgC,IAAE,+BAA8B,IAAE,uCAAsC,IAAE,gCAA+B,IAAE,mCAAkC,IAAE,yCAAwC,IAAE,qCAAoC,IAAE,wBAAuB,IAAE,iBAAgB,IAAE,gCAA+B,IAAE;AAA0B,IAAM,IAAN,MAAO;CAAC;CAAY;CAAY;CAAgB,YAAY,IAAE,OAAO,QAAO,GAAE;AAAC,OAAK,cAAY;AAAE,OAAK,cAAY;AAAE,OAAK,mBAAiB,MAAI;AAAC,OAAG,KAAG,EAAE,WAAS,KAAK,aAAY;AAAC,YAAQ,MAAM,wCAAuC,EAAE;AAAC;;GAAO,IAAI,IAAEA,qBAAE,UAAU,EAAE,KAAK;AAAC,OAAG,EAAE,QAAQ,SAAQ,MAAM,kBAAiB,EAAE,KAAK,EAAC,KAAK,YAAY,EAAE,KAAK;YAAS,EAAE,MAAM,YAAU,MAAM,SAAQ,MAAM,iCAAgC,EAAE,MAAM,SAAQ,EAAE;OAAM,SAAQ,MAAM,2BAA0B,EAAE,MAAM,SAAQ,EAAE,EAAC,KAAK,UAAU,MAAM,wCAAsC,EAAE,MAAM,QAAQ,CAAC;;;CAAE,MAAM,QAAO;AAAC,SAAO,iBAAiB,WAAU,KAAK,gBAAgB;;CAAC,MAAM,KAAK,GAAE,GAAE;AAAC,MAAG,EAAE,WAAA,s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