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
@@ -1,11 +1,11 @@
1
1
  import { r as __toESM } from "./chunk-BoAXSpZd.js";
2
2
  import { t as require_react } from "./react.js";
3
3
  import { Cn as object, In as string, Jn as union, Sn as number, St as _undefined, Tt as array, Yn as unknown, jn as record, kt as boolean, ln as literal } from "./schemas-NsgmY9QV.js";
4
- import { S as ResourceLinkSchema, T as ToolSchema, _ as PingRequestSchema, a as EmbeddedResourceSchema, b as ReadResourceResultSchema, c as JSONRPCMessageSchema, h as ListToolsRequestSchema, i as ContentBlockSchema, m as ListResourcesResultSchema, n as CallToolRequestSchema, o as EmptyResultSchema, r as CallToolResultSchema, s as ImplementationSchema, t as Protocol, x as RequestIdSchema } from "./protocol-CTflwIfG.js";
5
- //#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/react/index.js
4
+ import { S as ResourceLinkSchema, T as ToolSchema, _ as PingRequestSchema, a as EmbeddedResourceSchema, b as ReadResourceResultSchema, c as JSONRPCMessageSchema, h as ListToolsRequestSchema, i as ContentBlockSchema, m as ListResourcesResultSchema, n as CallToolRequestSchema, o as EmptyResultSchema, r as CallToolResultSchema, s as ImplementationSchema, t as Protocol, x as RequestIdSchema } from "./protocol-B_qKkui_.js";
5
+ //#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/react/index.js
6
6
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
7
- var z = "2026-01-26", o = "ui/open-link", a = "ui/download-file", s = "ui/message", t = "ui/notifications/sandbox-proxy-ready", e = "ui/notifications/sandbox-resource-ready", JJ = "ui/notifications/size-changed", KJ = "ui/notifications/tool-input", U = "ui/notifications/tool-input-partial", QJ = "ui/notifications/tool-result", XJ = "ui/notifications/tool-cancelled", YJ = "ui/notifications/host-context-changed", ZJ = "ui/notifications/request-teardown", $J = "ui/resource-teardown", GJ = "ui/initialize", jJ = "ui/notifications/initialized", WJ = "ui/request-display-mode";
8
- var j = class {
7
+ var R = "2026-01-26", o = "ui/open-link", a = "ui/download-file", s = "ui/message", t = "ui/notifications/sandbox-proxy-ready", e = "ui/notifications/sandbox-resource-ready", JJ = "ui/notifications/size-changed", KJ = "ui/notifications/tool-input", z = "ui/notifications/tool-input-partial", QJ = "ui/notifications/tool-result", XJ = "ui/notifications/tool-cancelled", YJ = "ui/notifications/host-context-changed", ZJ = "ui/notifications/request-teardown", $J = "ui/resource-teardown", GJ = "ui/initialize", WJ = "ui/notifications/initialized", jJ = "ui/request-display-mode";
8
+ var W = class {
9
9
  eventTarget;
10
10
  eventSource;
11
11
  messageListener;
@@ -39,7 +39,7 @@ var j = class {
39
39
  sessionId;
40
40
  setProtocolVersion;
41
41
  };
42
- var m = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), W = union([
42
+ var h = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), j = union([
43
43
  literal("inline"),
44
44
  literal("fullscreen"),
45
45
  literal("pip")
@@ -141,10 +141,10 @@ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Rec
141
141
  for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), DJ = object({
142
142
  method: literal("ui/open-link"),
143
143
  params: object({ url: string().describe("URL to open in the host's browser") })
144
- }), M = object({ isError: boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough(), T = object({ isError: boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).") }).passthrough(), H = object({ isError: boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough(), IJ = object({
144
+ }), w = object({ isError: boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough(), M = object({ isError: boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).") }).passthrough(), T = object({ isError: boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough(), IJ = object({
145
145
  method: literal("ui/notifications/sandbox-proxy-ready"),
146
146
  params: object({})
147
- }), P = object({
147
+ }), V = object({
148
148
  connectDomains: array(string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
149
149
 
150
150
  - Maps to CSP \`connect-src\` directive
@@ -152,7 +152,7 @@ for compatibility with Zod schema generation. Both are functionally equivalent f
152
152
  resourceDomains: array(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)"),
153
153
  frameDomains: array(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'`)"),
154
154
  baseUriDomains: array(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'`)")
155
- }), _ = object({
155
+ }), P = object({
156
156
  camera: object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),
157
157
  microphone: object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),
158
158
  geolocation: object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),
@@ -163,22 +163,22 @@ for compatibility with Zod schema generation. Both are functionally equivalent f
163
163
  width: number().optional().describe("New width in pixels."),
164
164
  height: number().optional().describe("New height in pixels.")
165
165
  })
166
- }), v = object({
166
+ }), H = object({
167
167
  method: literal("ui/notifications/tool-input"),
168
168
  params: object({ arguments: record(string(), unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.") })
169
- }), A = object({
169
+ }), v = object({
170
170
  method: literal("ui/notifications/tool-input-partial"),
171
171
  params: object({ arguments: record(string(), unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).") })
172
- }), k = object({
172
+ }), A = object({
173
173
  method: literal("ui/notifications/tool-cancelled"),
174
174
  params: object({ reason: string().optional().describe("Optional reason for the cancellation (e.g., \"user action\", \"timeout\").") })
175
- }), c = object({ fonts: string().optional() }), r = object({
175
+ }), m = object({ fonts: string().optional() }), c = object({
176
176
  variables: qJ.optional().describe("CSS variables for theming the app."),
177
- css: c.optional().describe("CSS blocks that apps can inject.")
178
- }), b = object({
177
+ css: m.optional().describe("CSS blocks that apps can inject.")
178
+ }), k = object({
179
179
  method: literal("ui/resource-teardown"),
180
180
  params: object({})
181
- }), EJ = record(string(), unknown()), w = object({
181
+ }), EJ = record(string(), unknown()), U = object({
182
182
  text: object({}).optional().describe("Host supports text content blocks."),
183
183
  image: object({}).optional().describe("Host supports image content blocks."),
184
184
  audio: object({}).optional().describe("Host supports audio content blocks."),
@@ -188,7 +188,7 @@ for compatibility with Zod schema generation. Both are functionally equivalent f
188
188
  }), RJ = object({
189
189
  method: literal("ui/notifications/request-teardown"),
190
190
  params: object({}).optional()
191
- }), l = object({
191
+ }), r = object({
192
192
  experimental: object({}).optional().describe("Experimental features (structure TBD)."),
193
193
  openLinks: object({}).optional().describe("Host supports opening external URLs."),
194
194
  downloadFile: object({}).optional().describe("Host supports file downloads via ui/download-file."),
@@ -196,21 +196,21 @@ for compatibility with Zod schema generation. Both are functionally equivalent f
196
196
  serverResources: object({ listChanged: boolean().optional().describe("Host supports resources/list_changed notifications.") }).optional().describe("Host can proxy resource reads to the MCP server."),
197
197
  logging: object({}).optional().describe("Host accepts log messages."),
198
198
  sandbox: object({
199
- permissions: _.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),
200
- csp: P.optional().describe("CSP domains approved by the host.")
199
+ permissions: P.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),
200
+ csp: V.optional().describe("CSP domains approved by the host.")
201
201
  }).optional().describe("Sandbox configuration applied by the host."),
202
- updateModelContext: w.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),
203
- message: w.optional().describe("Host supports receiving content messages (ui/message) from the view.")
204
- }), i = object({
202
+ updateModelContext: U.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),
203
+ message: U.optional().describe("Host supports receiving content messages (ui/message) from the view.")
204
+ }), l = object({
205
205
  experimental: object({}).optional().describe("Experimental features (structure TBD)."),
206
206
  tools: object({ listChanged: boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."),
207
- availableDisplayModes: array(W).optional().describe("Display modes the app supports.")
207
+ availableDisplayModes: array(j).optional().describe("Display modes the app supports.")
208
208
  }), zJ = object({
209
209
  method: literal("ui/notifications/initialized"),
210
210
  params: object({}).optional()
211
211
  }), UJ = object({
212
- csp: P.optional().describe("Content Security Policy configuration for UI resources."),
213
- permissions: _.optional().describe("Sandbox permissions requested by the UI resource."),
212
+ csp: V.optional().describe("Content Security Policy configuration for UI resources."),
213
+ permissions: P.optional().describe("Sandbox permissions requested by the UI resource."),
214
214
  domain: string().optional().describe(`Dedicated origin for view sandbox.
215
215
 
216
216
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
@@ -229,10 +229,10 @@ Boolean requesting whether a visible border and background is provided by the ho
229
229
  - omitted: host decides border`)
230
230
  }), wJ = object({
231
231
  method: literal("ui/request-display-mode"),
232
- params: object({ mode: W.describe("The display mode being requested.") })
233
- }), S = object({ mode: W.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), p = union([literal("model"), literal("app")]).describe("Tool visibility scope - who can access the tool."), MJ = object({
232
+ params: object({ mode: j.describe("The display mode being requested.") })
233
+ }), b = object({ mode: j.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), i = union([literal("model"), literal("app")]).describe("Tool visibility scope - who can access the tool."), MJ = object({
234
234
  resourceUri: string().optional(),
235
- visibility: array(p).optional().describe(`Who can access this tool. Default: ["model", "app"]
235
+ visibility: array(i).optional().describe(`Who can access this tool. Default: ["model", "app"]
236
236
  - "model": Tool visible to and callable by the agent
237
237
  - "app": Tool callable by the app from this server only`)
238
238
  });
@@ -251,21 +251,21 @@ var TJ = object({
251
251
  params: object({
252
252
  html: string().describe("HTML content to load into the inner iframe."),
253
253
  sandbox: string().optional().describe("Optional override for the inner iframe's sandbox attribute."),
254
- csp: P.optional().describe("CSP configuration from resource metadata."),
255
- permissions: _.optional().describe("Sandbox permissions from resource metadata.")
254
+ csp: V.optional().describe("CSP configuration from resource metadata."),
255
+ permissions: P.optional().describe("Sandbox permissions from resource metadata.")
256
256
  })
257
- }), C = object({
257
+ }), S = object({
258
258
  method: literal("ui/notifications/tool-result"),
259
259
  params: CallToolResultSchema.describe("Standard MCP tool execution result.")
260
- }), g = object({
260
+ }), C = object({
261
261
  toolInfo: object({
262
262
  id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."),
263
263
  tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.")
264
264
  }).optional().describe("Metadata of the tool call that instantiated this App."),
265
- theme: m.optional().describe("Current color theme preference."),
266
- styles: r.optional().describe("Style configuration for theming the app."),
267
- displayMode: W.optional().describe("How the UI is currently displayed."),
268
- availableDisplayModes: array(W).optional().describe("Display modes the host supports."),
265
+ theme: h.optional().describe("Current color theme preference."),
266
+ styles: c.optional().describe("Style configuration for theming the app."),
267
+ displayMode: j.optional().describe("How the UI is currently displayed."),
268
+ availableDisplayModes: array(j).optional().describe("Display modes the host supports."),
269
269
  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
270
270
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),
271
271
  locale: string().optional().describe("User's language and region preference in BCP 47 format."),
@@ -286,9 +286,9 @@ container holding the app. Specify either width or maxWidth, and either height o
286
286
  bottom: number().describe("Bottom safe area inset in pixels."),
287
287
  left: number().describe("Left safe area inset in pixels.")
288
288
  }).optional().describe("Mobile safe area boundaries in pixels.")
289
- }).passthrough(), x = object({
289
+ }).passthrough(), g = object({
290
290
  method: literal("ui/notifications/host-context-changed"),
291
- params: g.describe("Partial context update containing only changed fields.")
291
+ params: C.describe("Partial context update containing only changed fields.")
292
292
  }), AJ = object({
293
293
  method: literal("ui/update-model-context"),
294
294
  params: object({
@@ -299,34 +299,34 @@ container holding the app. Specify either width or maxWidth, and either height o
299
299
  method: literal("ui/initialize"),
300
300
  params: object({
301
301
  appInfo: ImplementationSchema.describe("App identification (name and version)."),
302
- appCapabilities: i.describe("Features and capabilities this app provides."),
302
+ appCapabilities: l.describe("Features and capabilities this app provides."),
303
303
  protocolVersion: string().describe("Protocol version this app supports.")
304
304
  })
305
- }), y = object({
305
+ }), x = object({
306
306
  protocolVersion: string().describe("Negotiated protocol version string (e.g., \"2025-11-21\")."),
307
307
  hostInfo: ImplementationSchema.describe("Host application identification and version."),
308
- hostCapabilities: l.describe("Features and capabilities provided by the host."),
309
- hostContext: g.describe("Rich context about the host environment.")
308
+ hostCapabilities: r.describe("Features and capabilities provided by the host."),
309
+ hostContext: C.describe("Rich context about the host environment.")
310
310
  }).passthrough();
311
- function O() {
311
+ function _() {
312
312
  let K = document.documentElement.getAttribute("data-theme");
313
313
  if (K === "dark" || K === "light") return K;
314
314
  return document.documentElement.classList.contains("dark") ? "dark" : "light";
315
315
  }
316
- function q(K) {
316
+ function O(K) {
317
317
  let Q = document.documentElement;
318
318
  Q.setAttribute("data-theme", K), Q.style.colorScheme = K;
319
319
  }
320
- function D(K, Q = document.documentElement) {
320
+ function q(K, Q = document.documentElement) {
321
321
  for (let [X, Y] of Object.entries(K)) if (Y !== void 0) Q.style.setProperty(X, Y);
322
322
  }
323
- function I(K) {
323
+ function D(K) {
324
324
  if (document.getElementById("__mcp-host-fonts")) return;
325
325
  let X = document.createElement("style");
326
326
  X.id = "__mcp-host-fonts", X.textContent = K, document.head.appendChild(X);
327
327
  }
328
328
  var dK = "ui/resourceUri", uK = "text/html;profile=mcp-app";
329
- var f = class extends Protocol {
329
+ var y = class extends Protocol {
330
330
  _appInfo;
331
331
  _capabilities;
332
332
  options;
@@ -352,19 +352,19 @@ var f = class extends Protocol {
352
352
  return this._hostContext;
353
353
  }
354
354
  set ontoolinput(K) {
355
- this.setNotificationHandler(v, (Q) => K(Q.params));
355
+ this.setNotificationHandler(H, (Q) => K(Q.params));
356
356
  }
357
357
  set ontoolinputpartial(K) {
358
- this.setNotificationHandler(A, (Q) => K(Q.params));
358
+ this.setNotificationHandler(v, (Q) => K(Q.params));
359
359
  }
360
360
  set ontoolresult(K) {
361
- this.setNotificationHandler(C, (Q) => K(Q.params));
361
+ this.setNotificationHandler(S, (Q) => K(Q.params));
362
362
  }
363
363
  set ontoolcancelled(K) {
364
- this.setNotificationHandler(k, (Q) => K(Q.params));
364
+ this.setNotificationHandler(A, (Q) => K(Q.params));
365
365
  }
366
366
  set onhostcontextchanged(K) {
367
- this.setNotificationHandler(x, (Q) => {
367
+ this.setNotificationHandler(g, (Q) => {
368
368
  this._hostContext = {
369
369
  ...this._hostContext,
370
370
  ...Q.params
@@ -372,7 +372,7 @@ var f = class extends Protocol {
372
372
  });
373
373
  }
374
374
  set onteardown(K) {
375
- this.setRequestHandler(b, (Q, X) => K(Q.params, X));
375
+ this.setRequestHandler(k, (Q, X) => K(Q.params, X));
376
376
  }
377
377
  set oncalltool(K) {
378
378
  this.setRequestHandler(CallToolRequestSchema, (Q, X) => K(Q.params, X));
@@ -422,7 +422,7 @@ var f = class extends Protocol {
422
422
  return this.request({
423
423
  method: "ui/message",
424
424
  params: K
425
- }, H, Q);
425
+ }, T, Q);
426
426
  }
427
427
  sendLog(K) {
428
428
  return this.notification({
@@ -440,14 +440,14 @@ var f = class extends Protocol {
440
440
  return this.request({
441
441
  method: "ui/open-link",
442
442
  params: K
443
- }, M, Q);
443
+ }, w, Q);
444
444
  }
445
445
  sendOpenLink = this.openLink;
446
446
  downloadFile(K, Q) {
447
447
  return this.request({
448
448
  method: "ui/download-file",
449
449
  params: K
450
- }, T, Q);
450
+ }, M, Q);
451
451
  }
452
452
  requestTeardown(K = {}) {
453
453
  return this.notification({
@@ -459,7 +459,7 @@ var f = class extends Protocol {
459
459
  return this.request({
460
460
  method: "ui/request-display-mode",
461
461
  params: K
462
- }, S, Q);
462
+ }, b, Q);
463
463
  }
464
464
  sendSizeChanged(K) {
465
465
  return this.notification({
@@ -472,22 +472,22 @@ var f = class extends Protocol {
472
472
  if (K) return;
473
473
  K = !0, requestAnimationFrame(() => {
474
474
  K = !1;
475
- let Z = document.documentElement, V = Z.style.width, E = Z.style.height;
476
- Z.style.width = "fit-content", Z.style.height = "max-content";
477
- let L = Z.getBoundingClientRect();
478
- Z.style.width = V, Z.style.height = E;
479
- let N = window.innerWidth - Z.clientWidth, B = Math.ceil(L.width + N), $ = Math.ceil(L.height);
480
- if (B !== Q || $ !== X) Q = B, X = $, this.sendSizeChanged({
481
- width: B,
482
- height: $
475
+ let $ = document.documentElement, N = $.style.height;
476
+ $.style.height = "max-content";
477
+ let L = Math.ceil($.getBoundingClientRect().height);
478
+ $.style.height = N;
479
+ let G = Math.ceil(window.innerWidth);
480
+ if (G !== Q || L !== X) Q = G, X = L, this.sendSizeChanged({
481
+ width: G,
482
+ height: L
483
483
  });
484
484
  });
485
485
  };
486
486
  Y();
487
- let G = new ResizeObserver(Y);
488
- return G.observe(document.documentElement), G.observe(document.body), () => G.disconnect();
487
+ let Z = new ResizeObserver(Y);
488
+ return Z.observe(document.documentElement), Z.observe(document.body), () => Z.disconnect();
489
489
  }
490
- async connect(K = new j(window.parent, window.parent), Q) {
490
+ async connect(K = new W(window.parent, window.parent), Q) {
491
491
  if (this.transport) throw Error("App is already connected. Call close() before connecting again.");
492
492
  await super.connect(K);
493
493
  try {
@@ -496,9 +496,9 @@ var f = class extends Protocol {
496
496
  params: {
497
497
  appCapabilities: this._capabilities,
498
498
  appInfo: this._appInfo,
499
- protocolVersion: z
499
+ protocolVersion: R
500
500
  }
501
- }, y, Q);
501
+ }, x, Q);
502
502
  if (X === void 0) throw Error(`Server sent invalid initialize result: ${X}`);
503
503
  if (this._hostCapabilities = X.hostCapabilities, this._hostInfo = X.hostInfo, this._hostContext = X.hostContext, await this.notification({ method: "ui/notifications/initialized" }), this.options?.autoResize) this.setupSizeChangedNotifications();
504
504
  } catch (X) {
@@ -507,24 +507,24 @@ var f = class extends Protocol {
507
507
  }
508
508
  };
509
509
  function nK({ appInfo: K, capabilities: Q, onAppCreated: X }) {
510
- let [Y, G] = (0, import_react.useState)(null), [Z, V] = (0, import_react.useState)(!1), [E, L] = (0, import_react.useState)(null);
510
+ let [Y, Z] = (0, import_react.useState)(null), [$, N] = (0, import_react.useState)(!1), [L, G] = (0, import_react.useState)(null);
511
511
  return (0, import_react.useEffect)(() => {
512
- let N = !0;
513
- async function B() {
512
+ let F = !0;
513
+ async function n() {
514
514
  try {
515
- let $ = new j(window.parent, window.parent), R = new f(K, Q);
516
- if (X?.(R), await R.connect($), N) G(R), V(!0), L(null);
517
- } catch ($) {
518
- if (N) G(null), V(!1), L($ instanceof Error ? $ : Error("Failed to connect"));
515
+ let B = new W(window.parent, window.parent), E = new y(K, Q);
516
+ if (X?.(E), await E.connect(B), F) Z(E), N(!0), G(null);
517
+ } catch (B) {
518
+ if (F) Z(null), N(!1), G(B instanceof Error ? B : Error("Failed to connect"));
519
519
  }
520
520
  }
521
- return B(), () => {
522
- N = !1;
521
+ return n(), () => {
522
+ F = !1;
523
523
  };
524
524
  }, []), {
525
525
  app: Y,
526
- isConnected: Z,
527
- error: E
526
+ isConnected: $,
527
+ error: L
528
528
  };
529
529
  }
530
530
  function eK(K, Q) {
@@ -534,10 +534,10 @@ function eK(K, Q) {
534
534
  }, [K, Q]);
535
535
  }
536
536
  function XQ() {
537
- let [K, Q] = (0, import_react.useState)(O);
537
+ let [K, Q] = (0, import_react.useState)(_);
538
538
  return (0, import_react.useEffect)(() => {
539
539
  let X = new MutationObserver(() => {
540
- Q(O());
540
+ Q(_());
541
541
  });
542
542
  return X.observe(document.documentElement, {
543
543
  attributes: !0,
@@ -552,14 +552,14 @@ function rJ(K, Q) {
552
552
  let X = (0, import_react.useRef)(!1);
553
553
  (0, import_react.useEffect)(() => {
554
554
  if (X.current) return;
555
- if (Q?.theme) q(Q.theme);
556
- if (Q?.styles?.variables) D(Q.styles.variables);
555
+ if (Q?.theme) O(Q.theme);
556
+ if (Q?.styles?.variables) q(Q.styles.variables);
557
557
  if (Q?.theme || Q?.styles?.variables) X.current = !0;
558
558
  }, [Q]), (0, import_react.useEffect)(() => {
559
559
  if (!K) return;
560
560
  K.onhostcontextchanged = (Y) => {
561
- if (Y.theme) q(Y.theme);
562
- if (Y.styles?.variables) D(Y.styles.variables);
561
+ if (Y.theme) O(Y.theme);
562
+ if (Y.styles?.variables) q(Y.styles.variables);
563
563
  };
564
564
  }, [K]);
565
565
  }
@@ -567,11 +567,11 @@ function lJ(K, Q) {
567
567
  let X = (0, import_react.useRef)(!1);
568
568
  (0, import_react.useEffect)(() => {
569
569
  if (X.current) return;
570
- if (Q?.styles?.css?.fonts) I(Q.styles.css.fonts), X.current = !0;
570
+ if (Q?.styles?.css?.fonts) D(Q.styles.css.fonts), X.current = !0;
571
571
  }, [Q]), (0, import_react.useEffect)(() => {
572
572
  if (!K) return;
573
573
  K.onhostcontextchanged = (Y) => {
574
- if (Y.styles?.css?.fonts) I(Y.styles.css.fonts);
574
+ if (Y.styles?.css?.fonts) D(Y.styles.css.fonts);
575
575
  };
576
576
  }, [K]);
577
577
  }
@@ -579,6 +579,6 @@ function GQ(K, Q) {
579
579
  rJ(K, Q), lJ(K, Q);
580
580
  }
581
581
  //#endregion
582
- export { f as App, a as DOWNLOAD_FILE_METHOD, YJ as HOST_CONTEXT_CHANGED_METHOD, jJ as INITIALIZED_METHOD, GJ as INITIALIZE_METHOD, z as LATEST_PROTOCOL_VERSION, s as MESSAGE_METHOD, i as McpUiAppCapabilitiesSchema, W as McpUiDisplayModeSchema, TJ as McpUiDownloadFileRequestSchema, T as McpUiDownloadFileResultSchema, l as McpUiHostCapabilitiesSchema, x as McpUiHostContextChangedNotificationSchema, g as McpUiHostContextSchema, c as McpUiHostCssSchema, r as McpUiHostStylesSchema, kJ as McpUiInitializeRequestSchema, y as McpUiInitializeResultSchema, zJ as McpUiInitializedNotificationSchema, HJ as McpUiMessageRequestSchema, H as McpUiMessageResultSchema, DJ as McpUiOpenLinkRequestSchema, M as McpUiOpenLinkResultSchema, wJ as McpUiRequestDisplayModeRequestSchema, S as McpUiRequestDisplayModeResultSchema, RJ as McpUiRequestTeardownNotificationSchema, P as McpUiResourceCspSchema, UJ as McpUiResourceMetaSchema, _ as McpUiResourcePermissionsSchema, b as McpUiResourceTeardownRequestSchema, EJ as McpUiResourceTeardownResultSchema, IJ as McpUiSandboxProxyReadyNotificationSchema, vJ as McpUiSandboxResourceReadyNotificationSchema, FJ as McpUiSizeChangedNotificationSchema, w as McpUiSupportedContentBlockModalitiesSchema, m as McpUiThemeSchema, k as McpUiToolCancelledNotificationSchema, v as McpUiToolInputNotificationSchema, A as McpUiToolInputPartialNotificationSchema, MJ as McpUiToolMetaSchema, C as McpUiToolResultNotificationSchema, p as McpUiToolVisibilitySchema, AJ as McpUiUpdateModelContextRequestSchema, o as OPEN_LINK_METHOD, j as PostMessageTransport, WJ as REQUEST_DISPLAY_MODE_METHOD, ZJ as REQUEST_TEARDOWN_METHOD, uK as RESOURCE_MIME_TYPE, $J as RESOURCE_TEARDOWN_METHOD, dK as RESOURCE_URI_META_KEY, t as SANDBOX_PROXY_READY_METHOD, e as SANDBOX_RESOURCE_READY_METHOD, JJ as SIZE_CHANGED_METHOD, XJ as TOOL_CANCELLED_METHOD, KJ as TOOL_INPUT_METHOD, U as TOOL_INPUT_PARTIAL_METHOD, QJ as TOOL_RESULT_METHOD, q as applyDocumentTheme, I as applyHostFonts, D as applyHostStyleVariables, O as getDocumentTheme, nK as useApp, eK as useAutoResize, XQ as useDocumentTheme, lJ as useHostFonts, rJ as useHostStyleVariables, GQ as useHostStyles };
582
+ export { y as App, a as DOWNLOAD_FILE_METHOD, YJ as HOST_CONTEXT_CHANGED_METHOD, WJ as INITIALIZED_METHOD, GJ as INITIALIZE_METHOD, R as LATEST_PROTOCOL_VERSION, s as MESSAGE_METHOD, l as McpUiAppCapabilitiesSchema, j as McpUiDisplayModeSchema, TJ as McpUiDownloadFileRequestSchema, M as McpUiDownloadFileResultSchema, r as McpUiHostCapabilitiesSchema, g as McpUiHostContextChangedNotificationSchema, C as McpUiHostContextSchema, m as McpUiHostCssSchema, c as McpUiHostStylesSchema, kJ as McpUiInitializeRequestSchema, x as McpUiInitializeResultSchema, zJ as McpUiInitializedNotificationSchema, HJ as McpUiMessageRequestSchema, T as McpUiMessageResultSchema, DJ as McpUiOpenLinkRequestSchema, w as McpUiOpenLinkResultSchema, wJ as McpUiRequestDisplayModeRequestSchema, b as McpUiRequestDisplayModeResultSchema, RJ as McpUiRequestTeardownNotificationSchema, V as McpUiResourceCspSchema, UJ as McpUiResourceMetaSchema, P as McpUiResourcePermissionsSchema, k as McpUiResourceTeardownRequestSchema, EJ as McpUiResourceTeardownResultSchema, IJ as McpUiSandboxProxyReadyNotificationSchema, vJ as McpUiSandboxResourceReadyNotificationSchema, FJ as McpUiSizeChangedNotificationSchema, U as McpUiSupportedContentBlockModalitiesSchema, h as McpUiThemeSchema, A as McpUiToolCancelledNotificationSchema, H as McpUiToolInputNotificationSchema, v as McpUiToolInputPartialNotificationSchema, MJ as McpUiToolMetaSchema, S as McpUiToolResultNotificationSchema, i as McpUiToolVisibilitySchema, AJ as McpUiUpdateModelContextRequestSchema, o as OPEN_LINK_METHOD, W as PostMessageTransport, jJ as REQUEST_DISPLAY_MODE_METHOD, ZJ as REQUEST_TEARDOWN_METHOD, uK as RESOURCE_MIME_TYPE, $J as RESOURCE_TEARDOWN_METHOD, dK as RESOURCE_URI_META_KEY, t as SANDBOX_PROXY_READY_METHOD, e as SANDBOX_RESOURCE_READY_METHOD, JJ as SIZE_CHANGED_METHOD, XJ as TOOL_CANCELLED_METHOD, KJ as TOOL_INPUT_METHOD, z as TOOL_INPUT_PARTIAL_METHOD, QJ as TOOL_RESULT_METHOD, O as applyDocumentTheme, D as applyHostFonts, q as applyHostStyleVariables, _ as getDocumentTheme, nK as useApp, eK as useAutoResize, XQ as useDocumentTheme, lJ as useHostFonts, rJ as useHostStyleVariables, GQ as useHostStyles };
583
583
 
584
584
  //# sourceMappingURL=@modelcontextprotocol_ext-apps_react.js.map