sunpeak 0.18.2 → 0.18.7
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.
- package/bin/commands/dev.mjs +6 -2
- package/bin/commands/inspect.mjs +405 -5
- package/bin/commands/new.mjs +5 -0
- package/bin/lib/dev-overlay.mjs +50 -0
- package/bin/lib/live/live-config.d.mts +3 -0
- package/bin/lib/live/live-config.mjs +3 -1
- package/bin/lib/sandbox-server.mjs +11 -1
- package/dist/chatgpt/index.cjs +2 -2
- package/dist/chatgpt/index.js +2 -2
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-request-teardown.d.ts +21 -0
- package/dist/host/chatgpt/index.cjs +1 -1
- package/dist/host/chatgpt/index.js +1 -1
- package/dist/index.cjs +110 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +68 -31
- package/dist/index.js.map +1 -1
- package/dist/inspector/hosts.d.ts +12 -0
- package/dist/inspector/index.cjs +2 -2
- package/dist/inspector/index.js +2 -2
- package/dist/inspector/inspector-url.d.ts +13 -0
- package/dist/inspector/mcp-app-host.d.ts +3 -0
- package/dist/inspector/simple-sidebar.d.ts +1 -1
- package/dist/inspector/use-inspector-state.d.ts +2 -0
- package/dist/inspector/use-mcp-connection.d.ts +9 -1
- package/dist/{inspector-CByJjmPD.cjs → inspector-CKc58UuI.cjs} +557 -136
- package/dist/inspector-CKc58UuI.cjs.map +1 -0
- package/dist/{inspector-ClhpqKLi.js → inspector-DZrN0kej.js} +556 -135
- package/dist/inspector-DZrN0kej.js.map +1 -0
- package/dist/{inspector-url-7qhtJwY6.cjs → inspector-url-C3LTKgXt.cjs} +3 -1
- package/dist/inspector-url-C3LTKgXt.cjs.map +1 -0
- package/dist/{inspector-url-DuEFmxLP.js → inspector-url-CyQcuBI9.js} +3 -1
- package/dist/inspector-url-CyQcuBI9.js.map +1 -0
- package/dist/mcp/index.cjs +119 -40
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +116 -37
- package/dist/mcp/index.js.map +1 -1
- package/dist/style.css +12 -0
- package/dist/{use-app-X7JbGskk.js → use-app-BNbz1uzj.js} +51 -42
- package/dist/use-app-BNbz1uzj.js.map +1 -0
- package/dist/{use-app-D2h-aiyr.cjs → use-app-Dqh20JPP.cjs} +93 -72
- package/dist/use-app-Dqh20JPP.cjs.map +1 -0
- package/package.json +2 -2
- package/template/dist/albums/albums.html +3 -3
- package/template/dist/albums/albums.json +1 -1
- package/template/dist/carousel/carousel.html +3 -3
- package/template/dist/carousel/carousel.json +1 -1
- package/template/dist/map/map.html +3 -3
- package/template/dist/map/map.json +1 -1
- package/template/dist/review/review.html +3 -3
- package/template/dist/review/review.json +1 -1
- package/template/node_modules/.vite/deps/_metadata.json +3 -3
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js +51 -42
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js +56 -50
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_app-bridge.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js +52 -43
- package/template/node_modules/.vite-mcp/deps/@modelcontextprotocol_ext-apps_react.js.map +1 -1
- package/template/node_modules/.vite-mcp/deps/_metadata.json +22 -22
- package/template/tests/e2e/albums.spec.ts +20 -16
- package/template/tests/e2e/carousel.spec.ts +1 -1
- package/template/tests/e2e/dev-overlay.spec.ts +118 -0
- package/template/tests/e2e/helpers.ts +13 -0
- package/template/tests/e2e/map.spec.ts +1 -1
- package/template/tests/e2e/review.spec.ts +1 -1
- package/template/tests/live/albums.spec.ts +10 -0
- package/template/tests/live/playwright.config.ts +1 -1
- package/dist/inspector-CByJjmPD.cjs.map +0 -1
- package/dist/inspector-ClhpqKLi.js.map +0 -1
- package/dist/inspector-url-7qhtJwY6.cjs.map +0 -1
- package/dist/inspector-url-DuEFmxLP.js.map +0 -1
- package/dist/use-app-D2h-aiyr.cjs.map +0 -1
- package/dist/use-app-X7JbGskk.js.map +0 -1
package/dist/style.css
CHANGED
|
@@ -874,6 +874,10 @@
|
|
|
874
874
|
width: 100%;
|
|
875
875
|
}
|
|
876
876
|
|
|
877
|
+
.w-screen {
|
|
878
|
+
width: 100vw;
|
|
879
|
+
}
|
|
880
|
+
|
|
877
881
|
.max-w-\[40rem\] {
|
|
878
882
|
max-width: 40rem;
|
|
879
883
|
}
|
|
@@ -1140,6 +1144,10 @@
|
|
|
1140
1144
|
border-radius: 10px;
|
|
1141
1145
|
}
|
|
1142
1146
|
|
|
1147
|
+
.rounded-\[20px\] {
|
|
1148
|
+
border-radius: 20px;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1143
1151
|
.rounded-\[22px\] {
|
|
1144
1152
|
border-radius: 22px;
|
|
1145
1153
|
}
|
|
@@ -1674,6 +1682,10 @@
|
|
|
1674
1682
|
-moz-osx-font-smoothing: grayscale;
|
|
1675
1683
|
}
|
|
1676
1684
|
|
|
1685
|
+
.opacity-50 {
|
|
1686
|
+
opacity: .5;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1677
1689
|
.opacity-60 {
|
|
1678
1690
|
opacity: .6;
|
|
1679
1691
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { $ as literal, D as ListResourcesResultSchema, I as ReadResourceResultSchema, L as RequestIdSchema, N as PingRequestSchema, Q as boolean, R as ResourceLinkSchema, U as ToolSchema, X as _undefined, Z as array, _ as ImplementationSchema, a as CallToolResultSchema, at as unknown, b as JSONRPCMessageSchema, et as number, i as CallToolRequestSchema, it as union, k as ListToolsRequestSchema, m as EmptyResultSchema, nt as record, p as EmbeddedResourceSchema, rt as string, s as ContentBlockSchema, t as Protocol, tt as object } from "./protocol-DJmRaBzO.js";
|
|
2
2
|
import { createContext, useContext, useEffect, useState } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.
|
|
5
|
-
var
|
|
4
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+ext-apps@1.3.1_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__react-_cd1fb28fd87e0bddd0a29eba0721855d/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js
|
|
5
|
+
var W = "2026-01-26", d = "ui/open-link", h = "ui/download-file", m = "ui/message", r = "ui/notifications/size-changed", p = "ui/notifications/tool-input", z = "ui/notifications/tool-input-partial", c = "ui/notifications/tool-result", n = "ui/notifications/tool-cancelled", a = "ui/notifications/host-context-changed", o = "ui/notifications/request-teardown", s = "ui/resource-teardown", t = "ui/initialize", e = "ui/notifications/initialized", QQ = "ui/request-display-mode";
|
|
6
6
|
var K = class {
|
|
7
7
|
eventTarget;
|
|
8
8
|
eventSource;
|
|
@@ -36,11 +36,11 @@ var K = class {
|
|
|
36
36
|
onmessage;
|
|
37
37
|
sessionId;
|
|
38
38
|
setProtocolVersion;
|
|
39
|
-
},
|
|
39
|
+
}, b = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), J = union([
|
|
40
40
|
literal("inline"),
|
|
41
41
|
literal("fullscreen"),
|
|
42
42
|
literal("pip")
|
|
43
|
-
]).describe("Display mode for UI presentation."),
|
|
43
|
+
]).describe("Display mode for UI presentation."), GQ = record(union([
|
|
44
44
|
literal("--color-background-primary"),
|
|
45
45
|
literal("--color-background-secondary"),
|
|
46
46
|
literal("--color-background-tertiary"),
|
|
@@ -135,7 +135,7 @@ Individual style keys are optional - hosts may provide any subset of these value
|
|
|
135
135
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
136
136
|
|
|
137
137
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
138
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),
|
|
138
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), VQ = object({
|
|
139
139
|
method: literal("ui/open-link"),
|
|
140
140
|
params: object({ url: string().describe("URL to open in the host's browser") })
|
|
141
141
|
}), B = object({ isError: boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough(), _ = object({ isError: boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).") }).passthrough(), O = object({ isError: boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough();
|
|
@@ -156,7 +156,7 @@ var G = object({
|
|
|
156
156
|
microphone: object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),
|
|
157
157
|
geolocation: object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),
|
|
158
158
|
clipboardWrite: object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")
|
|
159
|
-
}),
|
|
159
|
+
}), jQ = object({
|
|
160
160
|
method: literal("ui/notifications/size-changed"),
|
|
161
161
|
params: object({
|
|
162
162
|
width: number().optional().describe("New width in pixels."),
|
|
@@ -171,19 +171,22 @@ var G = object({
|
|
|
171
171
|
}), A = object({
|
|
172
172
|
method: literal("ui/notifications/tool-cancelled"),
|
|
173
173
|
params: object({ reason: string().optional().describe("Optional reason for the cancellation (e.g., \"user action\", \"timeout\").") })
|
|
174
|
-
}),
|
|
175
|
-
variables:
|
|
176
|
-
css:
|
|
174
|
+
}), k = object({ fonts: string().optional() }), C = object({
|
|
175
|
+
variables: GQ.optional().describe("CSS variables for theming the app."),
|
|
176
|
+
css: k.optional().describe("CSS blocks that apps can inject.")
|
|
177
177
|
}), F = object({
|
|
178
178
|
method: literal("ui/resource-teardown"),
|
|
179
179
|
params: object({})
|
|
180
|
-
}),
|
|
180
|
+
}), EQ = record(string(), unknown()), L = object({
|
|
181
181
|
text: object({}).optional().describe("Host supports text content blocks."),
|
|
182
182
|
image: object({}).optional().describe("Host supports image content blocks."),
|
|
183
183
|
audio: object({}).optional().describe("Host supports audio content blocks."),
|
|
184
184
|
resource: object({}).optional().describe("Host supports resource content blocks."),
|
|
185
185
|
resourceLink: object({}).optional().describe("Host supports resource link content blocks."),
|
|
186
186
|
structuredContent: object({}).optional().describe("Host supports structured content.")
|
|
187
|
+
}), WQ = object({
|
|
188
|
+
method: literal("ui/notifications/request-teardown"),
|
|
189
|
+
params: object({}).optional()
|
|
187
190
|
}), x = object({
|
|
188
191
|
experimental: object({}).optional().describe("Experimental features (structure TBD)."),
|
|
189
192
|
openLinks: object({}).optional().describe("Host supports opening external URLs."),
|
|
@@ -195,13 +198,13 @@ var G = object({
|
|
|
195
198
|
permissions: V.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),
|
|
196
199
|
csp: G.optional().describe("CSP domains approved by the host.")
|
|
197
200
|
}).optional().describe("Sandbox configuration applied by the host."),
|
|
198
|
-
updateModelContext:
|
|
199
|
-
message:
|
|
200
|
-
}),
|
|
201
|
+
updateModelContext: L.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),
|
|
202
|
+
message: L.optional().describe("Host supports receiving content messages (ui/message) from the view.")
|
|
203
|
+
}), g = object({
|
|
201
204
|
experimental: object({}).optional().describe("Experimental features (structure TBD)."),
|
|
202
205
|
tools: object({ listChanged: boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."),
|
|
203
206
|
availableDisplayModes: array(J).optional().describe("Display modes the app supports.")
|
|
204
|
-
}),
|
|
207
|
+
}), zQ = object({
|
|
205
208
|
method: literal("ui/notifications/initialized"),
|
|
206
209
|
params: object({}).optional()
|
|
207
210
|
}), LQ = object({
|
|
@@ -223,20 +226,20 @@ Boolean requesting whether a visible border and background is provided by the ho
|
|
|
223
226
|
- \`true\`: request visible border + background
|
|
224
227
|
- \`false\`: request no visible border + background
|
|
225
228
|
- omitted: host decides border`)
|
|
226
|
-
}),
|
|
229
|
+
}), BQ = object({
|
|
227
230
|
method: literal("ui/request-display-mode"),
|
|
228
231
|
params: object({ mode: J.describe("The display mode being requested.") })
|
|
229
|
-
}), P = object({ mode: J.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(),
|
|
232
|
+
}), P = object({ mode: J.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), S = union([literal("model"), literal("app")]).describe("Tool visibility scope - who can access the tool."), _Q = object({
|
|
230
233
|
resourceUri: string().optional(),
|
|
231
|
-
visibility: array(
|
|
234
|
+
visibility: array(S).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
232
235
|
- "model": Tool visible to and callable by the agent
|
|
233
236
|
- "app": Tool callable by the app from this server only`)
|
|
234
237
|
});
|
|
235
238
|
object({ mimeTypes: array(string()).optional().describe("Array of supported MIME types for UI resources.\nMust include `\"text/html;profile=mcp-app\"` for MCP Apps support.") });
|
|
236
|
-
var
|
|
239
|
+
var OQ = object({
|
|
237
240
|
method: literal("ui/download-file"),
|
|
238
241
|
params: object({ contents: array(union([EmbeddedResourceSchema, ResourceLinkSchema])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.") })
|
|
239
|
-
}),
|
|
242
|
+
}), IQ = object({
|
|
240
243
|
method: literal("ui/message"),
|
|
241
244
|
params: object({
|
|
242
245
|
role: literal("user").describe("Message role, currently only \"user\" is supported."),
|
|
@@ -252,15 +255,15 @@ object({
|
|
|
252
255
|
permissions: V.optional().describe("Sandbox permissions from resource metadata.")
|
|
253
256
|
})
|
|
254
257
|
});
|
|
255
|
-
var
|
|
258
|
+
var q = object({
|
|
256
259
|
method: literal("ui/notifications/tool-result"),
|
|
257
260
|
params: CallToolResultSchema.describe("Standard MCP tool execution result.")
|
|
258
|
-
}),
|
|
261
|
+
}), T = object({
|
|
259
262
|
toolInfo: object({
|
|
260
263
|
id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."),
|
|
261
264
|
tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.")
|
|
262
265
|
}).optional().describe("Metadata of the tool call that instantiated this App."),
|
|
263
|
-
theme:
|
|
266
|
+
theme: b.optional().describe("Current color theme preference."),
|
|
264
267
|
styles: C.optional().describe("Style configuration for theming the app."),
|
|
265
268
|
displayMode: J.optional().describe("How the UI is currently displayed."),
|
|
266
269
|
availableDisplayModes: array(J).optional().describe("Display modes the host supports."),
|
|
@@ -284,47 +287,47 @@ container holding the app. Specify either width or maxWidth, and either height o
|
|
|
284
287
|
bottom: number().describe("Bottom safe area inset in pixels."),
|
|
285
288
|
left: number().describe("Left safe area inset in pixels.")
|
|
286
289
|
}).optional().describe("Mobile safe area boundaries in pixels.")
|
|
287
|
-
}).passthrough(),
|
|
290
|
+
}).passthrough(), R = object({
|
|
288
291
|
method: literal("ui/notifications/host-context-changed"),
|
|
289
|
-
params:
|
|
290
|
-
}),
|
|
292
|
+
params: T.describe("Partial context update containing only changed fields.")
|
|
293
|
+
}), AQ = object({
|
|
291
294
|
method: literal("ui/update-model-context"),
|
|
292
295
|
params: object({
|
|
293
296
|
content: array(ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."),
|
|
294
297
|
structuredContent: record(string(), unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")
|
|
295
298
|
})
|
|
296
|
-
}),
|
|
299
|
+
}), FQ = object({
|
|
297
300
|
method: literal("ui/initialize"),
|
|
298
301
|
params: object({
|
|
299
302
|
appInfo: ImplementationSchema.describe("App identification (name and version)."),
|
|
300
|
-
appCapabilities:
|
|
303
|
+
appCapabilities: g.describe("Features and capabilities this app provides."),
|
|
301
304
|
protocolVersion: string().describe("Protocol version this app supports.")
|
|
302
305
|
})
|
|
303
|
-
}),
|
|
306
|
+
}), U = object({
|
|
304
307
|
protocolVersion: string().describe("Negotiated protocol version string (e.g., \"2025-11-21\")."),
|
|
305
308
|
hostInfo: ImplementationSchema.describe("Host application identification and version."),
|
|
306
309
|
hostCapabilities: x.describe("Features and capabilities provided by the host."),
|
|
307
|
-
hostContext:
|
|
310
|
+
hostContext: T.describe("Rich context about the host environment.")
|
|
308
311
|
}).passthrough();
|
|
309
|
-
function
|
|
312
|
+
function PQ() {
|
|
310
313
|
let X = document.documentElement.getAttribute("data-theme");
|
|
311
314
|
if (X === "dark" || X === "light") return X;
|
|
312
315
|
return document.documentElement.classList.contains("dark") ? "dark" : "light";
|
|
313
316
|
}
|
|
314
|
-
function
|
|
317
|
+
function qQ(X) {
|
|
315
318
|
let Y = document.documentElement;
|
|
316
319
|
Y.setAttribute("data-theme", X), Y.style.colorScheme = X;
|
|
317
320
|
}
|
|
318
|
-
function
|
|
321
|
+
function TQ(X, Y = document.documentElement) {
|
|
319
322
|
for (let [Z, $] of Object.entries(X)) if ($ !== void 0) Y.style.setProperty(Z, $);
|
|
320
323
|
}
|
|
321
|
-
function
|
|
324
|
+
function RQ(X) {
|
|
322
325
|
if (document.getElementById("__mcp-host-fonts")) return;
|
|
323
326
|
let Z = document.createElement("style");
|
|
324
327
|
Z.id = "__mcp-host-fonts", Z.textContent = X, document.head.appendChild(Z);
|
|
325
328
|
}
|
|
326
|
-
var
|
|
327
|
-
var
|
|
329
|
+
var MX = "ui/resourceUri", vX = "text/html;profile=mcp-app";
|
|
330
|
+
var gQ = class extends Protocol {
|
|
328
331
|
_appInfo;
|
|
329
332
|
_capabilities;
|
|
330
333
|
options;
|
|
@@ -356,13 +359,13 @@ var CQ = class extends Protocol {
|
|
|
356
359
|
this.setNotificationHandler(w, (Y) => X(Y.params));
|
|
357
360
|
}
|
|
358
361
|
set ontoolresult(X) {
|
|
359
|
-
this.setNotificationHandler(
|
|
362
|
+
this.setNotificationHandler(q, (Y) => X(Y.params));
|
|
360
363
|
}
|
|
361
364
|
set ontoolcancelled(X) {
|
|
362
365
|
this.setNotificationHandler(A, (Y) => X(Y.params));
|
|
363
366
|
}
|
|
364
367
|
set onhostcontextchanged(X) {
|
|
365
|
-
this.setNotificationHandler(
|
|
368
|
+
this.setNotificationHandler(R, (Y) => {
|
|
366
369
|
this._hostContext = {
|
|
367
370
|
...this._hostContext,
|
|
368
371
|
...Y.params
|
|
@@ -447,6 +450,12 @@ var CQ = class extends Protocol {
|
|
|
447
450
|
params: X
|
|
448
451
|
}, _, Y);
|
|
449
452
|
}
|
|
453
|
+
requestTeardown(X = {}) {
|
|
454
|
+
return this.notification({
|
|
455
|
+
method: "ui/notifications/request-teardown",
|
|
456
|
+
params: X
|
|
457
|
+
});
|
|
458
|
+
}
|
|
450
459
|
requestDisplayMode(X, Y) {
|
|
451
460
|
return this.request({
|
|
452
461
|
method: "ui/request-display-mode",
|
|
@@ -488,9 +497,9 @@ var CQ = class extends Protocol {
|
|
|
488
497
|
params: {
|
|
489
498
|
appCapabilities: this._capabilities,
|
|
490
499
|
appInfo: this._appInfo,
|
|
491
|
-
protocolVersion:
|
|
500
|
+
protocolVersion: W
|
|
492
501
|
}
|
|
493
|
-
},
|
|
502
|
+
}, U, Y);
|
|
494
503
|
if (Z === void 0) throw Error(`Server sent invalid initialize result: ${Z}`);
|
|
495
504
|
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();
|
|
496
505
|
} catch (Z) {
|
|
@@ -538,7 +547,7 @@ function AppProvider({ appInfo, capabilities, onAppCreated, children }) {
|
|
|
538
547
|
}
|
|
539
548
|
if (!_connecting) _connecting = (async () => {
|
|
540
549
|
const transport = new K(window.parent, window.parent);
|
|
541
|
-
const newApp = new
|
|
550
|
+
const newApp = new gQ(appInfo, capabilities ?? {});
|
|
542
551
|
onAppCreated?.(newApp);
|
|
543
552
|
await newApp.connect(transport);
|
|
544
553
|
_app = newApp;
|
|
@@ -593,6 +602,6 @@ function useApp() {
|
|
|
593
602
|
return useContext(AppContext).app;
|
|
594
603
|
}
|
|
595
604
|
//#endregion
|
|
596
|
-
export {
|
|
605
|
+
export { s as $, V as A, e as B, QQ as C, T as D, S as E, _Q as F, k as G, gQ as H, a as I, o as J, m as K, b as L, W as M, WQ as N, TQ as O, _ as P, r as Q, c as R, PQ as S, RQ as T, h as U, g as V, jQ as W, q as X, p as Y, qQ as Z, LQ as _, B as a, zQ as at, OQ as b, EQ as c, G as d, t as et, I as f, L as g, K as h, AQ as i, z as it, VQ as j, U as k, F as l, J as m, AppProvider as n, w as nt, BQ as o, IQ as p, n as q, A as r, x as rt, C as s, useApp as t, vX as tt, FQ as u, MX as v, R as w, P as x, O as y, d as z };
|
|
597
606
|
|
|
598
|
-
//# sourceMappingURL=use-app-
|
|
607
|
+
//# sourceMappingURL=use-app-BNbz1uzj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-app-BNbz1uzj.js","names":["XQ","Q.union","Q.literal","Q.record","Q.string","Q.undefined","Q.object","Q.boolean","Q.array","Q.number","Q.unknown","ZQ","DQ","M","YQ","$Q","JQ","v","UQ","CQ","HQ","kQ","MQ","xQ","bQ","vQ"],"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.js","../src/hooks/app-context.tsx","../src/hooks/use-app.ts"],"sourcesContent":["import{Protocol as UQ}from\"@modelcontextprotocol/sdk/shared/protocol.js\";import{CallToolRequestSchema as HQ,CallToolResultSchema as MQ,EmptyResultSchema as vQ,ListResourcesResultSchema as bQ,ListToolsRequestSchema as kQ,PingRequestSchema as CQ,ReadResourceResultSchema as xQ}from\"@modelcontextprotocol/sdk/types.js\";import{JSONRPCMessageSchema as XQ}from\"@modelcontextprotocol/sdk/types.js\";var W=\"2026-01-26\",d=\"ui/open-link\",h=\"ui/download-file\",m=\"ui/message\",i=\"ui/notifications/sandbox-proxy-ready\",l=\"ui/notifications/sandbox-resource-ready\",r=\"ui/notifications/size-changed\",p=\"ui/notifications/tool-input\",z=\"ui/notifications/tool-input-partial\",c=\"ui/notifications/tool-result\",n=\"ui/notifications/tool-cancelled\",a=\"ui/notifications/host-context-changed\",o=\"ui/notifications/request-teardown\",s=\"ui/resource-teardown\",t=\"ui/initialize\",e=\"ui/notifications/initialized\",QQ=\"ui/request-display-mode\";class K{eventTarget;eventSource;messageListener;constructor(X=window.parent,Y){this.eventTarget=X;this.eventSource=Y;this.messageListener=(Z)=>{if(Y&&Z.source!==this.eventSource){console.debug(\"Ignoring message from unknown source\",Z);return}let $=XQ.safeParse(Z.data);if($.success)console.debug(\"Parsed message\",$.data),this.onmessage?.($.data);else if(Z.data?.jsonrpc!==\"2.0\")console.debug(\"Ignoring non-JSON-RPC message\",$.error.message,Z);else console.error(\"Failed to parse message\",$.error.message,Z),this.onerror?.(Error(\"Invalid JSON-RPC message received: \"+$.error.message))}}async start(){window.addEventListener(\"message\",this.messageListener)}async send(X,Y){if(X.method!==z)console.debug(\"Sending message\",X);this.eventTarget.postMessage(X,\"*\")}async close(){window.removeEventListener(\"message\",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}import{z as Q}from\"zod/v4\";import{ContentBlockSchema as M,CallToolResultSchema as YQ,EmbeddedResourceSchema as ZQ,ImplementationSchema as v,RequestIdSchema as $Q,ResourceLinkSchema as DQ,ToolSchema as JQ}from\"@modelcontextprotocol/sdk/types.js\";var b=Q.union([Q.literal(\"light\"),Q.literal(\"dark\")]).describe(\"Color theme preference for the host environment.\"),J=Q.union([Q.literal(\"inline\"),Q.literal(\"fullscreen\"),Q.literal(\"pip\")]).describe(\"Display mode for UI presentation.\"),KQ=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.\"),GQ=Q.record(KQ.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.`),VQ=Q.object({method:Q.literal(\"ui/open-link\"),params:Q.object({url:Q.string().describe(\"URL to open in the host's browser\")})}),B=Q.object({isError:Q.boolean().optional().describe(\"True if the host failed to open the URL (e.g., due to security policy).\")}).passthrough(),_=Q.object({isError:Q.boolean().optional().describe(\"True if the download failed (e.g., user cancelled or host denied).\")}).passthrough(),O=Q.object({isError:Q.boolean().optional().describe(\"True if the host rejected or failed to deliver the message.\")}).passthrough(),NQ=Q.object({method:Q.literal(\"ui/notifications/sandbox-proxy-ready\"),params:Q.object({})}),G=Q.object({connectDomains:Q.array(Q.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).\n\n- Maps to CSP \\`connect-src\\` directive\n- Empty or omitted → no network connections (secure default)`),resourceDomains:Q.array(Q.string()).optional().describe(\"Origins for static resources (images, scripts, stylesheets, fonts, media).\\n\\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\\n- Wildcard subdomains supported: `https://*.example.com`\\n- Empty or omitted → no network resources (secure default)\"),frameDomains:Q.array(Q.string()).optional().describe(\"Origins for nested iframes.\\n\\n- Maps to CSP `frame-src` directive\\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)\"),baseUriDomains:Q.array(Q.string()).optional().describe(\"Allowed base URIs for the document.\\n\\n- Maps to CSP `base-uri` directive\\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)\")}),V=Q.object({camera:Q.object({}).optional().describe(\"Request camera access.\\n\\nMaps to Permission Policy `camera` feature.\"),microphone:Q.object({}).optional().describe(\"Request microphone access.\\n\\nMaps to Permission Policy `microphone` feature.\"),geolocation:Q.object({}).optional().describe(\"Request geolocation access.\\n\\nMaps to Permission Policy `geolocation` feature.\"),clipboardWrite:Q.object({}).optional().describe(\"Request clipboard write access.\\n\\nMaps to Permission Policy `clipboard-write` feature.\")}),jQ=Q.object({method:Q.literal(\"ui/notifications/size-changed\"),params:Q.object({width:Q.number().optional().describe(\"New width in pixels.\"),height:Q.number().optional().describe(\"New height in pixels.\")})}),I=Q.object({method:Q.literal(\"ui/notifications/tool-input\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Complete tool call arguments as key-value pairs.\")).optional().describe(\"Complete tool call arguments as key-value pairs.\")})}),w=Q.object({method:Q.literal(\"ui/notifications/tool-input-partial\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Partial tool call arguments (incomplete, may change).\")).optional().describe(\"Partial tool call arguments (incomplete, may change).\")})}),A=Q.object({method:Q.literal(\"ui/notifications/tool-cancelled\"),params:Q.object({reason:Q.string().optional().describe('Optional reason for the cancellation (e.g., \"user action\", \"timeout\").')})}),k=Q.object({fonts:Q.string().optional()}),C=Q.object({variables:GQ.optional().describe(\"CSS variables for theming the app.\"),css:k.optional().describe(\"CSS blocks that apps can inject.\")}),F=Q.object({method:Q.literal(\"ui/resource-teardown\"),params:Q.object({})}),EQ=Q.record(Q.string(),Q.unknown()),L=Q.object({text:Q.object({}).optional().describe(\"Host supports text content blocks.\"),image:Q.object({}).optional().describe(\"Host supports image content blocks.\"),audio:Q.object({}).optional().describe(\"Host supports audio content blocks.\"),resource:Q.object({}).optional().describe(\"Host supports resource content blocks.\"),resourceLink:Q.object({}).optional().describe(\"Host supports resource link content blocks.\"),structuredContent:Q.object({}).optional().describe(\"Host supports structured content.\")}),WQ=Q.object({method:Q.literal(\"ui/notifications/request-teardown\"),params:Q.object({}).optional()}),x=Q.object({experimental:Q.object({}).optional().describe(\"Experimental features (structure TBD).\"),openLinks:Q.object({}).optional().describe(\"Host supports opening external URLs.\"),downloadFile:Q.object({}).optional().describe(\"Host supports file downloads via ui/download-file.\"),serverTools:Q.object({listChanged:Q.boolean().optional().describe(\"Host supports tools/list_changed notifications.\")}).optional().describe(\"Host can proxy tool calls to the MCP server.\"),serverResources:Q.object({listChanged:Q.boolean().optional().describe(\"Host supports resources/list_changed notifications.\")}).optional().describe(\"Host can proxy resource reads to the MCP server.\"),logging:Q.object({}).optional().describe(\"Host accepts log messages.\"),sandbox:Q.object({permissions:V.optional().describe(\"Permissions granted by the host (camera, microphone, geolocation).\"),csp:G.optional().describe(\"CSP domains approved by the host.\")}).optional().describe(\"Sandbox configuration applied by the host.\"),updateModelContext:L.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:L.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\")}),g=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(J).optional().describe(\"Display modes the app supports.\")}),zQ=Q.object({method:Q.literal(\"ui/notifications/initialized\"),params:Q.object({}).optional()}),LQ=Q.object({csp:G.optional().describe(\"Content Security Policy configuration for UI resources.\"),permissions:V.optional().describe(\"Sandbox permissions requested by the UI resource.\"),domain:Q.string().optional().describe(`Dedicated origin for view sandbox.\n\nUseful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.\n\n**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:\n- Hash-based subdomains (e.g., \\`{hash}.claudemcpcontent.com\\`)\n- URL-derived subdomains (e.g., \\`www-example-com.oaiusercontent.com\\`)\n\nIf omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Q.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.\n\nBoolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.\n\n- \\`true\\`: request visible border + background\n- \\`false\\`: request no visible border + background\n- omitted: host decides border`)}),BQ=Q.object({method:Q.literal(\"ui/request-display-mode\"),params:Q.object({mode:J.describe(\"The display mode being requested.\")})}),P=Q.object({mode:J.describe(\"The display mode that was actually set. May differ from requested if not supported.\")}).passthrough(),S=Q.union([Q.literal(\"model\"),Q.literal(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\"),_Q=Q.object({resourceUri:Q.string().optional(),visibility:Q.array(S).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`)}),lQ=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.')}),OQ=Q.object({method:Q.literal(\"ui/download-file\"),params:Q.object({contents:Q.array(Q.union([ZQ,DQ])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})}),IQ=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(M).describe(\"Message content blocks (text, image, etc.).\")})}),wQ=Q.object({method:Q.literal(\"ui/notifications/sandbox-resource-ready\"),params:Q.object({html:Q.string().describe(\"HTML content to load into the inner iframe.\"),sandbox:Q.string().optional().describe(\"Optional override for the inner iframe's sandbox attribute.\"),csp:G.optional().describe(\"CSP configuration from resource metadata.\"),permissions:V.optional().describe(\"Sandbox permissions from resource metadata.\")})}),q=Q.object({method:Q.literal(\"ui/notifications/tool-result\"),params:YQ.describe(\"Standard MCP tool execution result.\")}),T=Q.object({toolInfo:Q.object({id:$Q.optional().describe(\"JSON-RPC id of the tools/call request.\"),tool:JQ.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:b.optional().describe(\"Current color theme preference.\"),styles:C.optional().describe(\"Style configuration for theming the app.\"),displayMode:J.optional().describe(\"How the UI is currently displayed.\"),availableDisplayModes:Q.array(J).optional().describe(\"Display modes the host supports.\"),containerDimensions:Q.union([Q.object({height:Q.number().describe(\"Fixed container height in pixels.\")}),Q.object({maxHeight:Q.union([Q.number(),Q.undefined()]).optional().describe(\"Maximum container height in pixels.\")})]).and(Q.union([Q.object({width:Q.number().describe(\"Fixed container width in pixels.\")}),Q.object({maxWidth:Q.union([Q.number(),Q.undefined()]).optional().describe(\"Maximum container width in pixels.\")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other\ncontainer holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Q.string().optional().describe(\"User's language and region preference in BCP 47 format.\"),timeZone:Q.string().optional().describe(\"User's timezone in IANA format.\"),userAgent:Q.string().optional().describe(\"Host application identifier.\"),platform:Q.union([Q.literal(\"web\"),Q.literal(\"desktop\"),Q.literal(\"mobile\")]).optional().describe(\"Platform type for responsive design decisions.\"),deviceCapabilities:Q.object({touch:Q.boolean().optional().describe(\"Whether the device supports touch input.\"),hover:Q.boolean().optional().describe(\"Whether the device supports hover interactions.\")}).optional().describe(\"Device input capabilities.\"),safeAreaInsets:Q.object({top:Q.number().describe(\"Top safe area inset in pixels.\"),right:Q.number().describe(\"Right safe area inset in pixels.\"),bottom:Q.number().describe(\"Bottom safe area inset in pixels.\"),left:Q.number().describe(\"Left safe area inset in pixels.\")}).optional().describe(\"Mobile safe area boundaries in pixels.\")}).passthrough(),R=Q.object({method:Q.literal(\"ui/notifications/host-context-changed\"),params:T.describe(\"Partial context update containing only changed fields.\")}),AQ=Q.object({method:Q.literal(\"ui/update-model-context\"),params:Q.object({content:Q.array(M).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.\")})}),FQ=Q.object({method:Q.literal(\"ui/initialize\"),params:Q.object({appInfo:v.describe(\"App identification (name and version).\"),appCapabilities:g.describe(\"Features and capabilities this app provides.\"),protocolVersion:Q.string().describe(\"Protocol version this app supports.\")})}),U=Q.object({protocolVersion:Q.string().describe('Negotiated protocol version string (e.g., \"2025-11-21\").'),hostInfo:v.describe(\"Host application identification and version.\"),hostCapabilities:x.describe(\"Features and capabilities provided by the host.\"),hostContext:T.describe(\"Rich context about the host environment.\")}).passthrough();function PQ(){let X=document.documentElement.getAttribute(\"data-theme\");if(X===\"dark\"||X===\"light\")return X;return document.documentElement.classList.contains(\"dark\")?\"dark\":\"light\"}function qQ(X){let Y=document.documentElement;Y.setAttribute(\"data-theme\",X),Y.style.colorScheme=X}function TQ(X,Y=document.documentElement){for(let[Z,$]of Object.entries(X))if($!==void 0)Y.style.setProperty(Z,$)}function RQ(X){if(document.getElementById(\"__mcp-host-fonts\"))return;let Z=document.createElement(\"style\");Z.id=\"__mcp-host-fonts\",Z.textContent=X,document.head.appendChild(Z)}var MX=\"ui/resourceUri\",vX=\"text/html;profile=mcp-app\";class gQ extends UQ{_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(CQ,($)=>{return console.log(\"Received ping:\",$.params),{}}),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(X){this.setNotificationHandler(I,(Y)=>X(Y.params))}set ontoolinputpartial(X){this.setNotificationHandler(w,(Y)=>X(Y.params))}set ontoolresult(X){this.setNotificationHandler(q,(Y)=>X(Y.params))}set ontoolcancelled(X){this.setNotificationHandler(A,(Y)=>X(Y.params))}set onhostcontextchanged(X){this.setNotificationHandler(R,(Y)=>{this._hostContext={...this._hostContext,...Y.params},X(Y.params)})}set onteardown(X){this.setRequestHandler(F,(Y,Z)=>X(Y.params,Z))}set oncalltool(X){this.setRequestHandler(HQ,(Y,Z)=>X(Y.params,Z))}set onlisttools(X){this.setRequestHandler(kQ,(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},MQ,Y)}async readServerResource(X,Y){return await this.request({method:\"resources/read\",params:X},xQ,Y)}async listServerResources(X,Y){return await this.request({method:\"resources/list\",params:X},bQ,Y)}sendMessage(X,Y){return this.request({method:\"ui/message\",params:X},O,Y)}sendLog(X){return this.notification({method:\"notifications/message\",params:X})}updateModelContext(X,Y){return this.request({method:\"ui/update-model-context\",params:X},vQ,Y)}openLink(X,Y){return this.request({method:\"ui/open-link\",params:X},B,Y)}sendOpenLink=this.openLink;downloadFile(X,Y){return this.request({method:\"ui/download-file\",params:X},_,Y)}requestTeardown(X={}){return this.notification({method:\"ui/notifications/request-teardown\",params:X})}requestDisplayMode(X,Y){return this.request({method:\"ui/request-display-mode\",params:X},P,Y)}sendSizeChanged(X){return this.notification({method:\"ui/notifications/size-changed\",params:X})}setupSizeChangedNotifications(){let X=!1,Y=0,Z=0,$=()=>{if(X)return;X=!0,requestAnimationFrame(()=>{X=!1;let D=document.documentElement,y=D.style.width,u=D.style.height;D.style.width=\"fit-content\",D.style.height=\"max-content\";let H=D.getBoundingClientRect();D.style.width=y,D.style.height=u;let f=window.innerWidth-D.clientWidth,j=Math.ceil(H.width+f),E=Math.ceil(H.height);if(j!==Y||E!==Z)Y=j,Z=E,this.sendSizeChanged({width:j,height:E})})};$();let N=new ResizeObserver($);return N.observe(document.documentElement),N.observe(document.body),()=>N.disconnect()}async connect(X=new K(window.parent,window.parent),Y){if(this.transport)throw Error(\"App is already connected. Call close() before connecting again.\");await super.connect(X);try{let Z=await this.request({method:\"ui/initialize\",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:W}},U,Y);if(Z===void 0)throw Error(`Server sent invalid initialize result: ${Z}`);if(this._hostCapabilities=Z.hostCapabilities,this._hostInfo=Z.hostInfo,this._hostContext=Z.hostContext,await this.notification({method:\"ui/notifications/initialized\"}),this.options?.autoResize)this.setupSizeChangedNotifications()}catch(Z){throw this.close(),Z}}}export{PQ as getDocumentTheme,TQ as applyHostStyleVariables,RQ as applyHostFonts,qQ as applyDocumentTheme,c as TOOL_RESULT_METHOD,z as TOOL_INPUT_PARTIAL_METHOD,p as TOOL_INPUT_METHOD,n as TOOL_CANCELLED_METHOD,r as SIZE_CHANGED_METHOD,l as SANDBOX_RESOURCE_READY_METHOD,i as SANDBOX_PROXY_READY_METHOD,MX as RESOURCE_URI_META_KEY,s as RESOURCE_TEARDOWN_METHOD,vX as RESOURCE_MIME_TYPE,o as REQUEST_TEARDOWN_METHOD,QQ as REQUEST_DISPLAY_MODE_METHOD,K as PostMessageTransport,d as OPEN_LINK_METHOD,AQ as McpUiUpdateModelContextRequestSchema,S as McpUiToolVisibilitySchema,q as McpUiToolResultNotificationSchema,_Q as McpUiToolMetaSchema,w as McpUiToolInputPartialNotificationSchema,I as McpUiToolInputNotificationSchema,A as McpUiToolCancelledNotificationSchema,b as McpUiThemeSchema,L as McpUiSupportedContentBlockModalitiesSchema,jQ as McpUiSizeChangedNotificationSchema,wQ as McpUiSandboxResourceReadyNotificationSchema,NQ as McpUiSandboxProxyReadyNotificationSchema,EQ as McpUiResourceTeardownResultSchema,F as McpUiResourceTeardownRequestSchema,V as McpUiResourcePermissionsSchema,LQ as McpUiResourceMetaSchema,G as McpUiResourceCspSchema,WQ as McpUiRequestTeardownNotificationSchema,P as McpUiRequestDisplayModeResultSchema,BQ as McpUiRequestDisplayModeRequestSchema,B as McpUiOpenLinkResultSchema,VQ as McpUiOpenLinkRequestSchema,O as McpUiMessageResultSchema,IQ as McpUiMessageRequestSchema,zQ as McpUiInitializedNotificationSchema,U as McpUiInitializeResultSchema,FQ as McpUiInitializeRequestSchema,C as McpUiHostStylesSchema,k as McpUiHostCssSchema,T as McpUiHostContextSchema,R as McpUiHostContextChangedNotificationSchema,x as McpUiHostCapabilitiesSchema,_ as McpUiDownloadFileResultSchema,OQ as McpUiDownloadFileRequestSchema,J as McpUiDisplayModeSchema,g as McpUiAppCapabilitiesSchema,m as MESSAGE_METHOD,W as LATEST_PROTOCOL_VERSION,t as INITIALIZE_METHOD,e as INITIALIZED_METHOD,a as HOST_CONTEXT_CHANGED_METHOD,h as DOWNLOAD_FILE_METHOD,gQ as App};\n","/**\n * React Context for sharing the MCP App instance across the component tree.\n *\n * AppProvider handles connecting to the MCP Apps host and provides the App\n * instance via context. All sunpeak hooks read from this context internally,\n * so consumers never need to pass `app` as a parameter.\n *\n * The provider preserves the App instance across React Fast Refresh (HMR)\n * by storing it at module scope, matching the previous useApp() behavior.\n */\nimport { createContext, useState, useEffect, type ReactNode } from 'react';\nimport { App, PostMessageTransport } from '@modelcontextprotocol/ext-apps';\n\nexport interface AppProviderProps {\n appInfo: { name: string; version: string };\n capabilities?: Record<string, unknown>;\n onAppCreated?: (app: App) => void;\n children: ReactNode;\n}\n\nexport interface AppState {\n app: App | null;\n isConnected: boolean;\n error: Error | null;\n}\n\nconst defaultState: AppState = { app: null, isConnected: false, error: null };\n\nexport const AppContext = createContext<AppState>(defaultState);\n\n// Module-level App persistence.\n// During React Fast Refresh the component file is hot-swapped but this module\n// is NOT re-evaluated, so these variables survive across HMR cycles.\n// On a full page reload they reset to null, triggering a fresh connection.\nlet _app: App | null = null;\nlet _connecting: Promise<App> | null = null;\n\nexport function AppProvider({ appInfo, capabilities, onAppCreated, children }: AppProviderProps) {\n const [state, setState] = useState<AppState>(() =>\n _app ? { app: _app, isConnected: true, error: null } : defaultState\n );\n\n useEffect(() => {\n let cancelled = false;\n\n // Already connected (HMR re-run or StrictMode double-mount) — reuse.\n if (_app) {\n setState({ app: _app, isConnected: true, error: null });\n return () => {\n cancelled = true;\n };\n }\n\n // Connection already in flight (StrictMode double-mount) — wait for it.\n if (!_connecting) {\n _connecting = (async () => {\n const transport = new PostMessageTransport(window.parent, window.parent);\n const newApp = new App(appInfo, capabilities ?? {});\n onAppCreated?.(newApp);\n await newApp.connect(transport);\n _app = newApp;\n return newApp;\n })();\n }\n\n _connecting.then(\n (connectedApp) => {\n if (!cancelled) {\n setState({ app: connectedApp, isConnected: true, error: null });\n }\n },\n (err) => {\n _connecting = null;\n if (!cancelled) {\n setState({\n app: null,\n isConnected: false,\n error: err instanceof Error ? err : new Error('Failed to connect'),\n });\n }\n }\n );\n\n return () => {\n cancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- connect once, persist across HMR\n }, []);\n\n return <AppContext.Provider value={state}>{children}</AppContext.Provider>;\n}\n","import { useContext } from 'react';\nimport { AppContext } from './app-context';\nimport type { App } from '@modelcontextprotocol/ext-apps';\n\n/**\n * Access the MCP App instance from context.\n *\n * Returns the connected App instance, or `null` while the connection\n * is being established. Must be used inside an `<AppProvider>`.\n *\n * Most hooks read from context internally, so you only need `useApp()`\n * for direct SDK method calls like `app.requestDisplayMode()`.\n *\n * @example\n * ```tsx\n * import { useApp } from 'sunpeak';\n *\n * function MyComponent() {\n * const app = useApp();\n * const handleFullscreen = () => app?.requestDisplayMode({ mode: 'fullscreen' });\n * return <button onClick={handleFullscreen}>Fullscreen</button>;\n * }\n * ```\n */\nexport function useApp(): App | null {\n return useContext(AppContext).app;\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAAuY,IAAI,IAAE,cAAa,IAAE,gBAAe,IAAE,oBAAmB,IAAE,cAAkG,IAAE,iCAAgC,IAAE,+BAA8B,IAAE,uCAAsC,IAAE,gCAA+B,IAAE,mCAAkC,IAAE,yCAAwC,IAAE,qCAAoC,IAAE,wBAAuB,IAAE,iBAAgB,IAAE,gCAA+B,KAAG;AAA0B,IAAM,IAAN,MAAO;CAAC;CAAY;CAAY;CAAgB,YAAY,IAAE,OAAO,QAAO,GAAE;AAAC,OAAK,cAAY;AAAE,OAAK,cAAY;AAAE,OAAK,mBAAiB,MAAI;AAAC,OAAG,KAAG,EAAE,WAAS,KAAK,aAAY;AAAC,YAAQ,MAAM,wCAAuC,EAAE;AAAC;;GAAO,IAAI,IAAEA,qBAAG,UAAU,EAAE,KAAK;AAAC,OAAG,EAAE,QAAQ,SAAQ,MAAM,kBAAiB,EAAE,KAAK,EAAC,KAAK,YAAY,EAAE,KAAK;YAAS,EAAE,MAAM,YAAU,MAAM,SAAQ,MAAM,iCAAgC,EAAE,MAAM,SAAQ,EAAE;OAAM,SAAQ,MAA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