sunpeak 0.18.2 → 0.18.6

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 (57) hide show
  1. package/bin/commands/inspect.mjs +392 -4
  2. package/bin/lib/sandbox-server.mjs +11 -1
  3. package/dist/chatgpt/index.cjs +1 -1
  4. package/dist/chatgpt/index.js +1 -1
  5. package/dist/claude/index.cjs +1 -1
  6. package/dist/claude/index.js +1 -1
  7. package/dist/hooks/index.d.ts +1 -0
  8. package/dist/hooks/use-request-teardown.d.ts +21 -0
  9. package/dist/host/chatgpt/index.cjs +1 -1
  10. package/dist/host/chatgpt/index.js +1 -1
  11. package/dist/index.cjs +110 -70
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +68 -31
  15. package/dist/index.js.map +1 -1
  16. package/dist/inspector/hosts.d.ts +12 -0
  17. package/dist/inspector/index.cjs +1 -1
  18. package/dist/inspector/index.js +1 -1
  19. package/dist/inspector/mcp-app-host.d.ts +3 -0
  20. package/dist/inspector/simple-sidebar.d.ts +1 -1
  21. package/dist/inspector/use-mcp-connection.d.ts +9 -1
  22. package/dist/{inspector-ClhpqKLi.js → inspector-CjSoXm6N.js} +497 -117
  23. package/dist/inspector-CjSoXm6N.js.map +1 -0
  24. package/dist/{inspector-CByJjmPD.cjs → inspector-DRD_Q66E.cjs} +498 -118
  25. package/dist/inspector-DRD_Q66E.cjs.map +1 -0
  26. package/dist/mcp/index.cjs +38 -33
  27. package/dist/mcp/index.cjs.map +1 -1
  28. package/dist/mcp/index.js +35 -30
  29. package/dist/mcp/index.js.map +1 -1
  30. package/dist/style.css +8 -0
  31. package/dist/{use-app-X7JbGskk.js → use-app-BNbz1uzj.js} +51 -42
  32. package/dist/use-app-BNbz1uzj.js.map +1 -0
  33. package/dist/{use-app-D2h-aiyr.cjs → use-app-Dqh20JPP.cjs} +93 -72
  34. package/dist/use-app-Dqh20JPP.cjs.map +1 -0
  35. package/package.json +2 -2
  36. package/template/dist/albums/albums.html +3 -3
  37. package/template/dist/albums/albums.json +1 -1
  38. package/template/dist/carousel/carousel.html +3 -3
  39. package/template/dist/carousel/carousel.json +1 -1
  40. package/template/dist/map/map.html +3 -3
  41. package/template/dist/map/map.json +1 -1
  42. package/template/dist/review/review.html +3 -3
  43. package/template/dist/review/review.json +1 -1
  44. package/template/node_modules/.vite/deps/_metadata.json +3 -3
  45. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +51 -42
  46. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
  47. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +56 -50
  48. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
  49. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +52 -43
  50. package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
  51. package/template/node_modules/.vite-mcp/deps/_metadata.json +22 -22
  52. package/template/tests/e2e/albums.spec.ts +19 -15
  53. package/template/tests/live/albums.spec.ts +10 -0
  54. package/dist/inspector-CByJjmPD.cjs.map +0 -1
  55. package/dist/inspector-ClhpqKLi.js.map +0 -1
  56. package/dist/use-app-D2h-aiyr.cjs.map +0 -1
  57. package/dist/use-app-X7JbGskk.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  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";
2
2
  import { C as ResourceListChangedNotificationSchema, S as ResourceLinkSchema, T as ToolSchema, _ as PingRequestSchema, a as EmbeddedResourceSchema, b as ReadResourceResultSchema, c as JSONRPCMessageSchema, d as ListResourceTemplatesRequestSchema, f as ListResourceTemplatesResultSchema, g as LoggingMessageNotificationSchema, i as ContentBlockSchema, l as ListPromptsRequestSchema, m as ListResourcesResultSchema, n as CallToolRequestSchema, p as ListResourcesRequestSchema, r as CallToolResultSchema, s as ImplementationSchema, t as Protocol, u as ListPromptsResultSchema, v as PromptListChangedNotificationSchema, w as ToolListChangedNotificationSchema, x as RequestIdSchema, y as ReadResourceRequestSchema } from "./protocol-CTflwIfG.js";
