create-skybridge 0.0.0-cloudflare
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/dist/index.d.ts +1 -0
- package/dist/index.js +283 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +33 -0
- package/index.js +8 -0
- package/package.json +36 -0
- package/template/AGENTS.md +1 -0
- package/template/README.md +97 -0
- package/template/_gitignore +5 -0
- package/template/_headers +2 -0
- package/template/alpic.json +3 -0
- package/template/dist/_headers +2 -0
- package/template/dist/assets/.vite/manifest.json +24 -0
- package/template/dist/assets/assets/magic-8-ball-DWG75vr4.js +10 -0
- package/template/dist/assets/assets/modal-provider-BQ1zWEcc.js +18 -0
- package/template/dist/assets/assets/style-CH_mzOKc.css +2 -0
- package/template/dist/server/src/index.js +56 -0
- package/template/dist/server/src/index.js.map +1 -0
- package/template/dist/server/src/vite-manifest.js +24 -0
- package/template/dist/tsconfig.tsbuildinfo +1 -0
- package/template/dist/web/src/helpers.js +3 -0
- package/template/dist/web/src/helpers.js.map +1 -0
- package/template/dist/web/src/widgets/magic-8-ball.js +11 -0
- package/template/dist/web/src/widgets/magic-8-ball.js.map +1 -0
- package/template/node_modules/.bin/alpic +21 -0
- package/template/node_modules/.bin/browserslist +21 -0
- package/template/node_modules/.bin/esbuild +21 -0
- package/template/node_modules/.bin/jiti +21 -0
- package/template/node_modules/.bin/nodemon +21 -0
- package/template/node_modules/.bin/sb +21 -0
- package/template/node_modules/.bin/skybridge +21 -0
- package/template/node_modules/.bin/terser +21 -0
- package/template/node_modules/.bin/tsc +21 -0
- package/template/node_modules/.bin/tsserver +21 -0
- package/template/node_modules/.bin/tsx +21 -0
- package/template/node_modules/.bin/vite +21 -0
- package/template/node_modules/.bin/workerd +21 -0
- package/template/node_modules/.bin/wrangler +21 -0
- package/template/node_modules/.bin/wrangler2 +21 -0
- package/template/node_modules/.bin/yaml +21 -0
- package/template/node_modules/.cache/wrangler/wrangler-account.json +6 -0
- package/template/node_modules/.mf/cf.json +1 -0
- package/template/node_modules/.vite/deps/_metadata.json +76 -0
- package/template/node_modules/.vite/deps/chunk-5WRI5ZAA.js +30 -0
- package/template/node_modules/.vite/deps/chunk-5WRI5ZAA.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-MEVQY4YB.js +991 -0
- package/template/node_modules/.vite/deps/chunk-MEVQY4YB.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-RKAOJUND.js +279 -0
- package/template/node_modules/.vite/deps/chunk-RKAOJUND.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-V2LKO732.js +267 -0
- package/template/node_modules/.vite/deps/chunk-V2LKO732.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-VNABIVRN.js +20196 -0
- package/template/node_modules/.vite/deps/chunk-VNABIVRN.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-YNOAPT43.js +634 -0
- package/template/node_modules/.vite/deps/chunk-YNOAPT43.js.map +7 -0
- package/template/node_modules/.vite/deps/lib-355XMAFY.js +56976 -0
- package/template/node_modules/.vite/deps/lib-355XMAFY.js.map +7 -0
- package/template/node_modules/.vite/deps/modal-provider-67CS7MKL.js +62 -0
- package/template/node_modules/.vite/deps/modal-provider-67CS7MKL.js.map +7 -0
- package/template/node_modules/.vite/deps/node_fs-3RO563AW.js +18 -0
- package/template/node_modules/.vite/deps/node_fs-3RO563AW.js.map +7 -0
- package/template/node_modules/.vite/deps/node_path-5FHEC5YD.js +18 -0
- package/template/node_modules/.vite/deps/node_path-5FHEC5YD.js.map +7 -0
- package/template/node_modules/.vite/deps/package.json +3 -0
- package/template/node_modules/.vite/deps/react-dom.js +6 -0
- package/template/node_modules/.vite/deps/react-dom.js.map +7 -0
- package/template/node_modules/.vite/deps/react-dom_client.js +7 -0
- package/template/node_modules/.vite/deps/react-dom_client.js.map +7 -0
- package/template/node_modules/.vite/deps/react.js +5 -0
- package/template/node_modules/.vite/deps/react.js.map +7 -0
- package/template/node_modules/.vite/deps/react_jsx-dev-runtime.js +265 -0
- package/template/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
- package/template/node_modules/.vite/deps/react_jsx-runtime.js +6 -0
- package/template/node_modules/.vite/deps/react_jsx-runtime.js.map +7 -0
- package/template/node_modules/.vite/deps/skybridge_web.js +1508 -0
- package/template/node_modules/.vite/deps/skybridge_web.js.map +7 -0
- package/template/package.json +36 -0
- package/template/server/src/index.ts +67 -0
- package/template/server/src/vite-manifest.d.ts +2 -0
- package/template/tsconfig.json +9 -0
- package/template/web/dist/.vite/manifest.json +24 -0
- package/template/web/dist/assets/magic-8-ball-DWG75vr4.js +10 -0
- package/template/web/dist/assets/modal-provider-BQ1zWEcc.js +18 -0
- package/template/web/dist/assets/style-CH_mzOKc.css +2 -0
- package/template/web/src/helpers.ts +4 -0
- package/template/web/src/index.css +154 -0
- package/template/web/src/widgets/magic-8-ball.tsx +27 -0
- package/template/web/vite.config.ts +15 -0
- package/template/wrangler.jsonc +12 -0
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_react
|
|
3
|
+
} from "./chunk-MEVQY4YB.js";
|
|
4
|
+
import {
|
|
5
|
+
__toESM
|
|
6
|
+
} from "./chunk-5WRI5ZAA.js";
|
|
7
|
+
|
|
8
|
+
// ../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/dist/web/bridges/apps-sdk/types.js
|
|
9
|
+
var TOOL_RESPONSE_EVENT_TYPE = "openai:tool_response";
|
|
10
|
+
var SET_GLOBALS_EVENT_TYPE = "openai:set_globals";
|
|
11
|
+
var SetGlobalsEvent = class extends CustomEvent {
|
|
12
|
+
type = SET_GLOBALS_EVENT_TYPE;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// ../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/dist/web/bridges/apps-sdk/bridge.js
|
|
16
|
+
var AppsSdkBridge = class _AppsSdkBridge {
|
|
17
|
+
static instance = null;
|
|
18
|
+
static getInstance() {
|
|
19
|
+
if (window.skybridge.hostType !== "apps-sdk" || window.openai === void 0) {
|
|
20
|
+
throw new Error("Apps SDK Bridge can only be used in the apps-sdk runtime");
|
|
21
|
+
}
|
|
22
|
+
if (_AppsSdkBridge.instance === null) {
|
|
23
|
+
_AppsSdkBridge.instance = new _AppsSdkBridge();
|
|
24
|
+
}
|
|
25
|
+
return _AppsSdkBridge.instance;
|
|
26
|
+
}
|
|
27
|
+
static resetInstance() {
|
|
28
|
+
if (_AppsSdkBridge.instance) {
|
|
29
|
+
_AppsSdkBridge.instance = null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
subscribe(keyOrKeys) {
|
|
33
|
+
const keys = Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];
|
|
34
|
+
return (onChange) => {
|
|
35
|
+
const handleSetGlobal = (event) => {
|
|
36
|
+
const hasRelevantChange = keys.some((key) => event.detail.globals[key] !== void 0);
|
|
37
|
+
if (!hasRelevantChange) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
onChange();
|
|
41
|
+
};
|
|
42
|
+
window.addEventListener(SET_GLOBALS_EVENT_TYPE, handleSetGlobal, {
|
|
43
|
+
passive: true
|
|
44
|
+
});
|
|
45
|
+
return () => {
|
|
46
|
+
window.removeEventListener(SET_GLOBALS_EVENT_TYPE, handleSetGlobal);
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
getSnapshot = (key) => {
|
|
51
|
+
if (window.openai === void 0) {
|
|
52
|
+
throw new Error(`window.openai is not available. Make sure you're calling the hook requiring ${key} within the OpenAI iFrame skybridge runtime.`);
|
|
53
|
+
}
|
|
54
|
+
return window.openai[key];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// ../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/dist/web/bridges/apps-sdk/adaptor.js
|
|
59
|
+
var AppsSdkAdaptor = class _AppsSdkAdaptor {
|
|
60
|
+
static instance = null;
|
|
61
|
+
static getInstance() {
|
|
62
|
+
if (!_AppsSdkAdaptor.instance) {
|
|
63
|
+
_AppsSdkAdaptor.instance = new _AppsSdkAdaptor();
|
|
64
|
+
}
|
|
65
|
+
return _AppsSdkAdaptor.instance;
|
|
66
|
+
}
|
|
67
|
+
static resetInstance() {
|
|
68
|
+
_AppsSdkAdaptor.instance = null;
|
|
69
|
+
}
|
|
70
|
+
getHostContextStore(key) {
|
|
71
|
+
const bridge = AppsSdkBridge.getInstance();
|
|
72
|
+
if (key === "widgetState") {
|
|
73
|
+
return {
|
|
74
|
+
subscribe: bridge.subscribe("widgetState"),
|
|
75
|
+
getSnapshot: () => bridge.getSnapshot("widgetState")?.modelContent ?? null
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
subscribe: bridge.subscribe(key),
|
|
80
|
+
getSnapshot: () => bridge.getSnapshot(key)
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
callTool = async (name, args) => {
|
|
84
|
+
return window.openai.callTool(name, args);
|
|
85
|
+
};
|
|
86
|
+
requestDisplayMode = (mode) => {
|
|
87
|
+
return window.openai.requestDisplayMode({ mode });
|
|
88
|
+
};
|
|
89
|
+
sendFollowUpMessage = (prompt) => {
|
|
90
|
+
return window.openai.sendFollowUpMessage({ prompt });
|
|
91
|
+
};
|
|
92
|
+
openExternal(href) {
|
|
93
|
+
window.openai.openExternal({ href });
|
|
94
|
+
}
|
|
95
|
+
setWidgetState = (stateOrUpdater) => {
|
|
96
|
+
const modelContent = typeof stateOrUpdater === "function" ? stateOrUpdater(window.openai.widgetState?.modelContent ?? null) : stateOrUpdater;
|
|
97
|
+
return window.openai.setWidgetState({ modelContent });
|
|
98
|
+
};
|
|
99
|
+
uploadFile = (file) => {
|
|
100
|
+
return window.openai.uploadFile(file).then(async (metadata) => {
|
|
101
|
+
const state = window.openai.widgetState ? { ...window.openai.widgetState } : { modelContent: {} };
|
|
102
|
+
if (!state.imageIds) {
|
|
103
|
+
state.imageIds = [];
|
|
104
|
+
}
|
|
105
|
+
state.imageIds.push(metadata.fileId);
|
|
106
|
+
await window.openai.setWidgetState(state);
|
|
107
|
+
return metadata;
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
getFileDownloadUrl = (file) => {
|
|
111
|
+
return window.openai.getFileDownloadUrl(file);
|
|
112
|
+
};
|
|
113
|
+
openModal(options) {
|
|
114
|
+
return window.openai.requestModal(options);
|
|
115
|
+
}
|
|
116
|
+
setOpenInAppUrl(href) {
|
|
117
|
+
href = href.trim();
|
|
118
|
+
if (!href) {
|
|
119
|
+
throw new Error("The href parameter is required.");
|
|
120
|
+
}
|
|
121
|
+
const serverUrl = window.skybridge.serverUrl;
|
|
122
|
+
if (!serverUrl) {
|
|
123
|
+
throw new Error("The widgetDomain property has not been set on the widget resource meta object.");
|
|
124
|
+
}
|
|
125
|
+
const domainUrl = new URL(serverUrl);
|
|
126
|
+
const hrefUrl = new URL(href, serverUrl);
|
|
127
|
+
if (domainUrl.origin !== hrefUrl.origin) {
|
|
128
|
+
throw new Error("Provided href is not compatible with widget domain: origin differs");
|
|
129
|
+
}
|
|
130
|
+
return window.openai.setOpenInAppUrl({ href });
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// ../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/dist/web/bridges/apps-sdk/use-apps-sdk-context.js
|
|
135
|
+
var import_react = __toESM(require_react(), 1);
|
|
136
|
+
function useAppsSdkContext(key) {
|
|
137
|
+
const bridge = AppsSdkBridge.getInstance();
|
|
138
|
+
return (0, import_react.useSyncExternalStore)(bridge.subscribe(key), () => bridge.getSnapshot(key));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// ../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/dist/web/bridges/mcp-app/bridge.js
|
|
142
|
+
var LATEST_PROTOCOL_VERSION = "2025-11-21";
|
|
143
|
+
var JsonRpcErrorCode;
|
|
144
|
+
(function(JsonRpcErrorCode2) {
|
|
145
|
+
JsonRpcErrorCode2[JsonRpcErrorCode2["ParseError"] = -32700] = "ParseError";
|
|
146
|
+
JsonRpcErrorCode2[JsonRpcErrorCode2["InvalidRequest"] = -32600] = "InvalidRequest";
|
|
147
|
+
JsonRpcErrorCode2[JsonRpcErrorCode2["MethodNotFound"] = -32601] = "MethodNotFound";
|
|
148
|
+
JsonRpcErrorCode2[JsonRpcErrorCode2["InvalidParams"] = -32602] = "InvalidParams";
|
|
149
|
+
JsonRpcErrorCode2[JsonRpcErrorCode2["InternalError"] = -32603] = "InternalError";
|
|
150
|
+
})(JsonRpcErrorCode || (JsonRpcErrorCode = {}));
|
|
151
|
+
var McpAppBridge = class _McpAppBridge {
|
|
152
|
+
static instance = null;
|
|
153
|
+
context = {
|
|
154
|
+
toolInput: null,
|
|
155
|
+
toolCancelled: null,
|
|
156
|
+
toolResult: null
|
|
157
|
+
};
|
|
158
|
+
listeners = /* @__PURE__ */ new Map();
|
|
159
|
+
pendingRequests = /* @__PURE__ */ new Map();
|
|
160
|
+
nextId = 1;
|
|
161
|
+
initialized;
|
|
162
|
+
appInitializationOptions;
|
|
163
|
+
requestTimeout;
|
|
164
|
+
cleanupSizeObserver = null;
|
|
165
|
+
constructor(options, requestTimeout = 1e4) {
|
|
166
|
+
this.requestTimeout = requestTimeout;
|
|
167
|
+
this.initialized = false;
|
|
168
|
+
this.appInitializationOptions = {
|
|
169
|
+
appInfo: options.appInfo,
|
|
170
|
+
appCapabilities: {},
|
|
171
|
+
protocolVersion: LATEST_PROTOCOL_VERSION
|
|
172
|
+
};
|
|
173
|
+
this.init();
|
|
174
|
+
}
|
|
175
|
+
static getInstance(options, requestTimeout) {
|
|
176
|
+
if (window.skybridge.hostType !== "mcp-app") {
|
|
177
|
+
throw new Error("MCP App Bridge can only be used in the mcp-app runtime");
|
|
178
|
+
}
|
|
179
|
+
if (_McpAppBridge.instance && (options || requestTimeout)) {
|
|
180
|
+
console.warn("McpAppBridge.getInstance: options and requestTimeout ignored, instance already exists");
|
|
181
|
+
}
|
|
182
|
+
if (!_McpAppBridge.instance) {
|
|
183
|
+
const defaultOptions = {
|
|
184
|
+
appInfo: { name: "skybridge-app", version: "0.0.1" }
|
|
185
|
+
};
|
|
186
|
+
_McpAppBridge.instance = new _McpAppBridge({ ...defaultOptions, ...options }, requestTimeout);
|
|
187
|
+
}
|
|
188
|
+
return _McpAppBridge.instance;
|
|
189
|
+
}
|
|
190
|
+
subscribe(keyOrKeys) {
|
|
191
|
+
const keys = Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];
|
|
192
|
+
return (onChange) => {
|
|
193
|
+
for (const key of keys) {
|
|
194
|
+
this.listeners.set(key, /* @__PURE__ */ new Set([...this.listeners.get(key) || [], onChange]));
|
|
195
|
+
}
|
|
196
|
+
return () => {
|
|
197
|
+
for (const key of keys) {
|
|
198
|
+
this.listeners.get(key)?.delete(onChange);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
getSnapshot(key) {
|
|
204
|
+
return this.context[key];
|
|
205
|
+
}
|
|
206
|
+
cleanup = () => {
|
|
207
|
+
window.removeEventListener("message", this.handleMessage);
|
|
208
|
+
this.pendingRequests.forEach((request) => {
|
|
209
|
+
clearTimeout(request.timeout);
|
|
210
|
+
});
|
|
211
|
+
this.pendingRequests.clear();
|
|
212
|
+
this.listeners.clear();
|
|
213
|
+
this.cleanupSizeObserver?.();
|
|
214
|
+
this.cleanupSizeObserver = null;
|
|
215
|
+
};
|
|
216
|
+
static resetInstance() {
|
|
217
|
+
if (_McpAppBridge.instance) {
|
|
218
|
+
_McpAppBridge.instance.cleanup();
|
|
219
|
+
_McpAppBridge.instance = null;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
request({ method, params }) {
|
|
223
|
+
const id = this.nextId++;
|
|
224
|
+
const { promise, resolve, reject } = Promise.withResolvers();
|
|
225
|
+
this.pendingRequests.set(id, {
|
|
226
|
+
resolve,
|
|
227
|
+
reject,
|
|
228
|
+
timeout: setTimeout(() => {
|
|
229
|
+
reject(new Error("Request timed out"));
|
|
230
|
+
this.pendingRequests.delete(id);
|
|
231
|
+
}, this.requestTimeout)
|
|
232
|
+
});
|
|
233
|
+
window.parent.postMessage({ jsonrpc: "2.0", id, method, params }, "*");
|
|
234
|
+
return promise;
|
|
235
|
+
}
|
|
236
|
+
emit(key) {
|
|
237
|
+
this.listeners.get(key)?.forEach((listener) => {
|
|
238
|
+
listener();
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
updateContext(context) {
|
|
242
|
+
this.context = { ...this.context, ...context };
|
|
243
|
+
for (const key of Object.keys(context)) {
|
|
244
|
+
this.emit(key);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
init() {
|
|
248
|
+
if (this.initialized) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
this.initialized = true;
|
|
252
|
+
if (typeof window === "undefined" || window.parent === window) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
window.addEventListener("message", this.handleMessage);
|
|
256
|
+
this.connect();
|
|
257
|
+
}
|
|
258
|
+
handleMessage = (event) => {
|
|
259
|
+
const data = event.data;
|
|
260
|
+
if (data.jsonrpc !== "2.0") {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if ("id" in data) {
|
|
264
|
+
if ("method" in data) {
|
|
265
|
+
this.handleRequest(data);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
this.handleResponse(data);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
this.handleNotification(data);
|
|
272
|
+
};
|
|
273
|
+
handleResponse(response) {
|
|
274
|
+
const request = this.pendingRequests.get(response.id);
|
|
275
|
+
if (request) {
|
|
276
|
+
clearTimeout(request.timeout);
|
|
277
|
+
this.pendingRequests.delete(response.id);
|
|
278
|
+
if ("error" in response) {
|
|
279
|
+
request.reject(new Error(response.error.message));
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
request.resolve(response.result);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
handleNotification = (notification) => {
|
|
286
|
+
switch (notification.method) {
|
|
287
|
+
case "ui/notifications/host-context-changed":
|
|
288
|
+
this.updateContext(notification.params);
|
|
289
|
+
return;
|
|
290
|
+
case "ui/notifications/tool-input-partial":
|
|
291
|
+
this.updateContext({
|
|
292
|
+
toolInput: notification.params.arguments ?? {}
|
|
293
|
+
});
|
|
294
|
+
return;
|
|
295
|
+
case "ui/notifications/tool-input":
|
|
296
|
+
this.updateContext({
|
|
297
|
+
toolInput: notification.params.arguments ?? {}
|
|
298
|
+
});
|
|
299
|
+
return;
|
|
300
|
+
case "ui/notifications/tool-result":
|
|
301
|
+
this.updateContext({
|
|
302
|
+
toolResult: notification.params
|
|
303
|
+
});
|
|
304
|
+
return;
|
|
305
|
+
case "ui/notifications/tool-cancelled":
|
|
306
|
+
this.updateContext({
|
|
307
|
+
toolCancelled: notification.params
|
|
308
|
+
});
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
handleRequest = (request) => {
|
|
313
|
+
switch (request.method) {
|
|
314
|
+
case "ui/resource-teardown":
|
|
315
|
+
this.cleanup();
|
|
316
|
+
window.parent.postMessage({
|
|
317
|
+
jsonrpc: "2.0",
|
|
318
|
+
id: request.id,
|
|
319
|
+
result: {}
|
|
320
|
+
}, "*");
|
|
321
|
+
return;
|
|
322
|
+
default:
|
|
323
|
+
window.parent.postMessage({
|
|
324
|
+
jsonrpc: "2.0",
|
|
325
|
+
id: request.id,
|
|
326
|
+
error: {
|
|
327
|
+
code: JsonRpcErrorCode.MethodNotFound,
|
|
328
|
+
message: "Unsupported Request"
|
|
329
|
+
}
|
|
330
|
+
}, "*");
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
async connect() {
|
|
334
|
+
try {
|
|
335
|
+
const result = await this.request({
|
|
336
|
+
method: "ui/initialize",
|
|
337
|
+
params: this.appInitializationOptions
|
|
338
|
+
});
|
|
339
|
+
this.updateContext(result.hostContext);
|
|
340
|
+
this.notify({ method: "ui/notifications/initialized" });
|
|
341
|
+
this.cleanupSizeObserver = this.setupSizeChangedNotifications();
|
|
342
|
+
} catch (err) {
|
|
343
|
+
console.error(err);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
notify(notification) {
|
|
347
|
+
window.parent.postMessage({ jsonrpc: "2.0", ...notification }, "*");
|
|
348
|
+
}
|
|
349
|
+
sendSizeChanged(params) {
|
|
350
|
+
this.notify({ method: "ui/notifications/size-changed", params });
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Set up automatic size change notifications using ResizeObserver.
|
|
354
|
+
* Based on @modelcontextprotocol/ext-apps App.setupSizeChangedNotifications
|
|
355
|
+
* @see https://github.com/modelcontextprotocol/ext-apps/blob/main/src/app.ts#L940-L989
|
|
356
|
+
*/
|
|
357
|
+
setupSizeChangedNotifications() {
|
|
358
|
+
let scheduled = false;
|
|
359
|
+
let lastWidth = 0;
|
|
360
|
+
let lastHeight = 0;
|
|
361
|
+
const sendBodySizeChanged = () => {
|
|
362
|
+
if (scheduled) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
scheduled = true;
|
|
366
|
+
requestAnimationFrame(() => {
|
|
367
|
+
scheduled = false;
|
|
368
|
+
let width;
|
|
369
|
+
let height;
|
|
370
|
+
if (this.context.displayMode === "fullscreen") {
|
|
371
|
+
width = window.innerWidth;
|
|
372
|
+
height = window.innerHeight;
|
|
373
|
+
} else {
|
|
374
|
+
const body = document.body;
|
|
375
|
+
width = Math.ceil(body.scrollWidth);
|
|
376
|
+
height = Math.ceil(body.scrollHeight);
|
|
377
|
+
}
|
|
378
|
+
if (width !== lastWidth || height !== lastHeight) {
|
|
379
|
+
lastWidth = width;
|
|
380
|
+
lastHeight = height;
|
|
381
|
+
this.sendSizeChanged({ width, height });
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
};
|
|
385
|
+
sendBodySizeChanged();
|
|
386
|
+
const resizeObserver = new ResizeObserver(sendBodySizeChanged);
|
|
387
|
+
resizeObserver.observe(document.documentElement);
|
|
388
|
+
resizeObserver.observe(document.body);
|
|
389
|
+
return () => resizeObserver.disconnect();
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
// ../../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/lite/index.mjs
|
|
394
|
+
var has = Object.prototype.hasOwnProperty;
|
|
395
|
+
function dequal(foo, bar) {
|
|
396
|
+
var ctor, len;
|
|
397
|
+
if (foo === bar) return true;
|
|
398
|
+
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
|
|
399
|
+
if (ctor === Date) return foo.getTime() === bar.getTime();
|
|
400
|
+
if (ctor === RegExp) return foo.toString() === bar.toString();
|
|
401
|
+
if (ctor === Array) {
|
|
402
|
+
if ((len = foo.length) === bar.length) {
|
|
403
|
+
while (len-- && dequal(foo[len], bar[len])) ;
|
|
404
|
+
}
|
|
405
|
+
return len === -1;
|
|
406
|
+
}
|
|
407
|
+
if (!ctor || typeof foo === "object") {
|
|
408
|
+
len = 0;
|
|
409
|
+
for (ctor in foo) {
|
|
410
|
+
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
411
|
+
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
|
|
412
|
+
}
|
|
413
|
+
return Object.keys(bar).length === len;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return foo !== foo && bar !== bar;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// ../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/dist/web/bridges/mcp-app/adaptor.js
|
|
420
|
+
var McpAppAdaptor = class _McpAppAdaptor {
|
|
421
|
+
static instance = null;
|
|
422
|
+
stores;
|
|
423
|
+
_widgetState = null;
|
|
424
|
+
widgetStateListeners = /* @__PURE__ */ new Set();
|
|
425
|
+
_viewState = {
|
|
426
|
+
mode: "inline"
|
|
427
|
+
};
|
|
428
|
+
viewListeners = /* @__PURE__ */ new Set();
|
|
429
|
+
constructor() {
|
|
430
|
+
this.stores = this.initializeStores();
|
|
431
|
+
}
|
|
432
|
+
static getInstance() {
|
|
433
|
+
if (!_McpAppAdaptor.instance) {
|
|
434
|
+
_McpAppAdaptor.instance = new _McpAppAdaptor();
|
|
435
|
+
}
|
|
436
|
+
return _McpAppAdaptor.instance;
|
|
437
|
+
}
|
|
438
|
+
static resetInstance() {
|
|
439
|
+
_McpAppAdaptor.instance = null;
|
|
440
|
+
}
|
|
441
|
+
getHostContextStore(key) {
|
|
442
|
+
return this.stores[key];
|
|
443
|
+
}
|
|
444
|
+
callTool = async (name, args) => {
|
|
445
|
+
const bridge = McpAppBridge.getInstance();
|
|
446
|
+
const response = await bridge.request({
|
|
447
|
+
method: "tools/call",
|
|
448
|
+
params: {
|
|
449
|
+
name,
|
|
450
|
+
arguments: args ?? void 0
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
const result = response.content.filter((content) => content.type === "text").map(({ text }) => text).join("\n");
|
|
454
|
+
return {
|
|
455
|
+
content: response.content,
|
|
456
|
+
structuredContent: response.structuredContent ?? {},
|
|
457
|
+
isError: response.isError ?? false,
|
|
458
|
+
result,
|
|
459
|
+
meta: response._meta ?? {}
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
requestDisplayMode = (mode) => {
|
|
463
|
+
const bridge = McpAppBridge.getInstance();
|
|
464
|
+
if (mode !== "modal") {
|
|
465
|
+
return bridge.request({
|
|
466
|
+
method: "ui/request-display-mode",
|
|
467
|
+
params: { mode }
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
throw new Error("Modal display mode is not accessible in MCP App.");
|
|
471
|
+
};
|
|
472
|
+
sendFollowUpMessage = async (prompt) => {
|
|
473
|
+
const bridge = McpAppBridge.getInstance();
|
|
474
|
+
await bridge.request({
|
|
475
|
+
method: "ui/message",
|
|
476
|
+
params: {
|
|
477
|
+
role: "user",
|
|
478
|
+
content: [
|
|
479
|
+
{
|
|
480
|
+
type: "text",
|
|
481
|
+
text: prompt
|
|
482
|
+
}
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
};
|
|
487
|
+
openExternal(href) {
|
|
488
|
+
const bridge = McpAppBridge.getInstance();
|
|
489
|
+
bridge.request({
|
|
490
|
+
method: "ui/open-link",
|
|
491
|
+
params: { url: href }
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
initializeStores() {
|
|
495
|
+
return {
|
|
496
|
+
theme: this.createHostContextStore(["theme"], ({ theme }) => theme ?? "light"),
|
|
497
|
+
locale: this.createHostContextStore(["locale"], ({ locale }) => locale ?? "en-US"),
|
|
498
|
+
safeArea: this.createHostContextStore(["safeAreaInsets"], ({ safeAreaInsets }) => ({
|
|
499
|
+
insets: safeAreaInsets ?? { top: 0, right: 0, bottom: 0, left: 0 }
|
|
500
|
+
})),
|
|
501
|
+
displayMode: this.createHostContextStore(["displayMode"], ({ displayMode }) => displayMode ?? "inline"),
|
|
502
|
+
maxHeight: this.createHostContextStore(["containerDimensions"], ({ containerDimensions }) => {
|
|
503
|
+
if (containerDimensions && "maxHeight" in containerDimensions) {
|
|
504
|
+
return containerDimensions.maxHeight;
|
|
505
|
+
}
|
|
506
|
+
return void 0;
|
|
507
|
+
}),
|
|
508
|
+
userAgent: this.createHostContextStore(["platform", "deviceCapabilities"], ({ platform, deviceCapabilities }) => ({
|
|
509
|
+
device: {
|
|
510
|
+
type: platform === "web" ? "desktop" : platform ?? "unknown"
|
|
511
|
+
},
|
|
512
|
+
capabilities: {
|
|
513
|
+
hover: true,
|
|
514
|
+
touch: true,
|
|
515
|
+
...deviceCapabilities
|
|
516
|
+
}
|
|
517
|
+
})),
|
|
518
|
+
toolInput: this.createHostContextStore(["toolInput"], ({ toolInput }) => toolInput ?? null),
|
|
519
|
+
toolOutput: this.createHostContextStore(["toolResult"], ({ toolResult }) => toolResult?.structuredContent ?? null),
|
|
520
|
+
toolResponseMetadata: this.createHostContextStore(["toolResult"], ({ toolResult }) => toolResult?._meta ?? null),
|
|
521
|
+
view: {
|
|
522
|
+
subscribe: (onChange) => {
|
|
523
|
+
this.viewListeners.add(onChange);
|
|
524
|
+
return () => {
|
|
525
|
+
this.viewListeners.delete(onChange);
|
|
526
|
+
};
|
|
527
|
+
},
|
|
528
|
+
getSnapshot: () => this._viewState
|
|
529
|
+
},
|
|
530
|
+
widgetState: {
|
|
531
|
+
subscribe: (onChange) => {
|
|
532
|
+
this.widgetStateListeners.add(onChange);
|
|
533
|
+
return () => {
|
|
534
|
+
this.widgetStateListeners.delete(onChange);
|
|
535
|
+
};
|
|
536
|
+
},
|
|
537
|
+
getSnapshot: () => this._widgetState
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
setWidgetState = async (stateOrUpdater) => {
|
|
542
|
+
const newState = typeof stateOrUpdater === "function" ? stateOrUpdater(this._widgetState) : stateOrUpdater;
|
|
543
|
+
this._widgetState = newState;
|
|
544
|
+
this.widgetStateListeners.forEach((listener) => {
|
|
545
|
+
listener();
|
|
546
|
+
});
|
|
547
|
+
const bridge = McpAppBridge.getInstance();
|
|
548
|
+
await bridge.request({
|
|
549
|
+
method: "ui/update-model-context",
|
|
550
|
+
params: {
|
|
551
|
+
structuredContent: newState,
|
|
552
|
+
content: [{ type: "text", text: JSON.stringify(newState) }]
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
};
|
|
556
|
+
/**
|
|
557
|
+
* @throws File upload is not supported in MCP App.
|
|
558
|
+
*/
|
|
559
|
+
uploadFile() {
|
|
560
|
+
throw new Error("File upload is not supported in MCP App.");
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* @throws File download is not supported in MCP App.
|
|
564
|
+
*/
|
|
565
|
+
getFileDownloadUrl() {
|
|
566
|
+
throw new Error("File download is not supported in MCP App.");
|
|
567
|
+
}
|
|
568
|
+
openModal(options) {
|
|
569
|
+
this._viewState = { mode: "modal", params: options.params };
|
|
570
|
+
this.viewListeners.forEach((listener) => {
|
|
571
|
+
listener();
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
closeModal() {
|
|
575
|
+
this._viewState = { mode: "inline" };
|
|
576
|
+
this.viewListeners.forEach((listener) => {
|
|
577
|
+
listener();
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
setOpenInAppUrl(_href) {
|
|
581
|
+
throw new Error("setOpenInAppUrl is not implemented in MCP App.");
|
|
582
|
+
}
|
|
583
|
+
createHostContextStore(keys, computeSnapshot) {
|
|
584
|
+
const bridge = McpAppBridge.getInstance();
|
|
585
|
+
let cachedValue;
|
|
586
|
+
return {
|
|
587
|
+
subscribe: bridge.subscribe(keys),
|
|
588
|
+
getSnapshot: () => {
|
|
589
|
+
const context = Object.fromEntries(keys.map((k) => [k, bridge.getSnapshot(k)]));
|
|
590
|
+
const newValue = computeSnapshot(context);
|
|
591
|
+
if (cachedValue !== void 0 && dequal(cachedValue, newValue)) {
|
|
592
|
+
return cachedValue;
|
|
593
|
+
}
|
|
594
|
+
cachedValue = newValue;
|
|
595
|
+
return newValue;
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
// ../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/dist/web/bridges/get-adaptor.js
|
|
602
|
+
var getAdaptor = () => {
|
|
603
|
+
return window.skybridge.hostType === "apps-sdk" ? AppsSdkAdaptor.getInstance() : McpAppAdaptor.getInstance();
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
// ../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/dist/web/bridges/mcp-app/use-mcp-app-context.js
|
|
607
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
608
|
+
function useMcpAppContext(key, options, requestTimeout) {
|
|
609
|
+
const bridge = McpAppBridge.getInstance(options, requestTimeout);
|
|
610
|
+
return (0, import_react2.useSyncExternalStore)(bridge.subscribe(key), () => bridge.getSnapshot(key));
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// ../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/dist/web/bridges/use-host-context.js
|
|
614
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
615
|
+
var useHostContext = (key) => {
|
|
616
|
+
const adaptor = getAdaptor();
|
|
617
|
+
const store = adaptor.getHostContextStore(key);
|
|
618
|
+
return (0, import_react3.useSyncExternalStore)(store.subscribe, store.getSnapshot);
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
export {
|
|
622
|
+
TOOL_RESPONSE_EVENT_TYPE,
|
|
623
|
+
SET_GLOBALS_EVENT_TYPE,
|
|
624
|
+
SetGlobalsEvent,
|
|
625
|
+
AppsSdkBridge,
|
|
626
|
+
AppsSdkAdaptor,
|
|
627
|
+
useAppsSdkContext,
|
|
628
|
+
McpAppBridge,
|
|
629
|
+
McpAppAdaptor,
|
|
630
|
+
getAdaptor,
|
|
631
|
+
useMcpAppContext,
|
|
632
|
+
useHostContext
|
|
633
|
+
};
|
|
634
|
+
//# sourceMappingURL=chunk-YNOAPT43.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/src/web/bridges/apps-sdk/types.ts", "../../../../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/src/web/bridges/apps-sdk/bridge.ts", "../../../../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/src/web/bridges/apps-sdk/adaptor.ts", "../../../../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/src/web/bridges/apps-sdk/use-apps-sdk-context.ts", "../../../../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/src/web/bridges/mcp-app/bridge.ts", "../../../../../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/lite/index.mjs", "../../../../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/src/web/bridges/mcp-app/adaptor.ts", "../../../../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/src/web/bridges/get-adaptor.ts", "../../../../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/src/web/bridges/mcp-app/use-mcp-app-context.ts", "../../../../../../node_modules/.pnpm/skybridge@0.32.0_@modelcontextprotocol+sdk@1.27.1_zod@4.3.6__@skybridge+devtools@0.32.0_8c938528707c936d391357462b94034d/node_modules/skybridge/src/web/bridges/use-host-context.ts"],
|
|
4
|
+
"sourcesContent": [null, null, null, null, null, "var has = Object.prototype.hasOwnProperty;\n\nexport function dequal(foo, bar) {\n\tvar ctor, len;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n", null, null, null, null],
|
|
5
|
+
"mappings": ";;;;;;;;AAeO,IAAM,2BAA2B;AA8FjC,IAAM,yBAAyB;AAChC,IAAO,kBAAP,cAA+B,YAEnC;EACkB,OAAO;;;;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