sunpeak 0.16.18 → 0.16.21
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/README.md +1 -1
- package/dist/chatgpt/index.cjs +1 -1
- package/dist/chatgpt/index.js +1 -1
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/{platform → host}/chatgpt/index.cjs +1 -1
- package/dist/host/chatgpt/index.cjs.map +1 -0
- package/dist/{platform → host}/chatgpt/index.d.ts +2 -2
- package/dist/{platform → host}/chatgpt/index.js +1 -1
- package/dist/host/chatgpt/index.js.map +1 -0
- package/dist/{platform → host}/chatgpt/use-create-file.d.ts +2 -2
- package/dist/{platform → host}/chatgpt/use-file-download.d.ts +2 -2
- package/dist/{platform → host}/chatgpt/use-open-modal.d.ts +2 -2
- package/dist/{platform → host}/chatgpt/use-request-checkout.d.ts +2 -2
- package/dist/{platform → host}/index.cjs +5 -3
- package/dist/host/index.cjs.map +1 -0
- package/dist/{platform → host}/index.d.ts +15 -11
- package/dist/{platform → host}/index.js +5 -3
- package/dist/host/index.js.map +1 -0
- package/dist/{index-C_uYg-eE.js → index-B4aC3vjH.js} +2 -2
- package/dist/index-B4aC3vjH.js.map +1 -0
- package/dist/{index-CJ3nfg7Q.cjs → index-CKabCJyV.cjs} +2 -2
- package/dist/index-CKabCJyV.cjs.map +1 -0
- package/dist/{index-BITfgMxk.js → index-CX6Z4bED.js} +2 -2
- package/dist/index-CX6Z4bED.js.map +1 -0
- package/dist/{index-DxCrGGzy.cjs → index-bKBBCBK6.cjs} +2 -2
- package/dist/index-bKBBCBK6.cjs.map +1 -0
- package/dist/index.cjs +193 -6294
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +189 -6290
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.cjs +656 -6758
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +658 -6760
- package/dist/mcp/index.js.map +1 -1
- package/dist/{protocol-CfvM5B6z.cjs → protocol-DkDHRwOW.cjs} +50 -5
- package/dist/{protocol-CfvM5B6z.cjs.map → protocol-DkDHRwOW.cjs.map} +1 -1
- package/dist/{protocol-CF-P_kw5.js → protocol-uge7qFev.js} +102 -57
- package/dist/{protocol-CF-P_kw5.js.map → protocol-uge7qFev.js.map} +1 -1
- package/dist/simulator/index.cjs +1 -1
- package/dist/simulator/index.js +1 -1
- package/dist/simulator-D8t-r7HH.js +3222 -0
- package/dist/simulator-D8t-r7HH.js.map +1 -0
- package/dist/simulator-FFNttkqL.cjs +3237 -0
- package/dist/simulator-FFNttkqL.cjs.map +1 -0
- package/dist/use-app-C9gpzIQO.js +349 -0
- package/dist/use-app-C9gpzIQO.js.map +1 -0
- package/dist/use-app-D09O2swh.cjs +348 -0
- package/dist/use-app-D09O2swh.cjs.map +1 -0
- package/package.json +25 -13
- package/template/node_modules/.bin/vite +2 -2
- package/template/node_modules/.bin/vitest +2 -2
- package/template/package.json +5 -5
- package/dist/index-BITfgMxk.js.map +0 -1
- package/dist/index-CJ3nfg7Q.cjs.map +0 -1
- package/dist/index-C_uYg-eE.js.map +0 -1
- package/dist/index-DxCrGGzy.cjs.map +0 -1
- package/dist/platform/chatgpt/index.cjs.map +0 -1
- package/dist/platform/chatgpt/index.js.map +0 -1
- package/dist/platform/index.cjs.map +0 -1
- package/dist/platform/index.js.map +0 -1
- package/dist/simulator-DfTsXTK4.js +0 -9323
- package/dist/simulator-DfTsXTK4.js.map +0 -1
- package/dist/simulator-mbqealxY.cjs +0 -9338
- package/dist/simulator-mbqealxY.cjs.map +0 -1
- package/dist/use-app-CaTJmpgj.cjs +0 -6449
- package/dist/use-app-CaTJmpgj.cjs.map +0 -1
- package/dist/use-app-DTTzqi-0.js +0 -6450
- package/dist/use-app-DTTzqi-0.js.map +0 -1
- /package/dist/{platform → host}/chatgpt/openai-types.d.ts +0 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const React = require("react");
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const protocol = require("./protocol-DkDHRwOW.cjs");
|
|
5
|
+
var L = "2026-01-26", d = "ui/open-link", h = "ui/download-file", m = "ui/message", p = "ui/notifications/size-changed", r = "ui/notifications/tool-input", W = "ui/notifications/tool-input-partial", l = "ui/notifications/tool-result", n = "ui/notifications/tool-cancelled", a = "ui/notifications/host-context-changed", o = "ui/resource-teardown", s = "ui/initialize", e = "ui/notifications/initialized", t = "ui/request-display-mode";
|
|
6
|
+
class K {
|
|
7
|
+
eventTarget;
|
|
8
|
+
eventSource;
|
|
9
|
+
messageListener;
|
|
10
|
+
constructor(X = window.parent, Y) {
|
|
11
|
+
this.eventTarget = X;
|
|
12
|
+
this.eventSource = Y;
|
|
13
|
+
this.messageListener = (Z) => {
|
|
14
|
+
if (Y && Z.source !== this.eventSource) {
|
|
15
|
+
console.debug("Ignoring message from unknown source", Z);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
let $ = protocol.JSONRPCMessageSchema.safeParse(Z.data);
|
|
19
|
+
if ($.success) console.debug("Parsed message", $.data), this.onmessage?.($.data);
|
|
20
|
+
else if (Z.data?.jsonrpc !== "2.0") console.debug("Ignoring non-JSON-RPC message", $.error.message, Z);
|
|
21
|
+
else console.error("Failed to parse message", $.error.message, Z), this.onerror?.(Error("Invalid JSON-RPC message received: " + $.error.message));
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
async start() {
|
|
25
|
+
window.addEventListener("message", this.messageListener);
|
|
26
|
+
}
|
|
27
|
+
async send(X, Y) {
|
|
28
|
+
if (X.method !== W) console.debug("Sending message", X);
|
|
29
|
+
this.eventTarget.postMessage(X, "*");
|
|
30
|
+
}
|
|
31
|
+
async close() {
|
|
32
|
+
window.removeEventListener("message", this.messageListener), this.onclose?.();
|
|
33
|
+
}
|
|
34
|
+
onclose;
|
|
35
|
+
onerror;
|
|
36
|
+
onmessage;
|
|
37
|
+
sessionId;
|
|
38
|
+
setProtocolVersion;
|
|
39
|
+
}
|
|
40
|
+
var k = protocol.union([protocol.literal("light"), protocol.literal("dark")]).describe("Color theme preference for the host environment."), J = protocol.union([protocol.literal("inline"), protocol.literal("fullscreen"), protocol.literal("pip")]).describe("Display mode for UI presentation."), JQ = protocol.union([protocol.literal("--color-background-primary"), protocol.literal("--color-background-secondary"), protocol.literal("--color-background-tertiary"), protocol.literal("--color-background-inverse"), protocol.literal("--color-background-ghost"), protocol.literal("--color-background-info"), protocol.literal("--color-background-danger"), protocol.literal("--color-background-success"), protocol.literal("--color-background-warning"), protocol.literal("--color-background-disabled"), protocol.literal("--color-text-primary"), protocol.literal("--color-text-secondary"), protocol.literal("--color-text-tertiary"), protocol.literal("--color-text-inverse"), protocol.literal("--color-text-ghost"), protocol.literal("--color-text-info"), protocol.literal("--color-text-danger"), protocol.literal("--color-text-success"), protocol.literal("--color-text-warning"), protocol.literal("--color-text-disabled"), protocol.literal("--color-border-primary"), protocol.literal("--color-border-secondary"), protocol.literal("--color-border-tertiary"), protocol.literal("--color-border-inverse"), protocol.literal("--color-border-ghost"), protocol.literal("--color-border-info"), protocol.literal("--color-border-danger"), protocol.literal("--color-border-success"), protocol.literal("--color-border-warning"), protocol.literal("--color-border-disabled"), protocol.literal("--color-ring-primary"), protocol.literal("--color-ring-secondary"), protocol.literal("--color-ring-inverse"), protocol.literal("--color-ring-info"), protocol.literal("--color-ring-danger"), protocol.literal("--color-ring-success"), protocol.literal("--color-ring-warning"), protocol.literal("--font-sans"), protocol.literal("--font-mono"), protocol.literal("--font-weight-normal"), protocol.literal("--font-weight-medium"), protocol.literal("--font-weight-semibold"), protocol.literal("--font-weight-bold"), protocol.literal("--font-text-xs-size"), protocol.literal("--font-text-sm-size"), protocol.literal("--font-text-md-size"), protocol.literal("--font-text-lg-size"), protocol.literal("--font-heading-xs-size"), protocol.literal("--font-heading-sm-size"), protocol.literal("--font-heading-md-size"), protocol.literal("--font-heading-lg-size"), protocol.literal("--font-heading-xl-size"), protocol.literal("--font-heading-2xl-size"), protocol.literal("--font-heading-3xl-size"), protocol.literal("--font-text-xs-line-height"), protocol.literal("--font-text-sm-line-height"), protocol.literal("--font-text-md-line-height"), protocol.literal("--font-text-lg-line-height"), protocol.literal("--font-heading-xs-line-height"), protocol.literal("--font-heading-sm-line-height"), protocol.literal("--font-heading-md-line-height"), protocol.literal("--font-heading-lg-line-height"), protocol.literal("--font-heading-xl-line-height"), protocol.literal("--font-heading-2xl-line-height"), protocol.literal("--font-heading-3xl-line-height"), protocol.literal("--border-radius-xs"), protocol.literal("--border-radius-sm"), protocol.literal("--border-radius-md"), protocol.literal("--border-radius-lg"), protocol.literal("--border-radius-xl"), protocol.literal("--border-radius-full"), protocol.literal("--border-width-regular"), protocol.literal("--shadow-hairline"), protocol.literal("--shadow-sm"), protocol.literal("--shadow-md"), protocol.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."), KQ = protocol.record(JQ.describe(`Style variables for theming MCP apps.
|
|
41
|
+
|
|
42
|
+
Individual style keys are optional - hosts may provide any subset of these values.
|
|
43
|
+
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
44
|
+
|
|
45
|
+
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
46
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), protocol.union([protocol.string(), protocol._undefined()]).describe(`Style variables for theming MCP apps.
|
|
47
|
+
|
|
48
|
+
Individual style keys are optional - hosts may provide any subset of these values.
|
|
49
|
+
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
50
|
+
|
|
51
|
+
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
52
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
|
|
53
|
+
|
|
54
|
+
Individual style keys are optional - hosts may provide any subset of these values.
|
|
55
|
+
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
56
|
+
|
|
57
|
+
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
58
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`), GQ = protocol.object({ method: protocol.literal("ui/open-link"), params: protocol.object({ url: protocol.string().describe("URL to open in the host's browser") }) }), B = protocol.object({ isError: protocol.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).") }).passthrough(), _ = protocol.object({ isError: protocol.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).") }).passthrough(), O = protocol.object({ isError: protocol.boolean().optional().describe("True if the host rejected or failed to deliver the message.") }).passthrough();
|
|
59
|
+
protocol.object({ method: protocol.literal("ui/notifications/sandbox-proxy-ready"), params: protocol.object({}) });
|
|
60
|
+
var G = protocol.object({ connectDomains: protocol.array(protocol.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
61
|
+
|
|
62
|
+
- Maps to CSP \`connect-src\` directive
|
|
63
|
+
- Empty or omitted → no network connections (secure default)`), resourceDomains: protocol.array(protocol.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: protocol.array(protocol.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: protocol.array(protocol.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 = protocol.object({ camera: protocol.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."), microphone: protocol.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."), geolocation: protocol.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."), clipboardWrite: protocol.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.") }), NQ = protocol.object({ method: protocol.literal("ui/notifications/size-changed"), params: protocol.object({ width: protocol.number().optional().describe("New width in pixels."), height: protocol.number().optional().describe("New height in pixels.") }) }), I = protocol.object({ method: protocol.literal("ui/notifications/tool-input"), params: protocol.object({ arguments: protocol.record(protocol.string(), protocol.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.") }) }), w = protocol.object({ method: protocol.literal("ui/notifications/tool-input-partial"), params: protocol.object({ arguments: protocol.record(protocol.string(), protocol.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).") }) }), A = protocol.object({ method: protocol.literal("ui/notifications/tool-cancelled"), params: protocol.object({ reason: protocol.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").') }) }), b = protocol.object({ fonts: protocol.string().optional() }), C = protocol.object({ variables: KQ.optional().describe("CSS variables for theming the app."), css: b.optional().describe("CSS blocks that apps can inject.") }), F = protocol.object({ method: protocol.literal("ui/resource-teardown"), params: protocol.object({}) }), jQ = protocol.record(protocol.string(), protocol.unknown()), z = protocol.object({ text: protocol.object({}).optional().describe("Host supports text content blocks."), image: protocol.object({}).optional().describe("Host supports image content blocks."), audio: protocol.object({}).optional().describe("Host supports audio content blocks."), resource: protocol.object({}).optional().describe("Host supports resource content blocks."), resourceLink: protocol.object({}).optional().describe("Host supports resource link content blocks."), structuredContent: protocol.object({}).optional().describe("Host supports structured content.") }), x = protocol.object({ experimental: protocol.object({}).optional().describe("Experimental features (structure TBD)."), openLinks: protocol.object({}).optional().describe("Host supports opening external URLs."), downloadFile: protocol.object({}).optional().describe("Host supports file downloads via ui/download-file."), serverTools: protocol.object({ listChanged: protocol.boolean().optional().describe("Host supports tools/list_changed notifications.") }).optional().describe("Host can proxy tool calls to the MCP server."), serverResources: protocol.object({ listChanged: protocol.boolean().optional().describe("Host supports resources/list_changed notifications.") }).optional().describe("Host can proxy resource reads to the MCP server."), logging: protocol.object({}).optional().describe("Host accepts log messages."), sandbox: protocol.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: z.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."), message: z.optional().describe("Host supports receiving content messages (ui/message) from the view.") }), S = protocol.object({ experimental: protocol.object({}).optional().describe("Experimental features (structure TBD)."), tools: protocol.object({ listChanged: protocol.boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."), availableDisplayModes: protocol.array(J).optional().describe("Display modes the app supports.") }), EQ = protocol.object({ method: protocol.literal("ui/notifications/initialized"), params: protocol.object({}).optional() }), LQ = protocol.object({ csp: G.optional().describe("Content Security Policy configuration for UI resources."), permissions: V.optional().describe("Sandbox permissions requested by the UI resource."), domain: protocol.string().optional().describe(`Dedicated origin for view sandbox.
|
|
64
|
+
|
|
65
|
+
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
66
|
+
|
|
67
|
+
**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:
|
|
68
|
+
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
69
|
+
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
70
|
+
|
|
71
|
+
If omitted, host uses default sandbox origin (typically per-conversation).`), prefersBorder: protocol.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
72
|
+
|
|
73
|
+
Boolean 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.
|
|
74
|
+
|
|
75
|
+
- \`true\`: request visible border + background
|
|
76
|
+
- \`false\`: request no visible border + background
|
|
77
|
+
- omitted: host decides border`) }), WQ = protocol.object({ method: protocol.literal("ui/request-display-mode"), params: protocol.object({ mode: J.describe("The display mode being requested.") }) }), P = protocol.object({ mode: J.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough(), g = protocol.union([protocol.literal("model"), protocol.literal("app")]).describe("Tool visibility scope - who can access the tool."), zQ = protocol.object({ resourceUri: protocol.string().optional(), visibility: protocol.array(g).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
78
|
+
- "model": Tool visible to and callable by the agent
|
|
79
|
+
- "app": Tool callable by the app from this server only`) });
|
|
80
|
+
protocol.object({ mimeTypes: protocol.array(protocol.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.') });
|
|
81
|
+
var BQ = protocol.object({ method: protocol.literal("ui/download-file"), params: protocol.object({ contents: protocol.array(protocol.union([protocol.EmbeddedResourceSchema, protocol.ResourceLinkSchema])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.") }) }), _Q = protocol.object({ method: protocol.literal("ui/message"), params: protocol.object({ role: protocol.literal("user").describe('Message role, currently only "user" is supported.'), content: protocol.array(protocol.ContentBlockSchema).describe("Message content blocks (text, image, etc.).") }) });
|
|
82
|
+
protocol.object({ method: protocol.literal("ui/notifications/sandbox-resource-ready"), params: protocol.object({ html: protocol.string().describe("HTML content to load into the inner iframe."), sandbox: protocol.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.") }) });
|
|
83
|
+
var T = protocol.object({ method: protocol.literal("ui/notifications/tool-result"), params: protocol.CallToolResultSchema.describe("Standard MCP tool execution result.") }), q = protocol.object({ toolInfo: protocol.object({ id: protocol.RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."), tool: protocol.ToolSchema.describe("Tool definition including name, inputSchema, etc.") }).optional().describe("Metadata of the tool call that instantiated this App."), theme: k.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: protocol.array(J).optional().describe("Display modes the host supports."), containerDimensions: protocol.union([protocol.object({ height: protocol.number().describe("Fixed container height in pixels.") }), protocol.object({ maxHeight: protocol.union([protocol.number(), protocol._undefined()]).optional().describe("Maximum container height in pixels.") })]).and(protocol.union([protocol.object({ width: protocol.number().describe("Fixed container width in pixels.") }), protocol.object({ maxWidth: protocol.union([protocol.number(), protocol._undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
84
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`), locale: protocol.string().optional().describe("User's language and region preference in BCP 47 format."), timeZone: protocol.string().optional().describe("User's timezone in IANA format."), userAgent: protocol.string().optional().describe("Host application identifier."), platform: protocol.union([protocol.literal("web"), protocol.literal("desktop"), protocol.literal("mobile")]).optional().describe("Platform type for responsive design decisions."), deviceCapabilities: protocol.object({ touch: protocol.boolean().optional().describe("Whether the device supports touch input."), hover: protocol.boolean().optional().describe("Whether the device supports hover interactions.") }).optional().describe("Device input capabilities."), safeAreaInsets: protocol.object({ top: protocol.number().describe("Top safe area inset in pixels."), right: protocol.number().describe("Right safe area inset in pixels."), bottom: protocol.number().describe("Bottom safe area inset in pixels."), left: protocol.number().describe("Left safe area inset in pixels.") }).optional().describe("Mobile safe area boundaries in pixels.") }).passthrough(), U = protocol.object({ method: protocol.literal("ui/notifications/host-context-changed"), params: q.describe("Partial context update containing only changed fields.") }), IQ = protocol.object({ method: protocol.literal("ui/update-model-context"), params: protocol.object({ content: protocol.array(protocol.ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."), structuredContent: protocol.record(protocol.string(), protocol.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.") }) }), wQ = protocol.object({ method: protocol.literal("ui/initialize"), params: protocol.object({ appInfo: protocol.ImplementationSchema.describe("App identification (name and version)."), appCapabilities: S.describe("Features and capabilities this app provides."), protocolVersion: protocol.string().describe("Protocol version this app supports.") }) }), R = protocol.object({ protocolVersion: protocol.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'), hostInfo: protocol.ImplementationSchema.describe("Host application identification and version."), hostCapabilities: x.describe("Features and capabilities provided by the host."), hostContext: q.describe("Rich context about the host environment.") }).passthrough();
|
|
85
|
+
function AQ() {
|
|
86
|
+
let X = document.documentElement.getAttribute("data-theme");
|
|
87
|
+
if (X === "dark" || X === "light") return X;
|
|
88
|
+
return document.documentElement.classList.contains("dark") ? "dark" : "light";
|
|
89
|
+
}
|
|
90
|
+
function FQ(X) {
|
|
91
|
+
let Y = document.documentElement;
|
|
92
|
+
Y.setAttribute("data-theme", X), Y.style.colorScheme = X;
|
|
93
|
+
}
|
|
94
|
+
function PQ(X, Y = document.documentElement) {
|
|
95
|
+
for (let [Z, $] of Object.entries(X)) if ($ !== void 0) Y.style.setProperty(Z, $);
|
|
96
|
+
}
|
|
97
|
+
function TQ(X) {
|
|
98
|
+
if (document.getElementById("__mcp-host-fonts")) return;
|
|
99
|
+
let Z = document.createElement("style");
|
|
100
|
+
Z.id = "__mcp-host-fonts", Z.textContent = X, document.head.appendChild(Z);
|
|
101
|
+
}
|
|
102
|
+
var UX = "ui/resourceUri", RX = "text/html;profile=mcp-app";
|
|
103
|
+
class CQ extends protocol.Protocol {
|
|
104
|
+
_appInfo;
|
|
105
|
+
_capabilities;
|
|
106
|
+
options;
|
|
107
|
+
_hostCapabilities;
|
|
108
|
+
_hostInfo;
|
|
109
|
+
_hostContext;
|
|
110
|
+
constructor(X, Y = {}, Z = { autoResize: true }) {
|
|
111
|
+
super(Z);
|
|
112
|
+
this._appInfo = X;
|
|
113
|
+
this._capabilities = Y;
|
|
114
|
+
this.options = Z;
|
|
115
|
+
this.setRequestHandler(protocol.PingRequestSchema, ($) => {
|
|
116
|
+
return console.log("Received ping:", $.params), {};
|
|
117
|
+
}), this.onhostcontextchanged = () => {
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
getHostCapabilities() {
|
|
121
|
+
return this._hostCapabilities;
|
|
122
|
+
}
|
|
123
|
+
getHostVersion() {
|
|
124
|
+
return this._hostInfo;
|
|
125
|
+
}
|
|
126
|
+
getHostContext() {
|
|
127
|
+
return this._hostContext;
|
|
128
|
+
}
|
|
129
|
+
set ontoolinput(X) {
|
|
130
|
+
this.setNotificationHandler(I, (Y) => X(Y.params));
|
|
131
|
+
}
|
|
132
|
+
set ontoolinputpartial(X) {
|
|
133
|
+
this.setNotificationHandler(w, (Y) => X(Y.params));
|
|
134
|
+
}
|
|
135
|
+
set ontoolresult(X) {
|
|
136
|
+
this.setNotificationHandler(T, (Y) => X(Y.params));
|
|
137
|
+
}
|
|
138
|
+
set ontoolcancelled(X) {
|
|
139
|
+
this.setNotificationHandler(A, (Y) => X(Y.params));
|
|
140
|
+
}
|
|
141
|
+
set onhostcontextchanged(X) {
|
|
142
|
+
this.setNotificationHandler(U, (Y) => {
|
|
143
|
+
this._hostContext = { ...this._hostContext, ...Y.params }, X(Y.params);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
set onteardown(X) {
|
|
147
|
+
this.setRequestHandler(F, (Y, Z) => X(Y.params, Z));
|
|
148
|
+
}
|
|
149
|
+
set oncalltool(X) {
|
|
150
|
+
this.setRequestHandler(protocol.CallToolRequestSchema, (Y, Z) => X(Y.params, Z));
|
|
151
|
+
}
|
|
152
|
+
set onlisttools(X) {
|
|
153
|
+
this.setRequestHandler(protocol.ListToolsRequestSchema, (Y, Z) => X(Y.params, Z));
|
|
154
|
+
}
|
|
155
|
+
assertCapabilityForMethod(X) {
|
|
156
|
+
}
|
|
157
|
+
assertRequestHandlerCapability(X) {
|
|
158
|
+
switch (X) {
|
|
159
|
+
case "tools/call":
|
|
160
|
+
case "tools/list":
|
|
161
|
+
if (!this._capabilities.tools) throw Error(`Client does not support tool capability (required for ${X})`);
|
|
162
|
+
return;
|
|
163
|
+
case "ping":
|
|
164
|
+
case "ui/resource-teardown":
|
|
165
|
+
return;
|
|
166
|
+
default:
|
|
167
|
+
throw Error(`No handler for method ${X} registered`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
assertNotificationCapability(X) {
|
|
171
|
+
}
|
|
172
|
+
assertTaskCapability(X) {
|
|
173
|
+
throw Error("Tasks are not supported in MCP Apps");
|
|
174
|
+
}
|
|
175
|
+
assertTaskHandlerCapability(X) {
|
|
176
|
+
throw Error("Task handlers are not supported in MCP Apps");
|
|
177
|
+
}
|
|
178
|
+
async callServerTool(X, Y) {
|
|
179
|
+
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: { ... } })?`);
|
|
180
|
+
return await this.request({ method: "tools/call", params: X }, protocol.CallToolResultSchema, Y);
|
|
181
|
+
}
|
|
182
|
+
async readServerResource(X, Y) {
|
|
183
|
+
return await this.request({ method: "resources/read", params: X }, protocol.ReadResourceResultSchema, Y);
|
|
184
|
+
}
|
|
185
|
+
async listServerResources(X, Y) {
|
|
186
|
+
return await this.request({ method: "resources/list", params: X }, protocol.ListResourcesResultSchema, Y);
|
|
187
|
+
}
|
|
188
|
+
sendMessage(X, Y) {
|
|
189
|
+
return this.request({ method: "ui/message", params: X }, O, Y);
|
|
190
|
+
}
|
|
191
|
+
sendLog(X) {
|
|
192
|
+
return this.notification({ method: "notifications/message", params: X });
|
|
193
|
+
}
|
|
194
|
+
updateModelContext(X, Y) {
|
|
195
|
+
return this.request({ method: "ui/update-model-context", params: X }, protocol.EmptyResultSchema, Y);
|
|
196
|
+
}
|
|
197
|
+
openLink(X, Y) {
|
|
198
|
+
return this.request({ method: "ui/open-link", params: X }, B, Y);
|
|
199
|
+
}
|
|
200
|
+
sendOpenLink = this.openLink;
|
|
201
|
+
downloadFile(X, Y) {
|
|
202
|
+
return this.request({ method: "ui/download-file", params: X }, _, Y);
|
|
203
|
+
}
|
|
204
|
+
requestDisplayMode(X, Y) {
|
|
205
|
+
return this.request({ method: "ui/request-display-mode", params: X }, P, Y);
|
|
206
|
+
}
|
|
207
|
+
sendSizeChanged(X) {
|
|
208
|
+
return this.notification({ method: "ui/notifications/size-changed", params: X });
|
|
209
|
+
}
|
|
210
|
+
setupSizeChangedNotifications() {
|
|
211
|
+
let X = false, Y = 0, Z = 0, $ = () => {
|
|
212
|
+
if (X) return;
|
|
213
|
+
X = true, requestAnimationFrame(() => {
|
|
214
|
+
X = false;
|
|
215
|
+
let D = document.documentElement, y = D.style.width, u = D.style.height;
|
|
216
|
+
D.style.width = "fit-content", D.style.height = "max-content";
|
|
217
|
+
let H = D.getBoundingClientRect();
|
|
218
|
+
D.style.width = y, D.style.height = u;
|
|
219
|
+
let f = window.innerWidth - D.clientWidth, j = Math.ceil(H.width + f), E = Math.ceil(H.height);
|
|
220
|
+
if (j !== Y || E !== Z) Y = j, Z = E, this.sendSizeChanged({ width: j, height: E });
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
$();
|
|
224
|
+
let N = new ResizeObserver($);
|
|
225
|
+
return N.observe(document.documentElement), N.observe(document.body), () => N.disconnect();
|
|
226
|
+
}
|
|
227
|
+
async connect(X = new K(window.parent, window.parent), Y) {
|
|
228
|
+
if (this.transport) throw Error("App is already connected. Call close() before connecting again.");
|
|
229
|
+
await super.connect(X);
|
|
230
|
+
try {
|
|
231
|
+
let Z = await this.request({ method: "ui/initialize", params: { appCapabilities: this._capabilities, appInfo: this._appInfo, protocolVersion: L } }, R, Y);
|
|
232
|
+
if (Z === void 0) throw Error(`Server sent invalid initialize result: ${Z}`);
|
|
233
|
+
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();
|
|
234
|
+
} catch (Z) {
|
|
235
|
+
throw this.close(), Z;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const defaultState = { app: null, isConnected: false, error: null };
|
|
240
|
+
const AppContext = React.createContext(defaultState);
|
|
241
|
+
let _app = null;
|
|
242
|
+
let _connecting = null;
|
|
243
|
+
function AppProvider({ appInfo, capabilities, onAppCreated, children }) {
|
|
244
|
+
const [state, setState] = React.useState(
|
|
245
|
+
() => _app ? { app: _app, isConnected: true, error: null } : defaultState
|
|
246
|
+
);
|
|
247
|
+
React.useEffect(() => {
|
|
248
|
+
let cancelled = false;
|
|
249
|
+
if (_app) {
|
|
250
|
+
setState({ app: _app, isConnected: true, error: null });
|
|
251
|
+
return () => {
|
|
252
|
+
cancelled = true;
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
if (!_connecting) {
|
|
256
|
+
_connecting = (async () => {
|
|
257
|
+
const transport = new K(window.parent, window.parent);
|
|
258
|
+
const newApp = new CQ(appInfo, capabilities ?? {});
|
|
259
|
+
onAppCreated?.(newApp);
|
|
260
|
+
await newApp.connect(transport);
|
|
261
|
+
_app = newApp;
|
|
262
|
+
return newApp;
|
|
263
|
+
})();
|
|
264
|
+
}
|
|
265
|
+
_connecting.then(
|
|
266
|
+
(connectedApp) => {
|
|
267
|
+
if (!cancelled) {
|
|
268
|
+
setState({ app: connectedApp, isConnected: true, error: null });
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
(err) => {
|
|
272
|
+
_connecting = null;
|
|
273
|
+
if (!cancelled) {
|
|
274
|
+
setState({
|
|
275
|
+
app: null,
|
|
276
|
+
isConnected: false,
|
|
277
|
+
error: err instanceof Error ? err : new Error("Failed to connect")
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
return () => {
|
|
283
|
+
cancelled = true;
|
|
284
|
+
};
|
|
285
|
+
}, []);
|
|
286
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AppContext.Provider, { value: state, children });
|
|
287
|
+
}
|
|
288
|
+
function useApp() {
|
|
289
|
+
return React.useContext(AppContext).app;
|
|
290
|
+
}
|
|
291
|
+
exports.A = A;
|
|
292
|
+
exports.AQ = AQ;
|
|
293
|
+
exports.AppProvider = AppProvider;
|
|
294
|
+
exports.B = B;
|
|
295
|
+
exports.BQ = BQ;
|
|
296
|
+
exports.C = C;
|
|
297
|
+
exports.CQ = CQ;
|
|
298
|
+
exports.EQ = EQ;
|
|
299
|
+
exports.F = F;
|
|
300
|
+
exports.FQ = FQ;
|
|
301
|
+
exports.G = G;
|
|
302
|
+
exports.GQ = GQ;
|
|
303
|
+
exports.I = I;
|
|
304
|
+
exports.IQ = IQ;
|
|
305
|
+
exports.J = J;
|
|
306
|
+
exports.K = K;
|
|
307
|
+
exports.L = L;
|
|
308
|
+
exports.LQ = LQ;
|
|
309
|
+
exports.NQ = NQ;
|
|
310
|
+
exports.O = O;
|
|
311
|
+
exports.P = P;
|
|
312
|
+
exports.PQ = PQ;
|
|
313
|
+
exports.R = R;
|
|
314
|
+
exports.RX = RX;
|
|
315
|
+
exports.S = S;
|
|
316
|
+
exports.T = T;
|
|
317
|
+
exports.TQ = TQ;
|
|
318
|
+
exports.U = U;
|
|
319
|
+
exports.UX = UX;
|
|
320
|
+
exports.V = V;
|
|
321
|
+
exports.W = W;
|
|
322
|
+
exports.WQ = WQ;
|
|
323
|
+
exports._ = _;
|
|
324
|
+
exports._Q = _Q;
|
|
325
|
+
exports.a = a;
|
|
326
|
+
exports.b = b;
|
|
327
|
+
exports.d = d;
|
|
328
|
+
exports.e = e;
|
|
329
|
+
exports.g = g;
|
|
330
|
+
exports.h = h;
|
|
331
|
+
exports.jQ = jQ;
|
|
332
|
+
exports.k = k;
|
|
333
|
+
exports.l = l;
|
|
334
|
+
exports.m = m;
|
|
335
|
+
exports.n = n;
|
|
336
|
+
exports.o = o;
|
|
337
|
+
exports.p = p;
|
|
338
|
+
exports.q = q;
|
|
339
|
+
exports.r = r;
|
|
340
|
+
exports.s = s;
|
|
341
|
+
exports.t = t;
|
|
342
|
+
exports.useApp = useApp;
|
|
343
|
+
exports.w = w;
|
|
344
|
+
exports.wQ = wQ;
|
|
345
|
+
exports.x = x;
|
|
346
|
+
exports.z = z;
|
|
347
|
+
exports.zQ = zQ;
|
|
348
|
+
//# sourceMappingURL=use-app-D09O2swh.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-app-D09O2swh.cjs","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.js","../src/hooks/app-context.tsx","../src/hooks/use-app.ts"],"sourcesContent":["import{Protocol as qQ}from\"@modelcontextprotocol/sdk/shared/protocol.js\";import{CallToolRequestSchema as UQ,CallToolResultSchema as RQ,EmptyResultSchema as HQ,ListResourcesResultSchema as MQ,ListToolsRequestSchema as vQ,PingRequestSchema as kQ,ReadResourceResultSchema as bQ}from\"@modelcontextprotocol/sdk/types.js\";import{JSONRPCMessageSchema as QQ}from\"@modelcontextprotocol/sdk/types.js\";var L=\"2026-01-26\",d=\"ui/open-link\",h=\"ui/download-file\",m=\"ui/message\",i=\"ui/notifications/sandbox-proxy-ready\",c=\"ui/notifications/sandbox-resource-ready\",p=\"ui/notifications/size-changed\",r=\"ui/notifications/tool-input\",W=\"ui/notifications/tool-input-partial\",l=\"ui/notifications/tool-result\",n=\"ui/notifications/tool-cancelled\",a=\"ui/notifications/host-context-changed\",o=\"ui/resource-teardown\",s=\"ui/initialize\",e=\"ui/notifications/initialized\",t=\"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 $=QQ.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!==W)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 XQ,EmbeddedResourceSchema as YQ,ImplementationSchema as v,RequestIdSchema as ZQ,ResourceLinkSchema as $Q,ToolSchema as DQ}from\"@modelcontextprotocol/sdk/types.js\";var k=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.\"),JQ=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.\"),KQ=Q.record(JQ.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.`),GQ=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(),VQ=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.\")}),NQ=Q.object({method:Q.literal(\"ui/notifications/size-changed\"),params:Q.object({width:Q.number().optional().describe(\"New width in pixels.\"),height:Q.number().optional().describe(\"New height in pixels.\")})}),I=Q.object({method:Q.literal(\"ui/notifications/tool-input\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Complete tool call arguments as key-value pairs.\")).optional().describe(\"Complete tool call arguments as key-value pairs.\")})}),w=Q.object({method:Q.literal(\"ui/notifications/tool-input-partial\"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe(\"Partial tool call arguments (incomplete, may change).\")).optional().describe(\"Partial tool call arguments (incomplete, may change).\")})}),A=Q.object({method:Q.literal(\"ui/notifications/tool-cancelled\"),params:Q.object({reason:Q.string().optional().describe('Optional reason for the cancellation (e.g., \"user action\", \"timeout\").')})}),b=Q.object({fonts:Q.string().optional()}),C=Q.object({variables:KQ.optional().describe(\"CSS variables for theming the app.\"),css:b.optional().describe(\"CSS blocks that apps can inject.\")}),F=Q.object({method:Q.literal(\"ui/resource-teardown\"),params:Q.object({})}),jQ=Q.record(Q.string(),Q.unknown()),z=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.\")}),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:z.optional().describe(\"Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.\"),message:z.optional().describe(\"Host supports receiving content messages (ui/message) from the view.\")}),S=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.\")}),EQ=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`)}),WQ=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(),g=Q.union([Q.literal(\"model\"),Q.literal(\"app\")]).describe(\"Tool visibility scope - who can access the tool.\"),zQ=Q.object({resourceUri:Q.string().optional(),visibility:Q.array(g).optional().describe(`Who can access this tool. Default: [\"model\", \"app\"]\n- \"model\": Tool visible to and callable by the agent\n- \"app\": Tool callable by the app from this server only`)}),mQ=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.')}),BQ=Q.object({method:Q.literal(\"ui/download-file\"),params:Q.object({contents:Q.array(Q.union([YQ,$Q])).describe(\"Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.\")})}),_Q=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.).\")})}),OQ=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.\")})}),T=Q.object({method:Q.literal(\"ui/notifications/tool-result\"),params:XQ.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:DQ.describe(\"Tool definition including name, inputSchema, etc.\")}).optional().describe(\"Metadata of the tool call that instantiated this App.\"),theme:k.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(),U=Q.object({method:Q.literal(\"ui/notifications/host-context-changed\"),params:q.describe(\"Partial context update containing only changed fields.\")}),IQ=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.\")})}),wQ=Q.object({method:Q.literal(\"ui/initialize\"),params:Q.object({appInfo:v.describe(\"App identification (name and version).\"),appCapabilities:S.describe(\"Features and capabilities this app provides.\"),protocolVersion:Q.string().describe(\"Protocol version this app supports.\")})}),R=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:q.describe(\"Rich context about the host environment.\")}).passthrough();function AQ(){let X=document.documentElement.getAttribute(\"data-theme\");if(X===\"dark\"||X===\"light\")return X;return document.documentElement.classList.contains(\"dark\")?\"dark\":\"light\"}function FQ(X){let Y=document.documentElement;Y.setAttribute(\"data-theme\",X),Y.style.colorScheme=X}function PQ(X,Y=document.documentElement){for(let[Z,$]of Object.entries(X))if($!==void 0)Y.style.setProperty(Z,$)}function TQ(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 UX=\"ui/resourceUri\",RX=\"text/html;profile=mcp-app\";class CQ extends qQ{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;constructor(X,Y={},Z={autoResize:!0}){super(Z);this._appInfo=X;this._capabilities=Y;this.options=Z;this.setRequestHandler(kQ,($)=>{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(T,(Y)=>X(Y.params))}set ontoolcancelled(X){this.setNotificationHandler(A,(Y)=>X(Y.params))}set onhostcontextchanged(X){this.setNotificationHandler(U,(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(UQ,(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},RQ,Y)}async readServerResource(X,Y){return await this.request({method:\"resources/read\",params:X},bQ,Y)}async listServerResources(X,Y){return await this.request({method:\"resources/list\",params:X},MQ,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},HQ,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)}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:L}},R,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{AQ as getDocumentTheme,PQ as applyHostStyleVariables,TQ as applyHostFonts,FQ as applyDocumentTheme,l as TOOL_RESULT_METHOD,W as TOOL_INPUT_PARTIAL_METHOD,r as TOOL_INPUT_METHOD,n as TOOL_CANCELLED_METHOD,p as SIZE_CHANGED_METHOD,c as SANDBOX_RESOURCE_READY_METHOD,i as SANDBOX_PROXY_READY_METHOD,UX as RESOURCE_URI_META_KEY,o as RESOURCE_TEARDOWN_METHOD,RX as RESOURCE_MIME_TYPE,t as REQUEST_DISPLAY_MODE_METHOD,K as PostMessageTransport,d as OPEN_LINK_METHOD,IQ as McpUiUpdateModelContextRequestSchema,g as McpUiToolVisibilitySchema,T as McpUiToolResultNotificationSchema,zQ as McpUiToolMetaSchema,w as McpUiToolInputPartialNotificationSchema,I as McpUiToolInputNotificationSchema,A as McpUiToolCancelledNotificationSchema,k as McpUiThemeSchema,z as McpUiSupportedContentBlockModalitiesSchema,NQ as McpUiSizeChangedNotificationSchema,OQ as McpUiSandboxResourceReadyNotificationSchema,VQ as McpUiSandboxProxyReadyNotificationSchema,jQ as McpUiResourceTeardownResultSchema,F as McpUiResourceTeardownRequestSchema,V as McpUiResourcePermissionsSchema,LQ as McpUiResourceMetaSchema,G as McpUiResourceCspSchema,P as McpUiRequestDisplayModeResultSchema,WQ as McpUiRequestDisplayModeRequestSchema,B as McpUiOpenLinkResultSchema,GQ as McpUiOpenLinkRequestSchema,O as McpUiMessageResultSchema,_Q as McpUiMessageRequestSchema,EQ as McpUiInitializedNotificationSchema,R as McpUiInitializeResultSchema,wQ as McpUiInitializeRequestSchema,C as McpUiHostStylesSchema,b as McpUiHostCssSchema,q as McpUiHostContextSchema,U as McpUiHostContextChangedNotificationSchema,x as McpUiHostCapabilitiesSchema,_ as McpUiDownloadFileResultSchema,BQ as McpUiDownloadFileRequestSchema,J as McpUiDisplayModeSchema,S as McpUiAppCapabilitiesSchema,m as MESSAGE_METHOD,L as LATEST_PROTOCOL_VERSION,s as INITIALIZE_METHOD,e as INITIALIZED_METHOD,a as HOST_CONTEXT_CHANGED_METHOD,h as DOWNLOAD_FILE_METHOD,CQ 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"],"names":["QQ","Q.union","Q.literal","Q.record","Q.string","Q.undefined","Q.object","Q.boolean","Q.array","Q.number","Q.unknown","YQ","$Q","M","XQ","ZQ","DQ","v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YACP,KAAK;AAAA,YACL,aAAa;AAAA,YACb,OAAO,eAAe,QAAQ,MAAM,IAAI,MAAM,mBAAmB;AAAA,UAAA,CAClE;AAAA,QACH;AAAA,MACF;AAAA,IAAA;AAGF,WAAO,MAAM;AACX,kBAAY;AAAA,IACd;AAAA,EAEF,GAAG,CAAA,CAAE;AAEL,wCAAQ,WAAW,UAAX,EAAoB,OAAO,OAAQ,UAAS;AACtD;AClEO,SAAS,SAAqB;AACnC,SAAOC,MAAAA,WAAW,UAAU,EAAE;AAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunpeak",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.21",
|
|
4
4
|
"description": "Local-first MCP Apps framework. Quickstart, build, test, and ship your Claude Connector or ChatGPT App!",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -43,16 +43,28 @@
|
|
|
43
43
|
"default": "./dist/mcp/index.js"
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
+
"./host": {
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./dist/host/index.d.ts",
|
|
49
|
+
"default": "./dist/host/index.js"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"./host/chatgpt": {
|
|
53
|
+
"import": {
|
|
54
|
+
"types": "./dist/host/chatgpt/index.d.ts",
|
|
55
|
+
"default": "./dist/host/chatgpt/index.js"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
46
58
|
"./platform": {
|
|
47
59
|
"import": {
|
|
48
|
-
"types": "./dist/
|
|
49
|
-
"default": "./dist/
|
|
60
|
+
"types": "./dist/host/index.d.ts",
|
|
61
|
+
"default": "./dist/host/index.js"
|
|
50
62
|
}
|
|
51
63
|
},
|
|
52
64
|
"./platform/chatgpt": {
|
|
53
65
|
"import": {
|
|
54
|
-
"types": "./dist/
|
|
55
|
-
"default": "./dist/
|
|
66
|
+
"types": "./dist/host/chatgpt/index.d.ts",
|
|
67
|
+
"default": "./dist/host/chatgpt/index.js"
|
|
56
68
|
}
|
|
57
69
|
},
|
|
58
70
|
"./package.json": "./package.json"
|
|
@@ -94,10 +106,10 @@
|
|
|
94
106
|
},
|
|
95
107
|
"dependencies": {
|
|
96
108
|
"@clack/prompts": "^1.1.0",
|
|
97
|
-
"@modelcontextprotocol/ext-apps": "^1.2.
|
|
109
|
+
"@modelcontextprotocol/ext-apps": "^1.2.2",
|
|
98
110
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
99
111
|
"clsx": "^2.1.1",
|
|
100
|
-
"esbuild": "^0.27.
|
|
112
|
+
"esbuild": "^0.27.4",
|
|
101
113
|
"tailwind-merge": "^3.5.0",
|
|
102
114
|
"zod": "^4.3.6"
|
|
103
115
|
},
|
|
@@ -106,17 +118,17 @@
|
|
|
106
118
|
"@testing-library/jest-dom": "^6.9.1",
|
|
107
119
|
"@testing-library/react": "^16.3.2",
|
|
108
120
|
"@testing-library/user-event": "^14.6.1",
|
|
109
|
-
"@types/node": "^
|
|
121
|
+
"@types/node": "^25.5.0",
|
|
110
122
|
"@types/react": "^19.2.14",
|
|
111
123
|
"@types/react-dom": "^19.2.3",
|
|
112
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
113
|
-
"@typescript-eslint/parser": "^8.
|
|
114
|
-
"@vitejs/plugin-react": "^
|
|
124
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
125
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
126
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
115
127
|
"eslint": "^9.39.4",
|
|
116
128
|
"eslint-config-prettier": "^10.1.8",
|
|
117
129
|
"eslint-plugin-react": "^7.37.5",
|
|
118
130
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
119
|
-
"jsdom": "^
|
|
131
|
+
"jsdom": "^29.0.0",
|
|
120
132
|
"prettier": "^3.8.1",
|
|
121
133
|
"react": "^19.2.4",
|
|
122
134
|
"react-dom": "^19.2.4",
|
|
@@ -126,7 +138,7 @@
|
|
|
126
138
|
"typescript": "^5.9.3",
|
|
127
139
|
"vite": "^7.3.1",
|
|
128
140
|
"vite-plugin-dts": "^4.5.4",
|
|
129
|
-
"vitest": "^4.0
|
|
141
|
+
"vitest": "^4.1.0"
|
|
130
142
|
},
|
|
131
143
|
"repository": {
|
|
132
144
|
"type": "git",
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@7.3.1_@types+node@
|
|
13
|
+
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.21.0/node_modules/vite/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.21.0/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@7.3.1_@types+node@
|
|
15
|
+
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.21.0/node_modules/vite/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.21.0/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.0.
|
|
13
|
+
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.0_vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.21.0_/node_modules/vitest/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.0_vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.21.0_/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.0.
|
|
15
|
+
export NODE_PATH="/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.0_vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.21.0_/node_modules/vitest/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/vitest@4.1.0_@types+node@25.5.0_jsdom@29.0.0_vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_tsx@4.21.0_/node_modules:/home/runner/work/sunpeak/sunpeak/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
package/template/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"clsx": "^2.1.1",
|
|
15
15
|
"embla-carousel-react": "^8.6.0",
|
|
16
16
|
"embla-carousel-wheel-gestures": "^8.1.0",
|
|
17
|
-
"mapbox-gl": "^3.
|
|
17
|
+
"mapbox-gl": "^3.20.0",
|
|
18
18
|
"sunpeak": "workspace:*",
|
|
19
19
|
"tailwind-merge": "^3.5.0",
|
|
20
20
|
"zod": "^4.3.6"
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"@testing-library/jest-dom": "^6.9.1",
|
|
26
26
|
"@testing-library/react": "^16.3.2",
|
|
27
27
|
"@testing-library/user-event": "^14.6.1",
|
|
28
|
-
"@types/node": "^
|
|
28
|
+
"@types/node": "^25.5.0",
|
|
29
29
|
"@types/react": "^19.2.14",
|
|
30
30
|
"@types/react-dom": "^19.2.3",
|
|
31
|
-
"@vitejs/plugin-react": "^
|
|
32
|
-
"jsdom": "^
|
|
31
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
32
|
+
"jsdom": "^29.0.0",
|
|
33
33
|
"react": "^19.2.4",
|
|
34
34
|
"react-dom": "^19.2.4",
|
|
35
35
|
"tailwindcss": "^4.2.1",
|
|
36
36
|
"typescript": "^5.9.3",
|
|
37
37
|
"vite": "^7.3.1",
|
|
38
|
-
"vitest": "^4.0
|
|
38
|
+
"vitest": "^4.1.0"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BITfgMxk.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|