3
- //#region ../../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.2.2_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__react-_e9bf7657371391a829fe8b4e289b253c/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js
4
- var G = "2026-01-26", t = "ui/open-link", s = "ui/download-file", e = "ui/message", QQ = "ui/notifications/sandbox-proxy-ready", XQ = "ui/notifications/sandbox-resource-ready", YQ = "ui/notifications/size-changed", ZQ = "ui/notifications/tool-input", _ = "ui/notifications/tool-input-partial", $Q = "ui/notifications/tool-result", JQ = "ui/notifications/tool-cancelled", KQ = "ui/notifications/host-context-changed", GQ = "ui/resource-teardown", DQ = "ui/initialize", NQ = "ui/notifications/initialized", jQ = "ui/request-display-mode";
5
- var m = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), D = union([
3
+ //#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-bridge.js
4
+ var G = "2026-01-26", s = "ui/open-link", e = "ui/download-file", QQ = "ui/message", XQ = "ui/notifications/sandbox-proxy-ready", YQ = "ui/notifications/sandbox-resource-ready", ZQ = "ui/notifications/size-changed", $Q = "ui/notifications/tool-input", _ = "ui/notifications/tool-input-partial", JQ = "ui/notifications/tool-result", KQ = "ui/notifications/tool-cancelled", GQ = "ui/notifications/host-context-changed", DQ = "ui/notifications/request-teardown", NQ = "ui/resource-teardown", jQ = "ui/initialize", EQ = "ui/notifications/initialized", WQ = "ui/request-display-mode";
5
+ var p = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), D = union([
6
6
  literal("inline"),
7
7
  literal("fullscreen"),
8
8
  literal("pip")
9
- ]).describe("Display mode for UI presentation."), VQ = record(union([
9
+ ]).describe("Display mode for UI presentation."), AQ = record(union([
10
10
  literal("--color-background-primary"),
11
11
  literal("--color-background-secondary"),
12
12
  literal("--color-background-tertiary"),
@@ -104,7 +104,7 @@ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Rec
104
104
  for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), V = object({
105
105
  method: literal("ui/open-link"),
106
106
  params: object({ url: string().describe("URL to open in the host's browser") })
107
- }), I = object({ isError: boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough(), A = object({ isError: boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).") }).passthrough(), L = object({ isError: boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough(), F = object({
107
+ }), I = object({ isError: boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough(), A = object({ isError: boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).") }).passthrough(), F = object({ isError: boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough(), L = object({
108
108
  method: literal("ui/notifications/sandbox-proxy-ready"),
109
109
  params: object({})
110
110
  }), j = object({
@@ -132,23 +132,26 @@ for compatibility with Zod schema generation. Both are functionally equivalent f
132
132
  }), w = object({
133
133
  method: literal("ui/notifications/tool-input-partial"),
134
134
  params: object({ arguments: record(string(), unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).") })
135
- }), U = object({
135
+ }), R = object({
136
136
  method: literal("ui/notifications/tool-cancelled"),
137
137
  params: object({ reason: string().optional().describe("Optional reason for the cancellation (e.g., \"user action\", \"timeout\").") })
138
- }), p = object({ fonts: string().optional() }), c = object({
139
- variables: VQ.optional().describe("CSS variables for theming the app."),
140
- css: p.optional().describe("CSS blocks that apps can inject.")
141
- }), H = object({
138
+ }), c = object({ fonts: string().optional() }), n = object({
139
+ variables: AQ.optional().describe("CSS variables for theming the app."),
140
+ css: c.optional().describe("CSS blocks that apps can inject.")
141
+ }), U = object({
142
142
  method: literal("ui/resource-teardown"),
143
143
  params: object({})
144
- }), R = record(string(), unknown()), O = object({
144
+ }), H = record(string(), unknown()), O = object({
145
145
  text: object({}).optional().describe("Host supports text content blocks."),
146
146
  image: object({}).optional().describe("Host supports image content blocks."),
147
147
  audio: object({}).optional().describe("Host supports audio content blocks."),
148
148
  resource: object({}).optional().describe("Host supports resource content blocks."),
149
149
  resourceLink: object({}).optional().describe("Host supports resource link content blocks."),
150
150
  structuredContent: object({}).optional().describe("Host supports structured content.")
151
- }), n = object({
151
+ }), M = object({
152
+ method: literal("ui/notifications/request-teardown"),
153
+ params: object({}).optional()
154
+ }), i = object({
152
155
  experimental: object({}).optional().describe("Experimental features (structure TBD)."),
153
156
  openLinks: object({}).optional().describe("Host supports opening external URLs."),
154
157
  downloadFile: object({}).optional().describe("Host supports file downloads via ui/download-file."),
@@ -161,14 +164,14 @@ for compatibility with Zod schema generation. Both are functionally equivalent f
161
164
  }).optional().describe("Sandbox configuration applied by the host."),
162
165
  updateModelContext: O.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),
163
166
  message: O.optional().describe("Host supports receiving content messages (ui/message) from the view.")
164
- }), i = object({
167
+ }), l = object({
165
168
  experimental: object({}).optional().describe("Experimental features (structure TBD)."),
166
169
  tools: object({ listChanged: boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."),
167
170
  availableDisplayModes: array(D).optional().describe("Display modes the app supports.")
168
- }), M = object({
171
+ }), v = object({
169
172
  method: literal("ui/notifications/initialized"),
170
173
  params: object({}).optional()
171
- }), IQ = object({
174
+ }), FQ = object({
172
175
  csp: j.optional().describe("Content Security Policy configuration for UI resources."),
173
176
  permissions: E.optional().describe("Sandbox permissions requested by the UI resource."),
174
177
  domain: string().optional().describe(`Dedicated origin for view sandbox.
@@ -190,23 +193,23 @@ Boolean requesting whether a visible border and background is provided by the ho
190
193
  }), W = object({
191
194
  method: literal("ui/request-display-mode"),
192
195
  params: object({ mode: D.describe("The display mode being requested.") })
193
- }), v = object({ mode: D.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), l = union([literal("model"), literal("app")]).describe("Tool visibility scope - who can access the tool."), AQ = object({
196
+ }), g = object({ mode: D.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), r = union([literal("model"), literal("app")]).describe("Tool visibility scope - who can access the tool."), LQ = object({
194
197
  resourceUri: string().optional(),
195
- visibility: array(l).optional().describe(`Who can access this tool. Default: ["model", "app"]
198
+ visibility: array(r).optional().describe(`Who can access this tool. Default: ["model", "app"]
196
199
  - "model": Tool visible to and callable by the agent
197
200
  - "app": Tool callable by the app from this server only`)
198
201
  });
199
202
  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.") });
200
- var S = object({
203
+ var C = object({
201
204
  method: literal("ui/download-file"),
202
205
  params: object({ contents: array(union([EmbeddedResourceSchema, ResourceLinkSchema])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.") })
203
- }), C = object({
206
+ }), S = object({
204
207
  method: literal("ui/message"),
205
208
  params: object({
206
209
  role: literal("user").describe("Message role, currently only \"user\" is supported."),
207
210
  content: array(ContentBlockSchema).describe("Message content blocks (text, image, etc.).")
208
211
  })
209
- }), LQ = object({
212
+ }), PQ = object({
210
213
  method: literal("ui/notifications/sandbox-resource-ready"),
211
214
  params: object({
212
215
  html: string().describe("HTML content to load into the inner iframe."),
@@ -214,16 +217,16 @@ var S = object({
214
217
  csp: j.optional().describe("CSP configuration from resource metadata."),
215
218
  permissions: E.optional().describe("Sandbox permissions from resource metadata.")
216
219
  })
217
- }), g = object({
220
+ }), q = object({
218
221
  method: literal("ui/notifications/tool-result"),
219
222
  params: CallToolResultSchema.describe("Standard MCP tool execution result.")
220
- }), q = object({
223
+ }), y = object({
221
224
  toolInfo: object({
222
225
  id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."),
223
226
  tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.")
224
227
  }).optional().describe("Metadata of the tool call that instantiated this App."),
225
- theme: m.optional().describe("Current color theme preference."),
226
- styles: c.optional().describe("Style configuration for theming the app."),
228
+ theme: p.optional().describe("Current color theme preference."),
229
+ styles: n.optional().describe("Style configuration for theming the app."),
227
230
  displayMode: D.optional().describe("How the UI is currently displayed."),
228
231
  availableDisplayModes: array(D).optional().describe("Display modes the host supports."),
229
232
  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
@@ -248,25 +251,25 @@ container holding the app. Specify either width or maxWidth, and either height o
248
251
  }).optional().describe("Mobile safe area boundaries in pixels.")
249
252
  }).passthrough(), k = object({
250
253
  method: literal("ui/notifications/host-context-changed"),
251
- params: q.describe("Partial context update containing only changed fields.")
252
- }), y = object({
254
+ params: y.describe("Partial context update containing only changed fields.")
255
+ }), f = object({
253
256
  method: literal("ui/update-model-context"),
254
257
  params: object({
255
258
  content: array(ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."),
256
259
  structuredContent: record(string(), unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")
257
260
  })
258
- }), f = object({
261
+ }), d = object({
259
262
  method: literal("ui/initialize"),
260
263
  params: object({
261
264
  appInfo: ImplementationSchema.describe("App identification (name and version)."),
262
- appCapabilities: i.describe("Features and capabilities this app provides."),
265
+ appCapabilities: l.describe("Features and capabilities this app provides."),
263
266
  protocolVersion: string().describe("Protocol version this app supports.")
264
267
  })
265
- }), d = object({
268
+ }), b = object({
266
269
  protocolVersion: string().describe("Negotiated protocol version string (e.g., \"2025-11-21\")."),
267
270
  hostInfo: ImplementationSchema.describe("Host application identification and version."),
268
- hostCapabilities: n.describe("Features and capabilities provided by the host."),
269
- hostContext: q.describe("Rich context about the host environment.")
271
+ hostCapabilities: i.describe("Features and capabilities provided by the host."),
272
+ hostContext: y.describe("Rich context about the host environment.")
270
273
  }).passthrough();
271
274
  var N = class {
272
275
  eventTarget;
@@ -302,26 +305,26 @@ var N = class {
302
305
  sessionId;
303
306
  setProtocolVersion;
304
307
  };
305
- var b = "ui/resourceUri", SQ = "text/html;profile=mcp-app";
306
- function hY(X) {
308
+ var x = "ui/resourceUri", SQ = "text/html;profile=mcp-app";
309
+ function nY(X) {
307
310
  let Z = X._meta?.ui?.resourceUri;
308
- if (Z === void 0) Z = X._meta?.[b];
311
+ if (Z === void 0) Z = X._meta?.[x];
309
312
  if (typeof Z === "string" && Z.startsWith("ui://")) return Z;
310
313
  else if (Z !== void 0) throw Error(`Invalid UI resource URI: ${JSON.stringify(Z)}`);
311
314
  }
312
- function mY(X) {
315
+ function iY(X) {
313
316
  let Z = X._meta?.ui?.visibility;
314
317
  if (!Z) return !1;
315
318
  if (Z.length === 1 && Z[0] === "model") return !0;
316
319
  return !1;
317
320
  }
318
- function pY(X) {
321
+ function lY(X) {
319
322
  let Z = X._meta?.ui?.visibility;
320
323
  if (!Z) return !1;
321
324
  if (Z.length === 1 && Z[0] === "app") return !0;
322
325
  return !1;
323
326
  }
324
- function cY(X) {
327
+ function rY(X) {
325
328
  if (!X) return "";
326
329
  let Y = [];
327
330
  if (X.camera) Y.push("camera");
@@ -330,8 +333,8 @@ function cY(X) {
330
333
  if (X.clipboardWrite) Y.push("clipboard-write");
331
334
  return Y.join("; ");
332
335
  }
333
- var rQ = [G];
334
- var oQ = class extends Protocol {
336
+ var aQ = [G];
337
+ var tQ = class extends Protocol {
335
338
  _client;
336
339
  _hostInfo;
337
340
  _capabilities;
@@ -343,7 +346,7 @@ var oQ = class extends Protocol {
343
346
  this._client = X;
344
347
  this._hostInfo = Y;
345
348
  this._capabilities = Z;
346
- this._hostContext = $?.hostContext || {}, this.setRequestHandler(f, (K) => this._oninitialize(K)), this.setRequestHandler(PingRequestSchema, (K, J) => {
349
+ this._hostContext = $?.hostContext || {}, this.setRequestHandler(d, (K) => this._oninitialize(K)), this.setRequestHandler(PingRequestSchema, (K, J) => {
347
350
  return this.onping?.(K.params, J), {};
348
351
  }), this.setRequestHandler(W, (K) => {
349
352
  return { mode: this._hostContext.displayMode ?? "inline" };
@@ -360,13 +363,13 @@ var oQ = class extends Protocol {
360
363
  this.setNotificationHandler(P, (Y) => X(Y.params));
361
364
  }
362
365
  set onsandboxready(X) {
363
- this.setNotificationHandler(F, (Y) => X(Y.params));
366
+ this.setNotificationHandler(L, (Y) => X(Y.params));
364
367
  }
365
368
  set oninitialized(X) {
366
- this.setNotificationHandler(M, (Y) => X(Y.params));
369
+ this.setNotificationHandler(v, (Y) => X(Y.params));
367
370
  }
368
371
  set onmessage(X) {
369
- this.setRequestHandler(C, async (Y, Z) => {
372
+ this.setRequestHandler(S, async (Y, Z) => {
370
373
  return X(Y.params, Z);
371
374
  });
372
375
  }
@@ -376,10 +379,13 @@ var oQ = class extends Protocol {
376
379
  });
377
380
  }
378
381
  set ondownloadfile(X) {
379
- this.setRequestHandler(S, async (Y, Z) => {
382
+ this.setRequestHandler(C, async (Y, Z) => {
380
383
  return X(Y.params, Z);
381
384
  });
382
385
  }
386
+ set onrequestteardown(X) {
387
+ this.setNotificationHandler(M, (Y) => X(Y.params));
388
+ }
383
389
  set onrequestdisplaymode(X) {
384
390
  this.setRequestHandler(W, async (Y, Z) => {
385
391
  return X(Y.params, Z);
@@ -391,7 +397,7 @@ var oQ = class extends Protocol {
391
397
  });
392
398
  }
393
399
  set onupdatemodelcontext(X) {
394
- this.setRequestHandler(y, async (Y, Z) => {
400
+ this.setRequestHandler(f, async (Y, Z) => {
395
401
  return X(Y.params, Z);
396
402
  });
397
403
  }
@@ -453,7 +459,7 @@ var oQ = class extends Protocol {
453
459
  async _oninitialize(X) {
454
460
  let Y = X.params.protocolVersion;
455
461
  return this._appCapabilities = X.params.appCapabilities, this._appInfo = X.params.appInfo, {
456
- protocolVersion: rQ.includes(Y) ? Y : G,
462
+ protocolVersion: aQ.includes(Y) ? Y : G,
457
463
  hostCapabilities: this.getCapabilities(),
458
464
  hostInfo: this._hostInfo,
459
465
  hostContext: this._hostContext
@@ -463,7 +469,7 @@ var oQ = class extends Protocol {
463
469
  let Y = {}, Z = !1;
464
470
  for (let $ of Object.keys(X)) {
465
471
  let K = this._hostContext[$], J = X[$];
466
- if (aQ(K, J)) continue;
472
+ if (sQ(K, J)) continue;
467
473
  Y[$] = J, Z = !0;
468
474
  }
469
475
  if (Z) this._hostContext = X, this.sendHostContextChange(Y);
@@ -508,7 +514,7 @@ var oQ = class extends Protocol {
508
514
  return this.request({
509
515
  method: "ui/resource-teardown",
510
516
  params: X
511
- }, R, Y);
517
+ }, H, Y);
512
518
  }
513
519
  sendResourceTeardown = this.teardownResource;
514
520
  async connect(X) {
@@ -554,10 +560,10 @@ var oQ = class extends Protocol {
554
560
  return super.connect(X);
555
561
  }
556
562
  };
557
- function aQ(X, Y) {
563
+ function sQ(X, Y) {
558
564
  return JSON.stringify(X) === JSON.stringify(Y);
559
565
  }
560
566
  //#endregion
561
- export { oQ as AppBridge, s as DOWNLOAD_FILE_METHOD, KQ as HOST_CONTEXT_CHANGED_METHOD, NQ as INITIALIZED_METHOD, DQ as INITIALIZE_METHOD, G as LATEST_PROTOCOL_VERSION, e as MESSAGE_METHOD, i as McpUiAppCapabilitiesSchema, D as McpUiDisplayModeSchema, S as McpUiDownloadFileRequestSchema, A as McpUiDownloadFileResultSchema, n as McpUiHostCapabilitiesSchema, k as McpUiHostContextChangedNotificationSchema, q as McpUiHostContextSchema, p as McpUiHostCssSchema, c as McpUiHostStylesSchema, f as McpUiInitializeRequestSchema, d as McpUiInitializeResultSchema, M as McpUiInitializedNotificationSchema, C as McpUiMessageRequestSchema, L as McpUiMessageResultSchema, V as McpUiOpenLinkRequestSchema, I as McpUiOpenLinkResultSchema, W as McpUiRequestDisplayModeRequestSchema, v as McpUiRequestDisplayModeResultSchema, j as McpUiResourceCspSchema, IQ as McpUiResourceMetaSchema, E as McpUiResourcePermissionsSchema, H as McpUiResourceTeardownRequestSchema, R as McpUiResourceTeardownResultSchema, F as McpUiSandboxProxyReadyNotificationSchema, LQ as McpUiSandboxResourceReadyNotificationSchema, P as McpUiSizeChangedNotificationSchema, O as McpUiSupportedContentBlockModalitiesSchema, m as McpUiThemeSchema, U as McpUiToolCancelledNotificationSchema, T as McpUiToolInputNotificationSchema, w as McpUiToolInputPartialNotificationSchema, AQ as McpUiToolMetaSchema, g as McpUiToolResultNotificationSchema, l as McpUiToolVisibilitySchema, y as McpUiUpdateModelContextRequestSchema, t as OPEN_LINK_METHOD, N as PostMessageTransport, jQ as REQUEST_DISPLAY_MODE_METHOD, SQ as RESOURCE_MIME_TYPE, GQ as RESOURCE_TEARDOWN_METHOD, b as RESOURCE_URI_META_KEY, QQ as SANDBOX_PROXY_READY_METHOD, XQ as SANDBOX_RESOURCE_READY_METHOD, YQ as SIZE_CHANGED_METHOD, rQ as SUPPORTED_PROTOCOL_VERSIONS, JQ as TOOL_CANCELLED_METHOD, ZQ as TOOL_INPUT_METHOD, _ as TOOL_INPUT_PARTIAL_METHOD, $Q as TOOL_RESULT_METHOD, cY as buildAllowAttribute, hY as getToolUiResourceUri, pY as isToolVisibilityAppOnly, mY as isToolVisibilityModelOnly };
567
+ export { tQ as AppBridge, e as DOWNLOAD_FILE_METHOD, GQ as HOST_CONTEXT_CHANGED_METHOD, EQ as INITIALIZED_METHOD, jQ as INITIALIZE_METHOD, G as LATEST_PROTOCOL_VERSION, QQ as MESSAGE_METHOD, l as McpUiAppCapabilitiesSchema, D as McpUiDisplayModeSchema, C as McpUiDownloadFileRequestSchema, A as McpUiDownloadFileResultSchema, i as McpUiHostCapabilitiesSchema, k as McpUiHostContextChangedNotificationSchema, y as McpUiHostContextSchema, c as McpUiHostCssSchema, n as McpUiHostStylesSchema, d as McpUiInitializeRequestSchema, b as McpUiInitializeResultSchema, v as McpUiInitializedNotificationSchema, S as McpUiMessageRequestSchema, F as McpUiMessageResultSchema, V as McpUiOpenLinkRequestSchema, I as McpUiOpenLinkResultSchema, W as McpUiRequestDisplayModeRequestSchema, g as McpUiRequestDisplayModeResultSchema, M as McpUiRequestTeardownNotificationSchema, j as McpUiResourceCspSchema, FQ as McpUiResourceMetaSchema, E as McpUiResourcePermissionsSchema, U as McpUiResourceTeardownRequestSchema, H as McpUiResourceTeardownResultSchema, L as McpUiSandboxProxyReadyNotificationSchema, PQ as McpUiSandboxResourceReadyNotificationSchema, P as McpUiSizeChangedNotificationSchema, O as McpUiSupportedContentBlockModalitiesSchema, p as McpUiThemeSchema, R as McpUiToolCancelledNotificationSchema, T as McpUiToolInputNotificationSchema, w as McpUiToolInputPartialNotificationSchema, LQ as McpUiToolMetaSchema, q as McpUiToolResultNotificationSchema, r as McpUiToolVisibilitySchema, f as McpUiUpdateModelContextRequestSchema, s as OPEN_LINK_METHOD, N as PostMessageTransport, WQ as REQUEST_DISPLAY_MODE_METHOD, DQ as REQUEST_TEARDOWN_METHOD, SQ as RESOURCE_MIME_TYPE, NQ as RESOURCE_TEARDOWN_METHOD, x as RESOURCE_URI_META_KEY, XQ as SANDBOX_PROXY_READY_METHOD, YQ as SANDBOX_RESOURCE_READY_METHOD, ZQ as SIZE_CHANGED_METHOD, aQ as SUPPORTED_PROTOCOL_VERSIONS, KQ as TOOL_CANCELLED_METHOD, $Q as TOOL_INPUT_METHOD, _ as TOOL_INPUT_PARTIAL_METHOD, JQ as TOOL_RESULT_METHOD, rY as buildAllowAttribute, nY as getToolUiResourceUri, lY as isToolVisibilityAppOnly, iY as isToolVisibilityModelOnly };
562
568
 
563
569
  //# sourceMappingURL=@modelcontextprotocol_ext-apps_app-bridge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"@modelcontextprotocol_ext-apps_app-bridge.js","names":["Q.union","Q.literal","Q.record","Q.string","Q.undefined","Q.object","Q.boolean","Q.array","Q.number","Q.unknown","WQ","BQ","u","EQ","zQ","_Q","h","FQ","lQ","hQ","uQ","gQ","fQ","bQ","pQ","kQ","qQ","iQ","dQ","xQ","cQ","nQ","yQ","mQ"],"sources":["../../../../../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.2.2_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__react-_e9bf7657371391a829fe8b4e289b253c/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js"],"sourcesContent":["import{CallToolRequestSchema as gQ,CallToolResultSchema as qQ,ListPromptsRequestSchema as kQ,ListPromptsResultSchema as yQ,ListResourcesRequestSchema as fQ,ListResourcesResultSchema as dQ,ListResourceTemplatesRequestSchema as bQ,ListResourceTemplatesResultSchema as xQ,LoggingMessageNotificationSchema as uQ,PingRequestSchema as hQ,PromptListChangedNotificationSchema as mQ,ReadResourceRequestSchema as pQ,ReadResourceResultSchema as cQ,ResourceListChangedNotificationSchema as nQ,ToolListChangedNotificationSchema as iQ}from\"@modelcontextprotocol/sdk/types.js\";import{Protocol as lQ}from\"@modelcontextprotocol/sdk/shared/protocol.js\";var G=\"2026-01-26\",t=\"ui/open-link\",s=\"ui/download-file\",e=\"ui/message\",QQ=\"ui/notifications/sandbox-proxy-ready\",XQ=\"ui/notifications/sandbox-resource-ready\",YQ=\"ui/notifications/size-changed\",ZQ=\"ui/notifications/tool-input\",_=\"ui/notifications/tool-input-partial\",$Q=\"ui/notifications/tool-result\",JQ=\"ui/notifications/tool-cancelled\",KQ=\"ui/notifications/host-context-changed\",GQ=\"ui/resource-teardown\",DQ=\"ui/initialize\",NQ=\"ui/notifications/initialized\",jQ=\"ui/request-display-mode\";import{z as Q}from\"zod/v4\";import{ContentBlockSchema as u,CallToolResultSchema as EQ,EmbeddedResourceSchema as WQ,ImplementationSchema as h,RequestIdSchema as zQ,ResourceLinkSchema as BQ,ToolSchema as _Q}from\"@modelcontextprotocol/sdk/types.js\";var m=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.\"),OQ=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.\"),VQ=Q.record(OQ.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.`),V=Q.object({method:Q.literal(\"ui/open-link\"),params:Q.object({url:Q.string().describe(\"URL to open in the host's browser\")})}),I=Q.object({isError:Q.boolean().optional().describe(\"True if the host failed to open the URL (e.g., due to security policy).\")}).passthrough(),A=Q.object({isError:Q.boolean().optional().describe(\"True if the download failed (e.g., user cancelled or host denied).\")}).passthrough(),L=Q.object({isError:Q.boolean().optional().describe(\"True if the host rejected or failed to deliver the message.\")}).passthrough(),F=Q.object({method:Q.literal(\"ui/notifications/sandbox-proxy-ready\"),params:Q.object({})}),j=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'`)\")}),E=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.\")}),P=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.\")})}),T=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).\")})}),U=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\").')})}),p=Q.object({fonts:Q.string().optional()}),c=Q.object({variables:VQ.optional().describe(\"CSS variables for theming the app.\"),css:p.optional().describe(\"CSS blocks that apps can inject.\")}),H=Q.object({method:Q.literal(\"ui/resource-teardown\"),params:Q.object({})}),R=Q.record(Q.string(),Q.unknown()),O=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.\")}),n=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:E.optional().describe(\"Permissions granted by the host (camera, microphone, geolocation).\"),csp:j.optional().describe(\"CSP domains approved by the host.\")}).optional().describe(\"Sandbox configuration applied by the host.\"),updateModelContext:O.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:O.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\")}),i=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.\")}),M=Q.object({method:Q.literal(\"ui/notifications/initialized\"),params:Q.object({}).optional()}),IQ=Q.object({csp:j.optional().describe(\"Content Security Policy configuration for UI resources.\"),permissions:E.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`)}),W=Q.object({method:Q.literal(\"ui/request-display-mode\"),params:Q.object({mode:D.describe(\"The display mode being requested.\")})}),v=Q.object({mode:D.describe(\"The display mode that was actually set. May differ from requested if not supported.\")}).passthrough(),l=Q.union([Q.literal(\"model\"),Q.literal(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\"),AQ=Q.object({resourceUri:Q.string().optional(),visibility:Q.array(l).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`)}),QX=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.')}),S=Q.object({method:Q.literal(\"ui/download-file\"),params:Q.object({contents:Q.array(Q.union([WQ,BQ])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})}),C=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(u).describe(\"Message content blocks (text, image, etc.).\")})}),LQ=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:j.optional().describe(\"CSP configuration from resource metadata.\"),permissions:E.optional().describe(\"Sandbox permissions from resource metadata.\")})}),g=Q.object({method:Q.literal(\"ui/notifications/tool-result\"),params:EQ.describe(\"Standard MCP tool execution result.\")}),q=Q.object({toolInfo:Q.object({id:zQ.optional().describe(\"JSON-RPC id of the tools/call request.\"),tool:_Q.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:m.optional().describe(\"Current color theme preference.\"),styles:c.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(),k=Q.object({method:Q.literal(\"ui/notifications/host-context-changed\"),params:q.describe(\"Partial context update containing only changed fields.\")}),y=Q.object({method:Q.literal(\"ui/update-model-context\"),params:Q.object({content:Q.array(u).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.\")})}),f=Q.object({method:Q.literal(\"ui/initialize\"),params:Q.object({appInfo:h.describe(\"App identification (name and version).\"),appCapabilities:i.describe(\"Features and capabilities this app provides.\"),protocolVersion:Q.string().describe(\"Protocol version this app supports.\")})}),d=Q.object({protocolVersion:Q.string().describe('Negotiated protocol version string (e.g., \"2025-11-21\").'),hostInfo:h.describe(\"Host application identification and version.\"),hostCapabilities:n.describe(\"Features and capabilities provided by the host.\"),hostContext:q.describe(\"Rich context about the host environment.\")}).passthrough();import{Protocol as PQ}from\"@modelcontextprotocol/sdk/shared/protocol.js\";import{CallToolRequestSchema as TQ,CallToolResultSchema as wQ,EmptyResultSchema as UQ,ListResourcesResultSchema as HQ,ListToolsRequestSchema as RQ,PingRequestSchema as MQ,ReadResourceResultSchema as vQ}from\"@modelcontextprotocol/sdk/types.js\";import{JSONRPCMessageSchema as FQ}from\"@modelcontextprotocol/sdk/types.js\";class N{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 $=FQ.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!==_)console.debug(\"Sending message\",X);this.eventTarget.postMessage(X,\"*\")}async close(){window.removeEventListener(\"message\",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var b=\"ui/resourceUri\",SQ=\"text/html;profile=mcp-app\";class CQ extends PQ{_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(MQ,($)=>{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(T,(Y)=>X(Y.params))}set ontoolinputpartial(X){this.setNotificationHandler(w,(Y)=>X(Y.params))}set ontoolresult(X){this.setNotificationHandler(g,(Y)=>X(Y.params))}set ontoolcancelled(X){this.setNotificationHandler(U,(Y)=>X(Y.params))}set onhostcontextchanged(X){this.setNotificationHandler(k,(Y)=>{this._hostContext={...this._hostContext,...Y.params},X(Y.params)})}set onteardown(X){this.setRequestHandler(H,(Y,Z)=>X(Y.params,Z))}set oncalltool(X){this.setRequestHandler(TQ,(Y,Z)=>X(Y.params,Z))}set onlisttools(X){this.setRequestHandler(RQ,(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},wQ,Y)}async readServerResource(X,Y){return await this.request({method:\"resources/read\",params:X},vQ,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},L,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},I,Y)}sendOpenLink=this.openLink;downloadFile(X,Y){return this.request({method:\"ui/download-file\",params:X},A,Y)}requestDisplayMode(X,Y){return this.request({method:\"ui/request-display-mode\",params:X},v,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,r=J.style.width,o=J.style.height;J.style.width=\"fit-content\",J.style.height=\"max-content\";let x=J.getBoundingClientRect();J.style.width=r,J.style.height=o;let a=window.innerWidth-J.clientWidth,z=Math.ceil(x.width+a),B=Math.ceil(x.height);if(z!==Y||B!==Z)Y=z,Z=B,this.sendSizeChanged({width:z,height:B})})};$();let K=new ResizeObserver($);return K.observe(document.documentElement),K.observe(document.body),()=>K.disconnect()}async connect(X=new N(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:G}},d,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}}}function hY(X){let Z=X._meta?.ui?.resourceUri;if(Z===void 0)Z=X._meta?.[b];if(typeof Z===\"string\"&&Z.startsWith(\"ui://\"))return Z;else if(Z!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(Z)}`);return}function mY(X){let Z=X._meta?.ui?.visibility;if(!Z)return!1;if(Z.length===1&&Z[0]===\"model\")return!0;return!1}function pY(X){let Z=X._meta?.ui?.visibility;if(!Z)return!1;if(Z.length===1&&Z[0]===\"app\")return!0;return!1}function cY(X){if(!X)return\"\";let Y=[];if(X.camera)Y.push(\"camera\");if(X.microphone)Y.push(\"microphone\");if(X.geolocation)Y.push(\"geolocation\");if(X.clipboardWrite)Y.push(\"clipboard-write\");return Y.join(\"; \")}var rQ=[G];class oQ extends lQ{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;constructor(X,Y,Z,$){super($);this._client=X;this._hostInfo=Y;this._capabilities=Z;this._hostContext=$?.hostContext||{},this.setRequestHandler(f,(K)=>this._oninitialize(K)),this.setRequestHandler(hQ,(K,J)=>{return this.onping?.(K.params,J),{}}),this.setRequestHandler(W,(K)=>{return{mode:this._hostContext.displayMode??\"inline\"}})}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;set onsizechange(X){this.setNotificationHandler(P,(Y)=>X(Y.params))}set onsandboxready(X){this.setNotificationHandler(F,(Y)=>X(Y.params))}set oninitialized(X){this.setNotificationHandler(M,(Y)=>X(Y.params))}set onmessage(X){this.setRequestHandler(C,async(Y,Z)=>{return X(Y.params,Z)})}set onopenlink(X){this.setRequestHandler(V,async(Y,Z)=>{return X(Y.params,Z)})}set ondownloadfile(X){this.setRequestHandler(S,async(Y,Z)=>{return X(Y.params,Z)})}set onrequestdisplaymode(X){this.setRequestHandler(W,async(Y,Z)=>{return X(Y.params,Z)})}set onloggingmessage(X){this.setNotificationHandler(uQ,async(Y)=>{X(Y.params)})}set onupdatemodelcontext(X){this.setRequestHandler(y,async(Y,Z)=>{return X(Y.params,Z)})}set oncalltool(X){this.setRequestHandler(gQ,async(Y,Z)=>{return X(Y.params,Z)})}sendToolListChanged(X={}){return this.notification({method:\"notifications/tools/list_changed\",params:X})}set onlistresources(X){this.setRequestHandler(fQ,async(Y,Z)=>{return X(Y.params,Z)})}set onlistresourcetemplates(X){this.setRequestHandler(bQ,async(Y,Z)=>{return X(Y.params,Z)})}set onreadresource(X){this.setRequestHandler(pQ,async(Y,Z)=>{return X(Y.params,Z)})}sendResourceListChanged(X={}){return this.notification({method:\"notifications/resources/list_changed\",params:X})}set onlistprompts(X){this.setRequestHandler(kQ,async(Y,Z)=>{return X(Y.params,Z)})}sendPromptListChanged(X={}){return this.notification({method:\"notifications/prompts/list_changed\",params:X})}assertCapabilityForMethod(X){}assertRequestHandlerCapability(X){}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\")}getCapabilities(){return this._capabilities}async _oninitialize(X){let Y=X.params.protocolVersion;return this._appCapabilities=X.params.appCapabilities,this._appInfo=X.params.appInfo,{protocolVersion:rQ.includes(Y)?Y:G,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(X){let Y={},Z=!1;for(let $ of Object.keys(X)){let K=this._hostContext[$],J=X[$];if(aQ(K,J))continue;Y[$]=J,Z=!0}if(Z)this._hostContext=X,this.sendHostContextChange(Y)}sendHostContextChange(X){return this.notification({method:\"ui/notifications/host-context-changed\",params:X})}sendToolInput(X){return this.notification({method:\"ui/notifications/tool-input\",params:X})}sendToolInputPartial(X){return this.notification({method:\"ui/notifications/tool-input-partial\",params:X})}sendToolResult(X){return this.notification({method:\"ui/notifications/tool-result\",params:X})}sendToolCancelled(X){return this.notification({method:\"ui/notifications/tool-cancelled\",params:X})}sendSandboxResourceReady(X){return this.notification({method:\"ui/notifications/sandbox-resource-ready\",params:X})}teardownResource(X,Y){return this.request({method:\"ui/resource-teardown\",params:X},R,Y)}sendResourceTeardown=this.teardownResource;async connect(X){if(this.transport)throw Error(\"AppBridge is already connected. Call close() before connecting again.\");if(this._client){let Y=this._client.getServerCapabilities();if(!Y)throw Error(\"Client server capabilities not available\");if(Y.tools){if(this.oncalltool=async(Z,$)=>{return this._client.request({method:\"tools/call\",params:Z},qQ,{signal:$.signal})},Y.tools.listChanged)this._client.setNotificationHandler(iQ,(Z)=>this.sendToolListChanged(Z.params))}if(Y.resources){if(this.onlistresources=async(Z,$)=>{return this._client.request({method:\"resources/list\",params:Z},dQ,{signal:$.signal})},this.onlistresourcetemplates=async(Z,$)=>{return this._client.request({method:\"resources/templates/list\",params:Z},xQ,{signal:$.signal})},this.onreadresource=async(Z,$)=>{return this._client.request({method:\"resources/read\",params:Z},cQ,{signal:$.signal})},Y.resources.listChanged)this._client.setNotificationHandler(nQ,(Z)=>this.sendResourceListChanged(Z.params))}if(Y.prompts){if(this.onlistprompts=async(Z,$)=>{return this._client.request({method:\"prompts/list\",params:Z},yQ,{signal:$.signal})},Y.prompts.listChanged)this._client.setNotificationHandler(mQ,(Z)=>this.sendPromptListChanged(Z.params))}}return super.connect(X)}}function aQ(X,Y){return JSON.stringify(X)===JSON.stringify(Y)}export{mY as isToolVisibilityModelOnly,pY as isToolVisibilityAppOnly,hY as getToolUiResourceUri,cY as buildAllowAttribute,$Q as TOOL_RESULT_METHOD,_ as TOOL_INPUT_PARTIAL_METHOD,ZQ as TOOL_INPUT_METHOD,JQ as TOOL_CANCELLED_METHOD,rQ as SUPPORTED_PROTOCOL_VERSIONS,YQ as SIZE_CHANGED_METHOD,XQ as SANDBOX_RESOURCE_READY_METHOD,QQ as SANDBOX_PROXY_READY_METHOD,b as RESOURCE_URI_META_KEY,GQ as RESOURCE_TEARDOWN_METHOD,SQ as RESOURCE_MIME_TYPE,jQ as REQUEST_DISPLAY_MODE_METHOD,N as PostMessageTransport,t as OPEN_LINK_METHOD,y as McpUiUpdateModelContextRequestSchema,l as McpUiToolVisibilitySchema,g as McpUiToolResultNotificationSchema,AQ as McpUiToolMetaSchema,w as McpUiToolInputPartialNotificationSchema,T as McpUiToolInputNotificationSchema,U as McpUiToolCancelledNotificationSchema,m as McpUiThemeSchema,O as McpUiSupportedContentBlockModalitiesSchema,P as McpUiSizeChangedNotificationSchema,LQ as McpUiSandboxResourceReadyNotificationSchema,F as McpUiSandboxProxyReadyNotificationSchema,R as McpUiResourceTeardownResultSchema,H as McpUiResourceTeardownRequestSchema,E as McpUiResourcePermissionsSchema,IQ as McpUiResourceMetaSchema,j as McpUiResourceCspSchema,v as McpUiRequestDisplayModeResultSchema,W as McpUiRequestDisplayModeRequestSchema,I as McpUiOpenLinkResultSchema,V as McpUiOpenLinkRequestSchema,L as McpUiMessageResultSchema,C as McpUiMessageRequestSchema,M as McpUiInitializedNotificationSchema,d as McpUiInitializeResultSchema,f as McpUiInitializeRequestSchema,c as McpUiHostStylesSchema,p as McpUiHostCssSchema,q as McpUiHostContextSchema,k as McpUiHostContextChangedNotificationSchema,n as McpUiHostCapabilitiesSchema,A as McpUiDownloadFileResultSchema,S as McpUiDownloadFileRequestSchema,D as McpUiDisplayModeSchema,i as McpUiAppCapabilitiesSchema,e as MESSAGE_METHOD,G as LATEST_PROTOCOL_VERSION,DQ as INITIALIZE_METHOD,NQ as INITIALIZED_METHOD,KQ as HOST_CONTEXT_CHANGED_METHOD,s as DOWNLOAD_FILE_METHOD,oQ as AppBridge};\n"],"x_google_ignoreList":[0],"mappings":";;;AAA2nB,IAAI,IAAE,cAAa,IAAE,gBAAe,IAAE,oBAAmB,IAAE,cAAa,KAAG,wCAAuC,KAAG,2CAA0C,KAAG,iCAAgC,KAAG,+BAA8B,IAAE,uCAAsC,KAAG,gCAA+B,KAAG,mCAAkC,KAAG,yCAAwC,KAAG,wBAAuB,KAAG,iBAAgB,KAAG,gCAA+B,KAAG;AAA+Q,IAAI,IAAEA,MAAQ,CAACC,QAAU,QAAQ,EAACA,QAAU,OAAO,CAAC,CAAC,CAAC,SAAS,mDAAmD,EAAC,IAAED,MAAQ;CAACC,QAAU,SAAS;CAACA,QAAU,aAAa;CAACA,QAAU,MAAM;CAAC,CAAC,CAAC,SAAS,oCAAoC,EAA6tF,KAAGC,OAA5tFF,MAAQ;CAACC,QAAU,6BAA6B;CAACA,QAAU,+BAA+B;CAACA,QAAU,8BAA8B;CAACA,QAAU,6BAA6B;CAACA,QAAU,2BAA2B;CAACA,QAAU,0BAA0B;CAACA,QAAU,4BAA4B;CAACA,QAAU,6BAA6B;CAACA,QAAU,6BAA6B;CAACA,QAAU,8BAA8B;CAACA,QAAU,uBAAuB;CAACA,QAAU,yBAAyB;CAACA,QAAU,wBAAwB;CAACA,QAAU,uBAAuB;CAACA,QAAU,qBAAqB;CAACA,QAAU,oBAAoB;CAACA,QAAU,sBAAsB;CAACA,QAAU,uBAAuB;CAACA,QAAU,uBAAuB;CAACA,QAAU,wBAAwB;CAACA,QAAU,yBAAyB;CAACA,QAAU,2BAA2B;CA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;MAAC,QAAO;MAA2B,QAAO;MAAE,EAACC,mCAAG,EAAC,QAAO,EAAE,QAAO,CAAC;OAAE,KAAK,iBAAe,OAAM,GAAE,MAAI;AAAC,YAAO,KAAK,QAAQ,QAAQ;MAAC,QAAO;MAAiB,QAAO;MAAE,EAACC,0BAAG,EAAC,QAAO,EAAE,QAAO,CAAC;OAAE,EAAE,UAAU,YAAY,MAAK,QAAQ,uBAAuBC,wCAAI,MAAI,KAAK,wBAAwB,EAAE,OAAO,CAAC;;AAAC,OAAG,EAAE;QAAY,KAAK,gBAAc,OAAM,GAAE,MAAI;AAAC,YAAO,KAAK,QAAQ,QAAQ;MAAC,QAAO;MAAe,QAAO;MAAE,EAACC,yBAAG,EAAC,QAAO,EAAE,QAAO,CAAC;OAAE,EAAE,QAAQ,YAAY,MAAK,QAAQ,uBAAuBC,sCAAI,MAAI,KAAK,sBAAsB,EAAE,OAAO,CAAC;;;AAAE,SAAO,MAAM,QAAQ,EAAE;;;AAAE,SAAS,GAAG,GAAE,GAAE;AAAC,QAAO,KAAK,UAAU,EAAE,KAAG,KAAK,UAAU,EAAE"}
1
+ {"version":3,"file":"@modelcontextprotocol_ext-apps_app-bridge.js","names":["Q.union","Q.literal","Q.record","Q.string","Q.undefined","Q.object","Q.boolean","Q.array","Q.number","Q.unknown","BQ","OQ","h","zQ","_Q","VQ","m","TQ","oQ","pQ","mQ","yQ","bQ","uQ","nQ","fQ","kQ","rQ","xQ","hQ","iQ","lQ","dQ","cQ"],"sources":["../../../../../../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-bridge.js"],"sourcesContent":["import{CallToolRequestSchema as yQ,CallToolResultSchema as kQ,ListPromptsRequestSchema as fQ,ListPromptsResultSchema as dQ,ListResourcesRequestSchema as bQ,ListResourcesResultSchema as xQ,ListResourceTemplatesRequestSchema as uQ,ListResourceTemplatesResultSchema as hQ,LoggingMessageNotificationSchema as mQ,PingRequestSchema as pQ,PromptListChangedNotificationSchema as cQ,ReadResourceRequestSchema as nQ,ReadResourceResultSchema as iQ,ResourceListChangedNotificationSchema as lQ,ToolListChangedNotificationSchema as rQ}from\"@modelcontextprotocol/sdk/types.js\";import{Protocol as oQ}from\"@modelcontextprotocol/sdk/shared/protocol.js\";var G=\"2026-01-26\",s=\"ui/open-link\",e=\"ui/download-file\",QQ=\"ui/message\",XQ=\"ui/notifications/sandbox-proxy-ready\",YQ=\"ui/notifications/sandbox-resource-ready\",ZQ=\"ui/notifications/size-changed\",$Q=\"ui/notifications/tool-input\",_=\"ui/notifications/tool-input-partial\",JQ=\"ui/notifications/tool-result\",KQ=\"ui/notifications/tool-cancelled\",GQ=\"ui/notifications/host-context-changed\",DQ=\"ui/notifications/request-teardown\",NQ=\"ui/resource-teardown\",jQ=\"ui/initialize\",EQ=\"ui/notifications/initialized\",WQ=\"ui/request-display-mode\";import{z as Q}from\"zod/v4\";import{ContentBlockSchema as h,CallToolResultSchema as zQ,EmbeddedResourceSchema as BQ,ImplementationSchema as m,RequestIdSchema as _Q,ResourceLinkSchema as OQ,ToolSchema as VQ}from\"@modelcontextprotocol/sdk/types.js\";var p=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.\"),IQ=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.\"),AQ=Q.record(IQ.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.`),V=Q.object({method:Q.literal(\"ui/open-link\"),params:Q.object({url:Q.string().describe(\"URL to open in the host's browser\")})}),I=Q.object({isError:Q.boolean().optional().describe(\"True if the host failed to open the URL (e.g., due to security policy).\")}).passthrough(),A=Q.object({isError:Q.boolean().optional().describe(\"True if the download failed (e.g., user cancelled or host denied).\")}).passthrough(),F=Q.object({isError:Q.boolean().optional().describe(\"True if the host rejected or failed to deliver the message.\")}).passthrough(),L=Q.object({method:Q.literal(\"ui/notifications/sandbox-proxy-ready\"),params:Q.object({})}),j=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'`)\")}),E=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.\")}),P=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.\")})}),T=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).\")})}),R=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\").')})}),c=Q.object({fonts:Q.string().optional()}),n=Q.object({variables:AQ.optional().describe(\"CSS variables for theming the app.\"),css:c.optional().describe(\"CSS blocks that apps can inject.\")}),U=Q.object({method:Q.literal(\"ui/resource-teardown\"),params:Q.object({})}),H=Q.record(Q.string(),Q.unknown()),O=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.\")}),M=Q.object({method:Q.literal(\"ui/notifications/request-teardown\"),params:Q.object({}).optional()}),i=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:E.optional().describe(\"Permissions granted by the host (camera, microphone, geolocation).\"),csp:j.optional().describe(\"CSP domains approved by the host.\")}).optional().describe(\"Sandbox configuration applied by the host.\"),updateModelContext:O.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:O.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\")}),l=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.\")}),v=Q.object({method:Q.literal(\"ui/notifications/initialized\"),params:Q.object({}).optional()}),FQ=Q.object({csp:j.optional().describe(\"Content Security Policy configuration for UI resources.\"),permissions:E.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`)}),W=Q.object({method:Q.literal(\"ui/request-display-mode\"),params:Q.object({mode:D.describe(\"The display mode being requested.\")})}),g=Q.object({mode:D.describe(\"The display mode that was actually set. May differ from requested if not supported.\")}).passthrough(),r=Q.union([Q.literal(\"model\"),Q.literal(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\"),LQ=Q.object({resourceUri:Q.string().optional(),visibility:Q.array(r).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`)}),YX=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.')}),C=Q.object({method:Q.literal(\"ui/download-file\"),params:Q.object({contents:Q.array(Q.union([BQ,OQ])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})}),S=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.).\")})}),PQ=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:j.optional().describe(\"CSP configuration from resource metadata.\"),permissions:E.optional().describe(\"Sandbox permissions from resource metadata.\")})}),q=Q.object({method:Q.literal(\"ui/notifications/tool-result\"),params:zQ.describe(\"Standard MCP tool execution result.\")}),y=Q.object({toolInfo:Q.object({id:_Q.optional().describe(\"JSON-RPC id of the tools/call request.\"),tool:VQ.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:p.optional().describe(\"Current color theme preference.\"),styles:n.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(),k=Q.object({method:Q.literal(\"ui/notifications/host-context-changed\"),params:y.describe(\"Partial context update containing only changed fields.\")}),f=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.\")})}),d=Q.object({method:Q.literal(\"ui/initialize\"),params:Q.object({appInfo:m.describe(\"App identification (name and version).\"),appCapabilities:l.describe(\"Features and capabilities this app provides.\"),protocolVersion:Q.string().describe(\"Protocol version this app supports.\")})}),b=Q.object({protocolVersion:Q.string().describe('Negotiated protocol version string (e.g., \"2025-11-21\").'),hostInfo:m.describe(\"Host application identification and version.\"),hostCapabilities:i.describe(\"Features and capabilities provided by the host.\"),hostContext:y.describe(\"Rich context about the host environment.\")}).passthrough();import{Protocol as wQ}from\"@modelcontextprotocol/sdk/shared/protocol.js\";import{CallToolRequestSchema as RQ,CallToolResultSchema as UQ,EmptyResultSchema as HQ,ListResourcesResultSchema as MQ,ListToolsRequestSchema as vQ,PingRequestSchema as gQ,ReadResourceResultSchema as CQ}from\"@modelcontextprotocol/sdk/types.js\";import{JSONRPCMessageSchema as TQ}from\"@modelcontextprotocol/sdk/types.js\";class N{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 $=TQ.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!==_)console.debug(\"Sending message\",X);this.eventTarget.postMessage(X,\"*\")}async close(){window.removeEventListener(\"message\",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var x=\"ui/resourceUri\",SQ=\"text/html;profile=mcp-app\";class qQ extends wQ{_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(gQ,($)=>{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(T,(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(R,(Y)=>X(Y.params))}set onhostcontextchanged(X){this.setNotificationHandler(k,(Y)=>{this._hostContext={...this._hostContext,...Y.params},X(Y.params)})}set onteardown(X){this.setRequestHandler(U,(Y,Z)=>X(Y.params,Z))}set oncalltool(X){this.setRequestHandler(RQ,(Y,Z)=>X(Y.params,Z))}set onlisttools(X){this.setRequestHandler(vQ,(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},UQ,Y)}async readServerResource(X,Y){return await this.request({method:\"resources/read\",params:X},CQ,Y)}async listServerResources(X,Y){return await this.request({method:\"resources/list\",params:X},MQ,Y)}sendMessage(X,Y){return this.request({method:\"ui/message\",params:X},F,Y)}sendLog(X){return this.notification({method:\"notifications/message\",params:X})}updateModelContext(X,Y){return this.request({method:\"ui/update-model-context\",params:X},HQ,Y)}openLink(X,Y){return this.request({method:\"ui/open-link\",params:X},I,Y)}sendOpenLink=this.openLink;downloadFile(X,Y){return this.request({method:\"ui/download-file\",params:X},A,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},g,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,o=J.style.width,a=J.style.height;J.style.width=\"fit-content\",J.style.height=\"max-content\";let u=J.getBoundingClientRect();J.style.width=o,J.style.height=a;let t=window.innerWidth-J.clientWidth,z=Math.ceil(u.width+t),B=Math.ceil(u.height);if(z!==Y||B!==Z)Y=z,Z=B,this.sendSizeChanged({width:z,height:B})})};$();let K=new ResizeObserver($);return K.observe(document.documentElement),K.observe(document.body),()=>K.disconnect()}async connect(X=new N(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:G}},b,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}}}function nY(X){let Z=X._meta?.ui?.resourceUri;if(Z===void 0)Z=X._meta?.[x];if(typeof Z===\"string\"&&Z.startsWith(\"ui://\"))return Z;else if(Z!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(Z)}`);return}function iY(X){let Z=X._meta?.ui?.visibility;if(!Z)return!1;if(Z.length===1&&Z[0]===\"model\")return!0;return!1}function lY(X){let Z=X._meta?.ui?.visibility;if(!Z)return!1;if(Z.length===1&&Z[0]===\"app\")return!0;return!1}function rY(X){if(!X)return\"\";let Y=[];if(X.camera)Y.push(\"camera\");if(X.microphone)Y.push(\"microphone\");if(X.geolocation)Y.push(\"geolocation\");if(X.clipboardWrite)Y.push(\"clipboard-write\");return Y.join(\"; \")}var aQ=[G];class tQ extends oQ{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;constructor(X,Y,Z,$){super($);this._client=X;this._hostInfo=Y;this._capabilities=Z;this._hostContext=$?.hostContext||{},this.setRequestHandler(d,(K)=>this._oninitialize(K)),this.setRequestHandler(pQ,(K,J)=>{return this.onping?.(K.params,J),{}}),this.setRequestHandler(W,(K)=>{return{mode:this._hostContext.displayMode??\"inline\"}})}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;set onsizechange(X){this.setNotificationHandler(P,(Y)=>X(Y.params))}set onsandboxready(X){this.setNotificationHandler(L,(Y)=>X(Y.params))}set oninitialized(X){this.setNotificationHandler(v,(Y)=>X(Y.params))}set onmessage(X){this.setRequestHandler(S,async(Y,Z)=>{return X(Y.params,Z)})}set onopenlink(X){this.setRequestHandler(V,async(Y,Z)=>{return X(Y.params,Z)})}set ondownloadfile(X){this.setRequestHandler(C,async(Y,Z)=>{return X(Y.params,Z)})}set onrequestteardown(X){this.setNotificationHandler(M,(Y)=>X(Y.params))}set onrequestdisplaymode(X){this.setRequestHandler(W,async(Y,Z)=>{return X(Y.params,Z)})}set onloggingmessage(X){this.setNotificationHandler(mQ,async(Y)=>{X(Y.params)})}set onupdatemodelcontext(X){this.setRequestHandler(f,async(Y,Z)=>{return X(Y.params,Z)})}set oncalltool(X){this.setRequestHandler(yQ,async(Y,Z)=>{return X(Y.params,Z)})}sendToolListChanged(X={}){return this.notification({method:\"notifications/tools/list_changed\",params:X})}set onlistresources(X){this.setRequestHandler(bQ,async(Y,Z)=>{return X(Y.params,Z)})}set onlistresourcetemplates(X){this.setRequestHandler(uQ,async(Y,Z)=>{return X(Y.params,Z)})}set onreadresource(X){this.setRequestHandler(nQ,async(Y,Z)=>{return X(Y.params,Z)})}sendResourceListChanged(X={}){return this.notification({method:\"notifications/resources/list_changed\",params:X})}set onlistprompts(X){this.setRequestHandler(fQ,async(Y,Z)=>{return X(Y.params,Z)})}sendPromptListChanged(X={}){return this.notification({method:\"notifications/prompts/list_changed\",params:X})}assertCapabilityForMethod(X){}assertRequestHandlerCapability(X){}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\")}getCapabilities(){return this._capabilities}async _oninitialize(X){let Y=X.params.protocolVersion;return this._appCapabilities=X.params.appCapabilities,this._appInfo=X.params.appInfo,{protocolVersion:aQ.includes(Y)?Y:G,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(X){let Y={},Z=!1;for(let $ of Object.keys(X)){let K=this._hostContext[$],J=X[$];if(sQ(K,J))continue;Y[$]=J,Z=!0}if(Z)this._hostContext=X,this.sendHostContextChange(Y)}sendHostContextChange(X){return this.notification({method:\"ui/notifications/host-context-changed\",params:X})}sendToolInput(X){return this.notification({method:\"ui/notifications/tool-input\",params:X})}sendToolInputPartial(X){return this.notification({method:\"ui/notifications/tool-input-partial\",params:X})}sendToolResult(X){return this.notification({method:\"ui/notifications/tool-result\",params:X})}sendToolCancelled(X){return this.notification({method:\"ui/notifications/tool-cancelled\",params:X})}sendSandboxResourceReady(X){return this.notification({method:\"ui/notifications/sandbox-resource-ready\",params:X})}teardownResource(X,Y){return this.request({method:\"ui/resource-teardown\",params:X},H,Y)}sendResourceTeardown=this.teardownResource;async connect(X){if(this.transport)throw Error(\"AppBridge is already connected. Call close() before connecting again.\");if(this._client){let Y=this._client.getServerCapabilities();if(!Y)throw Error(\"Client server capabilities not available\");if(Y.tools){if(this.oncalltool=async(Z,$)=>{return this._client.request({method:\"tools/call\",params:Z},kQ,{signal:$.signal})},Y.tools.listChanged)this._client.setNotificationHandler(rQ,(Z)=>this.sendToolListChanged(Z.params))}if(Y.resources){if(this.onlistresources=async(Z,$)=>{return this._client.request({method:\"resources/list\",params:Z},xQ,{signal:$.signal})},this.onlistresourcetemplates=async(Z,$)=>{return this._client.request({method:\"resources/templates/list\",params:Z},hQ,{signal:$.signal})},this.onreadresource=async(Z,$)=>{return this._client.request({method:\"resources/read\",params:Z},iQ,{signal:$.signal})},Y.resources.listChanged)this._client.setNotificationHandler(lQ,(Z)=>this.sendResourceListChanged(Z.params))}if(Y.prompts){if(this.onlistprompts=async(Z,$)=>{return this._client.request({method:\"prompts/list\",params:Z},dQ,{signal:$.signal})},Y.prompts.listChanged)this._client.setNotificationHandler(cQ,(Z)=>this.sendPromptListChanged(Z.params))}}return super.connect(X)}}function sQ(X,Y){return JSON.stringify(X)===JSON.stringify(Y)}export{iY as isToolVisibilityModelOnly,lY as isToolVisibilityAppOnly,nY as getToolUiResourceUri,rY as buildAllowAttribute,JQ as TOOL_RESULT_METHOD,_ as TOOL_INPUT_PARTIAL_METHOD,$Q as TOOL_INPUT_METHOD,KQ as TOOL_CANCELLED_METHOD,aQ as SUPPORTED_PROTOCOL_VERSIONS,ZQ as SIZE_CHANGED_METHOD,YQ as SANDBOX_RESOURCE_READY_METHOD,XQ as SANDBOX_PROXY_READY_METHOD,x as RESOURCE_URI_META_KEY,NQ as RESOURCE_TEARDOWN_METHOD,SQ as RESOURCE_MIME_TYPE,DQ as REQUEST_TEARDOWN_METHOD,WQ as REQUEST_DISPLAY_MODE_METHOD,N as PostMessageTransport,s as OPEN_LINK_METHOD,f as McpUiUpdateModelContextRequestSchema,r as McpUiToolVisibilitySchema,q as McpUiToolResultNotificationSchema,LQ as McpUiToolMetaSchema,w as McpUiToolInputPartialNotificationSchema,T as McpUiToolInputNotificationSchema,R as McpUiToolCancelledNotificationSchema,p as McpUiThemeSchema,O as McpUiSupportedContentBlockModalitiesSchema,P as McpUiSizeChangedNotificationSchema,PQ as McpUiSandboxResourceReadyNotificationSchema,L as McpUiSandboxProxyReadyNotificationSchema,H as McpUiResourceTeardownResultSchema,U as McpUiResourceTeardownRequestSchema,E as McpUiResourcePermissionsSchema,FQ as McpUiResourceMetaSchema,j as McpUiResourceCspSchema,M as McpUiRequestTeardownNotificationSchema,g as McpUiRequestDisplayModeResultSchema,W as McpUiRequestDisplayModeRequestSchema,I as McpUiOpenLinkResultSchema,V as McpUiOpenLinkRequestSchema,F as McpUiMessageResultSchema,S as McpUiMessageRequestSchema,v as McpUiInitializedNotificationSchema,b as McpUiInitializeResultSchema,d as McpUiInitializeRequestSchema,n as McpUiHostStylesSchema,c as McpUiHostCssSchema,y as McpUiHostContextSchema,k as McpUiHostContextChangedNotificationSchema,i as McpUiHostCapabilitiesSchema,A as McpUiDownloadFileResultSchema,C as McpUiDownloadFileRequestSchema,D as McpUiDisplayModeSchema,l as McpUiAppCapabilitiesSchema,QQ as MESSAGE_METHOD,G as LATEST_PROTOCOL_VERSION,jQ as INITIALIZE_METHOD,EQ as INITIALIZED_METHOD,GQ as HOST_CONTEXT_CHANGED_METHOD,e as DOWNLOAD_FILE_METHOD,tQ as AppBridge};\n"],"x_google_ignoreList":[0],"mappings":";;;AAA2nB,IAAI,IAAE,cAAa,IAAE,gBAAe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