skybridge 0.0.0-dev.e341b6a → 0.0.0-dev.e378aa9
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 +178 -0
- package/dist/cli/detect-port.d.ts +18 -0
- package/dist/cli/detect-port.js +61 -0
- package/dist/cli/detect-port.js.map +1 -0
- package/dist/cli/header.d.ts +4 -0
- package/dist/cli/header.js +6 -0
- package/dist/cli/header.js.map +1 -0
- package/dist/cli/run-command.d.ts +2 -0
- package/dist/cli/run-command.js +43 -0
- package/dist/cli/run-command.js.map +1 -0
- package/dist/cli/telemetry.d.ts +7 -0
- package/dist/cli/telemetry.js +123 -0
- package/dist/cli/telemetry.js.map +1 -0
- package/dist/cli/tunnel-control-server.d.ts +9 -0
- package/dist/cli/tunnel-control-server.js +31 -0
- package/dist/cli/tunnel-control-server.js.map +1 -0
- package/dist/cli/tunnel-control-server.test.js +39 -0
- package/dist/cli/tunnel-control-server.test.js.map +1 -0
- package/dist/cli/tunnel-handler.d.ts +3 -0
- package/dist/cli/tunnel-handler.js +48 -0
- package/dist/cli/tunnel-handler.js.map +1 -0
- package/dist/cli/tunnel-handler.test.js +105 -0
- package/dist/cli/tunnel-handler.test.js.map +1 -0
- package/dist/cli/tunnel.d.ts +57 -0
- package/dist/cli/tunnel.js +154 -0
- package/dist/cli/tunnel.js.map +1 -0
- package/dist/cli/tunnel.test.js +190 -0
- package/dist/cli/tunnel.test.js.map +1 -0
- package/dist/cli/types.d.ts +5 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/use-execute-steps.d.ts +11 -0
- package/dist/cli/use-execute-steps.js +36 -0
- package/dist/cli/use-execute-steps.js.map +1 -0
- package/dist/cli/use-messages.d.ts +3 -0
- package/dist/cli/use-messages.js +11 -0
- package/dist/cli/use-messages.js.map +1 -0
- package/dist/cli/use-nodemon.d.ts +2 -0
- package/dist/cli/use-nodemon.js +64 -0
- package/dist/cli/use-nodemon.js.map +1 -0
- package/dist/cli/use-tunnel.d.ts +14 -0
- package/dist/cli/use-tunnel.js +131 -0
- package/dist/cli/use-tunnel.js.map +1 -0
- package/dist/cli/use-typescript-check.d.ts +9 -0
- package/dist/cli/use-typescript-check.js +94 -0
- package/dist/cli/use-typescript-check.js.map +1 -0
- package/dist/commands/build.d.ts +9 -0
- package/dist/commands/build.js +67 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/dev.d.ts +11 -0
- package/dist/commands/dev.js +73 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/start.d.ts +9 -0
- package/dist/commands/start.js +49 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/telemetry/disable.d.ts +5 -0
- package/dist/commands/telemetry/disable.js +14 -0
- package/dist/commands/telemetry/disable.js.map +1 -0
- package/dist/commands/telemetry/enable.d.ts +5 -0
- package/dist/commands/telemetry/enable.js +14 -0
- package/dist/commands/telemetry/enable.js.map +1 -0
- package/dist/commands/telemetry/status.d.ts +5 -0
- package/dist/commands/telemetry/status.js +14 -0
- package/dist/commands/telemetry/status.js.map +1 -0
- package/dist/server/asset-base-url-transform-plugin.d.ts +10 -0
- package/dist/server/asset-base-url-transform-plugin.js +33 -0
- package/dist/server/asset-base-url-transform-plugin.js.map +1 -0
- package/dist/server/asset-base-url-transform-plugin.test.d.ts +1 -0
- package/dist/server/asset-base-url-transform-plugin.test.js +84 -0
- package/dist/server/asset-base-url-transform-plugin.test.js.map +1 -0
- package/dist/server/content-helpers.d.ts +27 -0
- package/dist/server/content-helpers.js +46 -0
- package/dist/server/content-helpers.js.map +1 -0
- package/dist/server/content-helpers.test.d.ts +1 -0
- package/dist/server/content-helpers.test.js +70 -0
- package/dist/server/content-helpers.test.js.map +1 -0
- package/dist/server/express.d.ts +15 -0
- package/dist/server/express.js +95 -0
- package/dist/server/express.js.map +1 -0
- package/dist/server/express.test.d.ts +1 -0
- package/dist/server/express.test.js +348 -0
- package/dist/server/express.test.js.map +1 -0
- package/dist/server/index.d.ts +5 -3
- package/dist/server/index.js +3 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/inferUtilityTypes.d.ts +6 -6
- package/dist/server/metric.d.ts +14 -0
- package/dist/server/metric.js +62 -0
- package/dist/server/metric.js.map +1 -0
- package/dist/server/middleware.d.ts +124 -0
- package/dist/server/middleware.js +93 -0
- package/dist/server/middleware.js.map +1 -0
- package/dist/server/middleware.test-d.d.ts +1 -0
- package/dist/server/middleware.test-d.js +75 -0
- package/dist/server/middleware.test-d.js.map +1 -0
- package/dist/server/middleware.test.d.ts +1 -0
- package/dist/server/middleware.test.js +493 -0
- package/dist/server/middleware.test.js.map +1 -0
- package/dist/server/server.d.ts +137 -65
- package/dist/server/server.js +395 -89
- package/dist/server/server.js.map +1 -1
- package/dist/server/templateHelper.d.ts +5 -5
- package/dist/server/templates/development.hbs +3 -57
- package/dist/server/templates/production.hbs +2 -3
- package/dist/server/tunnel-proxy-router.d.ts +7 -0
- package/dist/server/tunnel-proxy-router.js +110 -0
- package/dist/server/tunnel-proxy-router.js.map +1 -0
- package/dist/server/tunnel-proxy-router.test.d.ts +1 -0
- package/dist/server/tunnel-proxy-router.test.js +229 -0
- package/dist/server/tunnel-proxy-router.test.js.map +1 -0
- package/dist/server/viewsDevServer.d.ts +14 -0
- package/dist/server/viewsDevServer.js +45 -0
- package/dist/server/viewsDevServer.js.map +1 -0
- package/dist/test/utils.d.ts +13 -21
- package/dist/test/utils.js +42 -37
- package/dist/test/utils.js.map +1 -1
- package/dist/test/view.test.d.ts +1 -0
- package/dist/test/view.test.js +523 -0
- package/dist/test/view.test.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/dist/web/bridges/apps-sdk/adaptor.d.ts +24 -0
- package/dist/web/bridges/apps-sdk/adaptor.js +93 -0
- package/dist/web/bridges/apps-sdk/adaptor.js.map +1 -0
- package/dist/web/bridges/apps-sdk/bridge.d.ts +10 -0
- package/dist/web/bridges/{apps-sdk-bridge.js → apps-sdk/bridge.js} +2 -2
- package/dist/web/bridges/apps-sdk/bridge.js.map +1 -0
- package/dist/web/bridges/apps-sdk/index.d.ts +5 -0
- package/dist/web/bridges/apps-sdk/index.js +5 -0
- package/dist/web/bridges/apps-sdk/index.js.map +1 -0
- package/dist/web/bridges/apps-sdk/types.d.ts +126 -0
- package/dist/web/bridges/apps-sdk/types.js +10 -0
- package/dist/web/bridges/apps-sdk/types.js.map +1 -0
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.d.ts +2 -0
- package/dist/web/bridges/{hooks/use-apps-sdk-bridge.js → apps-sdk/use-apps-sdk-context.js} +3 -3
- package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js.map +1 -0
- package/dist/web/bridges/get-adaptor.d.ts +2 -0
- package/dist/web/bridges/get-adaptor.js +8 -0
- package/dist/web/bridges/get-adaptor.js.map +1 -0
- package/dist/web/bridges/index.d.ts +5 -4
- package/dist/web/bridges/index.js +5 -4
- package/dist/web/bridges/index.js.map +1 -1
- package/dist/web/bridges/mcp-app/adaptor.d.ts +48 -0
- package/dist/web/bridges/mcp-app/adaptor.js +268 -0
- package/dist/web/bridges/mcp-app/adaptor.js.map +1 -0
- package/dist/web/bridges/mcp-app/bridge.d.ts +26 -0
- package/dist/web/bridges/mcp-app/bridge.js +102 -0
- package/dist/web/bridges/mcp-app/bridge.js.map +1 -0
- package/dist/web/bridges/mcp-app/index.d.ts +4 -0
- package/dist/web/bridges/mcp-app/index.js +4 -0
- package/dist/web/bridges/mcp-app/index.js.map +1 -0
- package/dist/web/bridges/mcp-app/types.d.ts +8 -0
- package/dist/web/bridges/mcp-app/types.js +2 -0
- package/dist/web/bridges/mcp-app/types.js.map +1 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.d.ts +7 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.js +7 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.js.map +1 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.d.ts +1 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js +26 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js.map +1 -0
- package/dist/web/bridges/types.d.ts +79 -27
- package/dist/web/bridges/use-host-context.d.ts +2 -0
- package/dist/web/bridges/use-host-context.js +8 -0
- package/dist/web/bridges/use-host-context.js.map +1 -0
- package/dist/web/components/modal-provider.d.ts +4 -0
- package/dist/web/components/modal-provider.js +45 -0
- package/dist/web/components/modal-provider.js.map +1 -0
- package/dist/web/create-store.js +21 -8
- package/dist/web/create-store.js.map +1 -1
- package/dist/web/create-store.test.js +112 -53
- package/dist/web/create-store.test.js.map +1 -1
- package/dist/web/data-llm.d.ts +1 -1
- package/dist/web/data-llm.js +7 -5
- package/dist/web/data-llm.js.map +1 -1
- package/dist/web/data-llm.test.js +131 -65
- package/dist/web/data-llm.test.js.map +1 -1
- package/dist/web/generate-helpers.d.ts +22 -19
- package/dist/web/generate-helpers.js +20 -18
- package/dist/web/generate-helpers.js.map +1 -1
- package/dist/web/generate-helpers.test-d.js +26 -26
- package/dist/web/generate-helpers.test-d.js.map +1 -1
- package/dist/web/helpers/state.d.ts +2 -2
- package/dist/web/helpers/state.js +17 -12
- package/dist/web/helpers/state.js.map +1 -1
- package/dist/web/helpers/state.test.js +9 -9
- package/dist/web/helpers/state.test.js.map +1 -1
- package/dist/web/hooks/index.d.ts +3 -3
- package/dist/web/hooks/index.js +2 -2
- package/dist/web/hooks/index.js.map +1 -1
- package/dist/web/hooks/test/utils.d.ts +8 -2
- package/dist/web/hooks/test/utils.js +37 -13
- package/dist/web/hooks/test/utils.js.map +1 -1
- package/dist/web/hooks/use-call-tool.d.ts +3 -2
- package/dist/web/hooks/use-call-tool.js +2 -2
- package/dist/web/hooks/use-call-tool.js.map +1 -1
- package/dist/web/hooks/use-call-tool.test-d.js +1 -1
- package/dist/web/hooks/use-call-tool.test-d.js.map +1 -1
- package/dist/web/hooks/use-call-tool.test.js +3 -3
- package/dist/web/hooks/use-call-tool.test.js.map +1 -1
- package/dist/web/hooks/use-display-mode.d.ts +3 -3
- package/dist/web/hooks/use-display-mode.js +3 -4
- package/dist/web/hooks/use-display-mode.js.map +1 -1
- package/dist/web/hooks/use-display-mode.test-d.d.ts +1 -0
- package/dist/web/hooks/use-display-mode.test-d.js +8 -0
- package/dist/web/hooks/use-display-mode.test-d.js.map +1 -0
- package/dist/web/hooks/use-files.d.ts +3 -6
- package/dist/web/hooks/use-files.js +5 -2
- package/dist/web/hooks/use-files.js.map +1 -1
- package/dist/web/hooks/use-files.test.js +28 -3
- package/dist/web/hooks/use-files.test.js.map +1 -1
- package/dist/web/hooks/use-layout.d.ts +2 -2
- package/dist/web/hooks/use-layout.js +4 -4
- package/dist/web/hooks/use-layout.js.map +1 -1
- package/dist/web/hooks/use-layout.test.js +7 -6
- package/dist/web/hooks/use-layout.test.js.map +1 -1
- package/dist/web/hooks/use-open-external.d.ts +3 -1
- package/dist/web/hooks/use-open-external.js +3 -3
- package/dist/web/hooks/use-open-external.js.map +1 -1
- package/dist/web/hooks/use-open-external.test.js +27 -12
- package/dist/web/hooks/use-open-external.test.js.map +1 -1
- package/dist/web/hooks/use-request-modal.d.ts +3 -3
- package/dist/web/hooks/use-request-modal.js +10 -8
- package/dist/web/hooks/use-request-modal.js.map +1 -1
- package/dist/web/hooks/use-request-modal.test.js +5 -1
- package/dist/web/hooks/use-request-modal.test.js.map +1 -1
- package/dist/web/hooks/use-send-follow-up-message.js +2 -2
- package/dist/web/hooks/use-set-open-in-app-url.d.ts +1 -0
- package/dist/web/hooks/use-set-open-in-app-url.js +8 -0
- package/dist/web/hooks/use-set-open-in-app-url.js.map +1 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.d.ts +1 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.js +43 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.js.map +1 -0
- package/dist/web/hooks/use-tool-info.js +4 -4
- package/dist/web/hooks/use-tool-info.js.map +1 -1
- package/dist/web/hooks/use-tool-info.test.js +5 -5
- package/dist/web/hooks/use-tool-info.test.js.map +1 -1
- package/dist/web/hooks/use-user.d.ts +1 -1
- package/dist/web/hooks/use-user.js +20 -4
- package/dist/web/hooks/use-user.js.map +1 -1
- package/dist/web/hooks/use-user.test.js +33 -4
- package/dist/web/hooks/use-user.test.js.map +1 -1
- package/dist/web/hooks/use-view-state.d.ts +4 -0
- package/dist/web/hooks/use-view-state.js +32 -0
- package/dist/web/hooks/use-view-state.js.map +1 -0
- package/dist/web/hooks/use-view-state.test.d.ts +1 -0
- package/dist/web/hooks/use-view-state.test.js +177 -0
- package/dist/web/hooks/use-view-state.test.js.map +1 -0
- package/dist/web/index.d.ts +1 -2
- package/dist/web/index.js +1 -2
- package/dist/web/index.js.map +1 -1
- package/dist/web/mount-view.d.ts +1 -0
- package/dist/web/{mount-widget.js → mount-view.js} +11 -3
- package/dist/web/mount-view.js.map +1 -0
- package/dist/web/plugin/plugin.d.ts +4 -1
- package/dist/web/plugin/plugin.js +142 -18
- package/dist/web/plugin/plugin.js.map +1 -1
- package/dist/web/plugin/scan-views.d.ts +16 -0
- package/dist/web/plugin/scan-views.js +88 -0
- package/dist/web/plugin/scan-views.js.map +1 -0
- package/dist/web/plugin/scan-views.test.d.ts +1 -0
- package/dist/web/plugin/scan-views.test.js +99 -0
- package/dist/web/plugin/scan-views.test.js.map +1 -0
- package/dist/web/plugin/transform-data-llm.js +1 -1
- package/dist/web/plugin/transform-data-llm.js.map +1 -1
- package/dist/web/plugin/validate-view.d.ts +1 -0
- package/dist/web/plugin/validate-view.js +9 -0
- package/dist/web/plugin/validate-view.js.map +1 -0
- package/dist/web/plugin/validate-view.test.d.ts +1 -0
- package/dist/web/plugin/validate-view.test.js +24 -0
- package/dist/web/plugin/validate-view.test.js.map +1 -0
- package/dist/web/proxy.js +0 -1
- package/dist/web/proxy.js.map +1 -1
- package/dist/web/types.d.ts +0 -133
- package/dist/web/types.js +0 -9
- package/dist/web/types.js.map +1 -1
- package/package.json +46 -27
- package/tsconfig.base.json +33 -0
- package/dist/server/widgetsDevServer.d.ts +0 -12
- package/dist/server/widgetsDevServer.js +0 -47
- package/dist/server/widgetsDevServer.js.map +0 -1
- package/dist/test/widget.test.js +0 -250
- package/dist/test/widget.test.js.map +0 -1
- package/dist/web/bridges/adaptors/apps-sdk-adaptor.d.ts +0 -13
- package/dist/web/bridges/adaptors/apps-sdk-adaptor.js +0 -33
- package/dist/web/bridges/adaptors/apps-sdk-adaptor.js.map +0 -1
- package/dist/web/bridges/adaptors/mcp-app-adaptor.d.ts +0 -16
- package/dist/web/bridges/adaptors/mcp-app-adaptor.js +0 -115
- package/dist/web/bridges/adaptors/mcp-app-adaptor.js.map +0 -1
- package/dist/web/bridges/apps-sdk-bridge.d.ts +0 -10
- package/dist/web/bridges/apps-sdk-bridge.js.map +0 -1
- package/dist/web/bridges/hooks/use-adaptor.d.ts +0 -2
- package/dist/web/bridges/hooks/use-adaptor.js +0 -8
- package/dist/web/bridges/hooks/use-adaptor.js.map +0 -1
- package/dist/web/bridges/hooks/use-apps-sdk-bridge.d.ts +0 -2
- package/dist/web/bridges/hooks/use-apps-sdk-bridge.js.map +0 -1
- package/dist/web/bridges/hooks/use-bridge.d.ts +0 -2
- package/dist/web/bridges/hooks/use-bridge.js +0 -8
- package/dist/web/bridges/hooks/use-bridge.js.map +0 -1
- package/dist/web/bridges/hooks/use-mcp-app-bridge.d.ts +0 -5
- package/dist/web/bridges/hooks/use-mcp-app-bridge.js +0 -7
- package/dist/web/bridges/hooks/use-mcp-app-bridge.js.map +0 -1
- package/dist/web/bridges/hooks/use-mcp-app-bridge.test.js +0 -41
- package/dist/web/bridges/hooks/use-mcp-app-bridge.test.js.map +0 -1
- package/dist/web/bridges/mcp-app-bridge.d.ts +0 -38
- package/dist/web/bridges/mcp-app-bridge.js +0 -162
- package/dist/web/bridges/mcp-app-bridge.js.map +0 -1
- package/dist/web/hooks/use-openai-global.d.ts +0 -3
- package/dist/web/hooks/use-openai-global.js +0 -6
- package/dist/web/hooks/use-openai-global.js.map +0 -1
- package/dist/web/hooks/use-widget-state.d.ts +0 -4
- package/dist/web/hooks/use-widget-state.js +0 -32
- package/dist/web/hooks/use-widget-state.js.map +0 -1
- package/dist/web/hooks/use-widget-state.test.js +0 -61
- package/dist/web/hooks/use-widget-state.test.js.map +0 -1
- package/dist/web/mount-widget.d.ts +0 -1
- package/dist/web/mount-widget.js.map +0 -1
- /package/dist/{test/widget.test.d.ts → cli/tunnel-control-server.test.d.ts} +0 -0
- /package/dist/{web/bridges/hooks/use-mcp-app-bridge.test.d.ts → cli/tunnel-handler.test.d.ts} +0 -0
- /package/dist/{web/hooks/use-widget-state.test.d.ts → cli/tunnel.test.d.ts} +0 -0
package/dist/web/types.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
-
import type { WidgetHostType } from "../server/index.js";
|
|
4
2
|
declare module "react" {
|
|
5
3
|
interface HTMLAttributes<T> {
|
|
6
4
|
"data-llm"?: string;
|
|
@@ -15,135 +13,4 @@ type RequiredKeys<T> = {
|
|
|
15
13
|
[K in keyof T]-?: Record<string, never> extends Pick<T, K> ? never : K;
|
|
16
14
|
}[keyof T];
|
|
17
15
|
export type HasRequiredKeys<T> = RequiredKeys<T> extends never ? false : true;
|
|
18
|
-
type WidgetState = UnknownObject;
|
|
19
|
-
type FileMetadata = {
|
|
20
|
-
fileId: string;
|
|
21
|
-
};
|
|
22
|
-
export declare const TOOL_RESPONSE_EVENT_TYPE = "openai:tool_response";
|
|
23
|
-
export declare class ToolResponseEvent extends CustomEvent<{
|
|
24
|
-
tool: {
|
|
25
|
-
name: string;
|
|
26
|
-
args: UnknownObject;
|
|
27
|
-
};
|
|
28
|
-
}> {
|
|
29
|
-
readonly type = "openai:tool_response";
|
|
30
|
-
}
|
|
31
|
-
declare global {
|
|
32
|
-
interface Window {
|
|
33
|
-
skybridge: SkybridgeProperties;
|
|
34
|
-
openai: OpenAiMethods<WidgetState> & OpenAiProperties;
|
|
35
|
-
}
|
|
36
|
-
interface WindowEventMap {
|
|
37
|
-
[SET_GLOBALS_EVENT_TYPE]: SetGlobalsEvent;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export type SkybridgeProperties = {
|
|
41
|
-
hostType: WidgetHostType;
|
|
42
|
-
};
|
|
43
|
-
export type OpenAiProperties<ToolInput extends UnknownObject = Record<never, unknown>, ToolOutput extends UnknownObject = UnknownObject, ToolResponseMetadata extends UnknownObject = UnknownObject, WidgetState extends UnknownObject = UnknownObject> = {
|
|
44
|
-
theme: Theme;
|
|
45
|
-
userAgent: UserAgent;
|
|
46
|
-
locale: string;
|
|
47
|
-
maxHeight: number;
|
|
48
|
-
displayMode: DisplayMode;
|
|
49
|
-
safeArea: SafeArea;
|
|
50
|
-
view: View;
|
|
51
|
-
toolInput: ToolInput;
|
|
52
|
-
toolOutput: ToolOutput | {
|
|
53
|
-
text: string;
|
|
54
|
-
} | null;
|
|
55
|
-
toolResponseMetadata: ToolResponseMetadata | null;
|
|
56
|
-
widgetState: WidgetState | null;
|
|
57
|
-
};
|
|
58
|
-
export type CallToolArgs = Record<string, unknown> | null;
|
|
59
|
-
export type CallToolResponse = {
|
|
60
|
-
content: CallToolResult["content"];
|
|
61
|
-
structuredContent: Record<string, unknown>;
|
|
62
|
-
isError: boolean;
|
|
63
|
-
result: string;
|
|
64
|
-
_meta?: CallToolResult["_meta"];
|
|
65
|
-
};
|
|
66
|
-
export type RequestModalOptions = {
|
|
67
|
-
title?: string;
|
|
68
|
-
params?: Record<string, unknown>;
|
|
69
|
-
anchor?: {
|
|
70
|
-
top?: number;
|
|
71
|
-
left?: number;
|
|
72
|
-
width?: number;
|
|
73
|
-
height?: number;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
export type OpenAiMethods<WidgetState extends UnknownObject = UnknownObject> = {
|
|
77
|
-
/** Calls a tool on your MCP. Returns the full response. */
|
|
78
|
-
callTool: <ToolArgs extends CallToolArgs = null, ToolResponse extends CallToolResponse = CallToolResponse>(name: string, args: ToolArgs) => Promise<ToolResponse>;
|
|
79
|
-
/** Triggers a followup turn in the ChatGPT conversation */
|
|
80
|
-
sendFollowUpMessage: (args: {
|
|
81
|
-
prompt: string;
|
|
82
|
-
}) => Promise<void>;
|
|
83
|
-
/** Opens an external link, redirects web page or mobile app */
|
|
84
|
-
openExternal(args: {
|
|
85
|
-
href: string;
|
|
86
|
-
}): void;
|
|
87
|
-
/** For transitioning an app from inline to fullscreen or pip */
|
|
88
|
-
requestDisplayMode: (args: {
|
|
89
|
-
mode: DisplayMode;
|
|
90
|
-
}) => Promise<{
|
|
91
|
-
/**
|
|
92
|
-
* The granted display mode. The host may reject the request.
|
|
93
|
-
* For mobile, PiP is always coerced to fullscreen.
|
|
94
|
-
*/
|
|
95
|
-
mode: DisplayMode;
|
|
96
|
-
}>;
|
|
97
|
-
/**
|
|
98
|
-
* Sets the widget state.
|
|
99
|
-
* This state is persisted across widget renders.
|
|
100
|
-
*/
|
|
101
|
-
setWidgetState: (state: WidgetState) => Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Opens a modal portaled outside of the widget iFrame.
|
|
104
|
-
* This ensures the modal is correctly displayed and not limited to the widget's area.
|
|
105
|
-
*/
|
|
106
|
-
requestModal: (args: RequestModalOptions) => Promise<void>;
|
|
107
|
-
/** Uploads a new file to the host */
|
|
108
|
-
uploadFile: (file: File) => Promise<FileMetadata>;
|
|
109
|
-
/**
|
|
110
|
-
* Downloads a file from the host that was previously uploaded.
|
|
111
|
-
* Only files uploaded by the same connector instance can be downloaded.
|
|
112
|
-
*/
|
|
113
|
-
getFileDownloadUrl: (file: FileMetadata) => Promise<{
|
|
114
|
-
downloadUrl: string;
|
|
115
|
-
}>;
|
|
116
|
-
};
|
|
117
|
-
export declare const SET_GLOBALS_EVENT_TYPE = "openai:set_globals";
|
|
118
|
-
export declare class SetGlobalsEvent extends CustomEvent<{
|
|
119
|
-
globals: Partial<OpenAiProperties>;
|
|
120
|
-
}> {
|
|
121
|
-
readonly type = "openai:set_globals";
|
|
122
|
-
}
|
|
123
|
-
export type CallTool = (name: string, args: Record<string, unknown>) => Promise<CallToolResponse>;
|
|
124
|
-
export type DisplayMode = "pip" | "inline" | "fullscreen" | "modal";
|
|
125
|
-
export type View = {
|
|
126
|
-
mode: DisplayMode;
|
|
127
|
-
params?: Record<string, unknown>;
|
|
128
|
-
};
|
|
129
|
-
export type Theme = "light" | "dark";
|
|
130
|
-
export type SafeAreaInsets = {
|
|
131
|
-
top: number;
|
|
132
|
-
bottom: number;
|
|
133
|
-
left: number;
|
|
134
|
-
right: number;
|
|
135
|
-
};
|
|
136
|
-
export type SafeArea = {
|
|
137
|
-
insets: SafeAreaInsets;
|
|
138
|
-
};
|
|
139
|
-
export type DeviceType = "mobile" | "tablet" | "desktop" | "unknown";
|
|
140
|
-
export type UserAgent = {
|
|
141
|
-
device: {
|
|
142
|
-
type: DeviceType;
|
|
143
|
-
};
|
|
144
|
-
capabilities: {
|
|
145
|
-
hover: boolean;
|
|
146
|
-
touch: boolean;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
16
|
export {};
|
package/dist/web/types.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
export const TOOL_RESPONSE_EVENT_TYPE = "openai:tool_response";
|
|
3
|
-
export class ToolResponseEvent extends CustomEvent {
|
|
4
|
-
type = TOOL_RESPONSE_EVENT_TYPE;
|
|
5
|
-
}
|
|
6
|
-
// Dispatched when any global changes in the host page
|
|
7
|
-
export const SET_GLOBALS_EVENT_TYPE = "openai:set_globals";
|
|
8
|
-
export class SetGlobalsEvent extends CustomEvent {
|
|
9
|
-
type = SET_GLOBALS_EVENT_TYPE;
|
|
10
|
-
}
|
|
11
2
|
//# sourceMappingURL=types.js.map
|
package/dist/web/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skybridge",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
4
|
-
"description": "Skybridge is a framework for building ChatGPT
|
|
3
|
+
"version": "0.0.0-dev.e378aa9",
|
|
4
|
+
"description": "Skybridge is a framework for building ChatGPT and MCP Apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/alpic-ai/skybridge.git"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=22.0.0"
|
|
12
|
+
},
|
|
10
13
|
"files": [
|
|
11
|
-
"dist"
|
|
14
|
+
"dist",
|
|
15
|
+
"README.md",
|
|
16
|
+
"tsconfig.base.json"
|
|
12
17
|
],
|
|
13
18
|
"exports": {
|
|
19
|
+
"./tsconfig": "./tsconfig.base.json",
|
|
20
|
+
"./tsconfig.json": "./tsconfig.base.json",
|
|
14
21
|
"./server": {
|
|
15
22
|
"types": "./dist/server/index.d.ts",
|
|
16
23
|
"default": "./dist/server/index.js"
|
|
@@ -18,6 +25,10 @@
|
|
|
18
25
|
"./web": {
|
|
19
26
|
"types": "./dist/web/index.d.ts",
|
|
20
27
|
"default": "./dist/web/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./vite": {
|
|
30
|
+
"types": "./dist/web/plugin/plugin.d.ts",
|
|
31
|
+
"default": "./dist/web/plugin/plugin.js"
|
|
21
32
|
}
|
|
22
33
|
},
|
|
23
34
|
"keywords": [
|
|
@@ -29,42 +40,48 @@
|
|
|
29
40
|
"author": "Frédéric Barthelet",
|
|
30
41
|
"license": "ISC",
|
|
31
42
|
"peerDependencies": {
|
|
32
|
-
"@modelcontextprotocol/sdk": ">=1.
|
|
43
|
+
"@modelcontextprotocol/sdk": ">=1.27.0",
|
|
44
|
+
"@skybridge/devtools": ">=0.35.14 <1.0.0",
|
|
45
|
+
"nodemon": ">=3.0.0",
|
|
33
46
|
"react": ">=18.0.0",
|
|
34
|
-
"react-dom": ">=18.0.0"
|
|
47
|
+
"react-dom": ">=18.0.0",
|
|
48
|
+
"vite": ">=7.3.1"
|
|
35
49
|
},
|
|
36
50
|
"dependencies": {
|
|
37
|
-
"@babel/core": "^7.
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
51
|
+
"@babel/core": "^7.29.0",
|
|
52
|
+
"@modelcontextprotocol/ext-apps": "^1.3.2",
|
|
53
|
+
"@oclif/core": "^4.10.3",
|
|
54
|
+
"ci-info": "^4.4.0",
|
|
55
|
+
"cors": "^2.8.6",
|
|
40
56
|
"dequal": "^2.0.3",
|
|
41
|
-
"es-toolkit": "^1.
|
|
57
|
+
"es-toolkit": "^1.45.1",
|
|
42
58
|
"express": "^5.2.1",
|
|
43
|
-
"handlebars": "^4.7.
|
|
59
|
+
"handlebars": "^4.7.9",
|
|
60
|
+
"ink": "^7.0.0",
|
|
61
|
+
"posthog-node": "^5.28.9",
|
|
44
62
|
"superjson": "^2.2.6",
|
|
45
|
-
"
|
|
46
|
-
"zustand": "^5.0.9"
|
|
63
|
+
"zustand": "^5.0.12"
|
|
47
64
|
},
|
|
48
65
|
"devDependencies": {
|
|
49
|
-
"@modelcontextprotocol/
|
|
50
|
-
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
66
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
51
67
|
"@testing-library/dom": "^10.4.1",
|
|
52
|
-
"@testing-library/react": "^16.3.
|
|
68
|
+
"@testing-library/react": "^16.3.2",
|
|
53
69
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
54
70
|
"@types/babel__core": "^7.20.5",
|
|
55
71
|
"@types/cors": "^2.8.19",
|
|
56
72
|
"@types/express": "^5.0.6",
|
|
57
|
-
"@types/jsdom": "^
|
|
58
|
-
"@types/node": "^24.
|
|
59
|
-
"@types/react": "^19.2.
|
|
73
|
+
"@types/jsdom": "^28.0.1",
|
|
74
|
+
"@types/node": "^24.12.0",
|
|
75
|
+
"@types/react": "^19.2.14",
|
|
60
76
|
"@types/react-dom": "^19.2.3",
|
|
61
|
-
"@vitest/ui": "^4.
|
|
62
|
-
"jsdom": "^
|
|
63
|
-
"shx": "^0.
|
|
77
|
+
"@vitest/ui": "^4.1.4",
|
|
78
|
+
"jsdom": "^29.0.1",
|
|
79
|
+
"shx": "^0.4.0",
|
|
64
80
|
"ts-node": "^10.9.2",
|
|
65
|
-
"typescript": "^
|
|
66
|
-
"
|
|
67
|
-
"
|
|
81
|
+
"typescript": "^6.0.2",
|
|
82
|
+
"vite": "^8.0.0",
|
|
83
|
+
"vitest": "^4.1.4",
|
|
84
|
+
"zod": "^4.3.6"
|
|
68
85
|
},
|
|
69
86
|
"bin": {
|
|
70
87
|
"sb": "./bin/run.js",
|
|
@@ -74,15 +91,17 @@
|
|
|
74
91
|
"bin": "skybridge",
|
|
75
92
|
"commands": "./dist/commands",
|
|
76
93
|
"dirname": "skybridge",
|
|
77
|
-
"topicSeparator": " "
|
|
94
|
+
"topicSeparator": " ",
|
|
95
|
+
"hooks": {
|
|
96
|
+
"finally": "./dist/cli/telemetry"
|
|
97
|
+
}
|
|
78
98
|
},
|
|
79
99
|
"scripts": {
|
|
80
100
|
"build": "shx rm -rf dist && tsc && pnpm run build:templates",
|
|
81
101
|
"build:templates": "cp -r src/server/templates dist/server/",
|
|
82
102
|
"format": "biome check --write --error-on-warnings",
|
|
83
|
-
"test": "pnpm run test:unit && pnpm run test:
|
|
103
|
+
"test": "pnpm run test:unit && pnpm run test:format",
|
|
84
104
|
"test:unit": "vitest run",
|
|
85
|
-
"test:type": "tsc --noEmit",
|
|
86
105
|
"test:format": "biome ci"
|
|
87
106
|
}
|
|
88
107
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Module resolution options
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"verbatimModuleSyntax": true,
|
|
7
|
+
|
|
8
|
+
// Output options
|
|
9
|
+
"rootDir": "${configDir}/src",
|
|
10
|
+
"outDir": "${configDir}/dist",
|
|
11
|
+
"noEmit": false,
|
|
12
|
+
"incremental": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
|
|
15
|
+
// Language and environment options
|
|
16
|
+
"target": "ES2022",
|
|
17
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
18
|
+
"jsx": "react-jsx",
|
|
19
|
+
|
|
20
|
+
// Type declarations
|
|
21
|
+
"types": ["node", "vite/client"],
|
|
22
|
+
|
|
23
|
+
// Strictness and checking options
|
|
24
|
+
"strict": true,
|
|
25
|
+
"skipLibCheck": true,
|
|
26
|
+
"forceConsistentCasingInFileNames": true,
|
|
27
|
+
|
|
28
|
+
// Code quality & diagnostics
|
|
29
|
+
"noUnusedLocals": true,
|
|
30
|
+
"noUnusedParameters": true,
|
|
31
|
+
"noFallthroughCasesInSwitch": true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Router } from "express";
|
|
2
|
-
/**
|
|
3
|
-
* Install Vite dev server
|
|
4
|
-
* This router MUST be installed at the application root, like so:
|
|
5
|
-
*
|
|
6
|
-
* const app = express();
|
|
7
|
-
*
|
|
8
|
-
* if (env.NODE_ENV !== "production") {
|
|
9
|
-
* app.use(await widgetsRouter());
|
|
10
|
-
* }
|
|
11
|
-
*/
|
|
12
|
-
export declare const widgetsDevServer: () => Promise<Router>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import cors from "cors";
|
|
4
|
-
import express, {} from "express";
|
|
5
|
-
/**
|
|
6
|
-
* Install Vite dev server
|
|
7
|
-
* This router MUST be installed at the application root, like so:
|
|
8
|
-
*
|
|
9
|
-
* const app = express();
|
|
10
|
-
*
|
|
11
|
-
* if (env.NODE_ENV !== "production") {
|
|
12
|
-
* app.use(await widgetsRouter());
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export const widgetsDevServer = async () => {
|
|
16
|
-
const router = express.Router();
|
|
17
|
-
const { createServer, searchForWorkspaceRoot, loadConfigFromFile } = await import("vite");
|
|
18
|
-
// Since 0.16.0, the template is a single package that does not rely on workspace.
|
|
19
|
-
// It means that, when starting the server, the working dir is the template root
|
|
20
|
-
// hence we don't need to walk up the tree to find the workspace, which does not exist anymore.
|
|
21
|
-
let webAppRoot = path.join(process.cwd(), "web");
|
|
22
|
-
// fallback to the old behavior for backward compatibility
|
|
23
|
-
const hasWebAppRoot = existsSync(webAppRoot);
|
|
24
|
-
if (!hasWebAppRoot) {
|
|
25
|
-
const workspaceRoot = searchForWorkspaceRoot(process.cwd());
|
|
26
|
-
webAppRoot = path.join(workspaceRoot, "web");
|
|
27
|
-
}
|
|
28
|
-
const configResult = await loadConfigFromFile({ command: "serve", mode: "development" }, path.join(webAppRoot, "vite.config.ts"), webAppRoot);
|
|
29
|
-
const { build, preview, ...devConfig } = configResult?.config || {};
|
|
30
|
-
const vite = await createServer({
|
|
31
|
-
...devConfig,
|
|
32
|
-
configFile: false, // Keep this to prevent vite from trying to resolve path in the target config file
|
|
33
|
-
appType: "custom",
|
|
34
|
-
server: {
|
|
35
|
-
allowedHosts: true,
|
|
36
|
-
middlewareMode: true,
|
|
37
|
-
},
|
|
38
|
-
root: webAppRoot,
|
|
39
|
-
optimizeDeps: {
|
|
40
|
-
include: ["react", "react-dom/client"],
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
router.use(cors());
|
|
44
|
-
router.use("/", vite.middlewares);
|
|
45
|
-
return router;
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=widgetsDevServer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widgetsDevServer.js","sourceRoot":"","sources":["../../src/server/widgetsDevServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,EAAE,EAAe,MAAM,SAAS,CAAC;AAC/C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,IAAqB,EAAE;IAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,EAAE,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,GAChE,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;IAEvB,kFAAkF;IAClF,gFAAgF;IAChF,+FAA+F;IAC/F,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;IAEjD,0DAA0D;IAC1D,MAAM,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,aAAa,GAAG,sBAAsB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC5D,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAC3C,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,EACzC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,EACvC,UAAU,CACX,CAAC;IAEF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,YAAY,EAAE,MAAM,IAAI,EAAE,CAAC;IAEpE,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC;QAC9B,GAAG,SAAS;QACZ,UAAU,EAAE,KAAK,EAAE,kFAAkF;QACrG,OAAO,EAAE,QAAQ;QACjB,MAAM,EAAE;YACN,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,IAAI;SACrB;QACD,IAAI,EAAE,UAAU;QAChB,YAAY,EAAE;YACZ,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC;SACvC;KACF,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACnB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAElC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/dist/test/widget.test.js
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi, } from "vitest";
|
|
2
|
-
import { createMockExtra, createMockMcpServer, resetTestEnv, setTestEnv, } from "./utils.js";
|
|
3
|
-
const mockManifest = {
|
|
4
|
-
"src/widgets/my-widget.tsx": { file: "my-widget.js" },
|
|
5
|
-
"src/widgets/folder-widget/index.tsx": { file: "folder-widget.js" },
|
|
6
|
-
"style.css": { file: "style.css" },
|
|
7
|
-
};
|
|
8
|
-
const actual = vi.hoisted(() => require("node:fs"));
|
|
9
|
-
vi.mock("node:fs", () => {
|
|
10
|
-
const readFileSyncImpl = (path, ...args) => {
|
|
11
|
-
if (typeof path === "string" && path.includes("manifest.json")) {
|
|
12
|
-
return JSON.stringify(mockManifest);
|
|
13
|
-
}
|
|
14
|
-
return actual.readFileSync(path, ...args);
|
|
15
|
-
};
|
|
16
|
-
const readFileSync = vi.fn(readFileSyncImpl);
|
|
17
|
-
return {
|
|
18
|
-
readFileSync,
|
|
19
|
-
default: {
|
|
20
|
-
readFileSync,
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
describe("McpServer.registerWidget", () => {
|
|
25
|
-
let server;
|
|
26
|
-
let mockRegisterResource;
|
|
27
|
-
let mockRegisterTool;
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
({ server, mockRegisterResource, mockRegisterTool } =
|
|
30
|
-
createMockMcpServer());
|
|
31
|
-
});
|
|
32
|
-
afterEach(() => {
|
|
33
|
-
vi.clearAllMocks();
|
|
34
|
-
resetTestEnv();
|
|
35
|
-
});
|
|
36
|
-
it("should generate correct HTML for development mode", async () => {
|
|
37
|
-
setTestEnv({ NODE_ENV: "development" });
|
|
38
|
-
const mockToolCallback = vi.fn();
|
|
39
|
-
const mockRegisterResourceConfig = { description: "Test widget" };
|
|
40
|
-
const mockToolConfig = { description: "Test tool" };
|
|
41
|
-
server.registerWidget("my-widget", mockRegisterResourceConfig, mockToolConfig, mockToolCallback);
|
|
42
|
-
// Get the resource callback function
|
|
43
|
-
const appsSdkResourceCallback = mockRegisterResource.mock
|
|
44
|
-
.calls[0]?.[3];
|
|
45
|
-
expect(appsSdkResourceCallback).toBeDefined();
|
|
46
|
-
const serverUrl = "http://localhost:3000";
|
|
47
|
-
const mockExtra = createMockExtra("__not_used__");
|
|
48
|
-
const result = await appsSdkResourceCallback(new URL("ui://widgets/apps-sdk/my-widget.html"), mockExtra);
|
|
49
|
-
expect(mockRegisterTool).toHaveBeenCalled();
|
|
50
|
-
expect(result).toEqual({
|
|
51
|
-
contents: [
|
|
52
|
-
{
|
|
53
|
-
uri: "ui://widgets/apps-sdk/my-widget.html",
|
|
54
|
-
mimeType: "text/html+skybridge",
|
|
55
|
-
text: expect.stringContaining('<div id="root"></div>'),
|
|
56
|
-
_meta: {
|
|
57
|
-
"openai/widgetCSP": {
|
|
58
|
-
resource_domains: [serverUrl],
|
|
59
|
-
connect_domains: [
|
|
60
|
-
serverUrl,
|
|
61
|
-
"ws://localhost:3000",
|
|
62
|
-
"ws://localhost:24678",
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
"openai/widgetDomain": serverUrl,
|
|
66
|
-
"openai/widgetDescription": "Test tool",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
});
|
|
71
|
-
// Check development-specific content
|
|
72
|
-
expect(result.contents[0]?.text).toContain(`${serverUrl}/assets/@react-refresh`);
|
|
73
|
-
expect(result.contents[0]?.text).toContain(`${serverUrl}/@vite/client`);
|
|
74
|
-
expect(result.contents[0]?.text).toContain(`${serverUrl}/src/widgets/my-widget`);
|
|
75
|
-
expect(result.contents[0]?.text).not.toContain(`${serverUrl}/src/widgets/my-widget.tsx`);
|
|
76
|
-
});
|
|
77
|
-
it("should generate correct HTML for production mode", async () => {
|
|
78
|
-
setTestEnv({ NODE_ENV: "production" });
|
|
79
|
-
const mockToolCallback = vi.fn();
|
|
80
|
-
const mockRegisterResourceConfig = { description: "Test widget" };
|
|
81
|
-
const mockToolConfig = { description: "Test tool" };
|
|
82
|
-
server.registerWidget("my-widget", mockRegisterResourceConfig, mockToolConfig, mockToolCallback);
|
|
83
|
-
// Get the resource callback function
|
|
84
|
-
const appsSdkResourceCallback = mockRegisterResource.mock
|
|
85
|
-
.calls[0]?.[3];
|
|
86
|
-
expect(appsSdkResourceCallback).toBeDefined();
|
|
87
|
-
const host = "myapp.com";
|
|
88
|
-
const serverUrl = `https://${host}`;
|
|
89
|
-
const mockExtra = createMockExtra(host);
|
|
90
|
-
const result = await appsSdkResourceCallback(new URL("ui://widgets/apps-sdk/my-widget.html"), mockExtra);
|
|
91
|
-
expect(result).toEqual({
|
|
92
|
-
contents: [
|
|
93
|
-
{
|
|
94
|
-
uri: "ui://widgets/apps-sdk/my-widget.html",
|
|
95
|
-
mimeType: "text/html+skybridge",
|
|
96
|
-
text: expect.stringContaining('<div id="root"></div>'),
|
|
97
|
-
_meta: {
|
|
98
|
-
"openai/widgetCSP": {
|
|
99
|
-
resource_domains: [serverUrl],
|
|
100
|
-
connect_domains: [serverUrl, `wss://${host}`],
|
|
101
|
-
},
|
|
102
|
-
"openai/widgetDomain": serverUrl,
|
|
103
|
-
"openai/widgetDescription": "Test tool",
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
});
|
|
108
|
-
// Check production-specific content
|
|
109
|
-
expect(result.contents[0]?.text).not.toContain(`${serverUrl}/assets/@react-refresh`);
|
|
110
|
-
expect(result.contents[0]?.text).not.toContain(`${serverUrl}@vite/client`);
|
|
111
|
-
expect(result.contents[0]?.text).toContain(`${serverUrl}/assets/my-widget.js`);
|
|
112
|
-
expect(result.contents[0]?.text).toContain(`${serverUrl}/assets/style.css`);
|
|
113
|
-
});
|
|
114
|
-
it("should resolve folder-based widgets (barrel files) in production mode", async () => {
|
|
115
|
-
setTestEnv({ NODE_ENV: "production" });
|
|
116
|
-
const mockToolCallback = vi.fn();
|
|
117
|
-
const mockRegisterResourceConfig = { description: "Folder widget" };
|
|
118
|
-
const mockToolConfig = { description: "Folder tool" };
|
|
119
|
-
server.registerWidget("folder-widget", mockRegisterResourceConfig, mockToolConfig, mockToolCallback);
|
|
120
|
-
const appsSdkResourceCallback = mockRegisterResource.mock
|
|
121
|
-
.calls[0]?.[3];
|
|
122
|
-
expect(appsSdkResourceCallback).toBeDefined();
|
|
123
|
-
const host = "myapp.com";
|
|
124
|
-
const serverUrl = `https://${host}`;
|
|
125
|
-
const mockExtra = createMockExtra(host);
|
|
126
|
-
const result = await appsSdkResourceCallback(new URL("ui://widgets/apps-sdk/folder-widget.html"), mockExtra);
|
|
127
|
-
// Should resolve to folder-widget.js from the manifest entry "src/widgets/folder-widget/index.tsx"
|
|
128
|
-
expect(result.contents[0]?.text).toContain(`${serverUrl}/assets/folder-widget.js`);
|
|
129
|
-
});
|
|
130
|
-
it("should register resources with correct hostType for both apps-sdk and ext-apps formats", async () => {
|
|
131
|
-
const mockToolCallback = vi.fn();
|
|
132
|
-
const mockRegisterResourceConfig = {
|
|
133
|
-
description: "Test widget",
|
|
134
|
-
_meta: { "openai/widgetPrefersBorder": true },
|
|
135
|
-
};
|
|
136
|
-
const mockToolConfig = { description: "Test tool" };
|
|
137
|
-
server.registerWidget("my-widget", mockRegisterResourceConfig, mockToolConfig, mockToolCallback);
|
|
138
|
-
expect(mockRegisterResource).toHaveBeenCalledTimes(2);
|
|
139
|
-
const appsSdkCallback = mockRegisterResource.mock
|
|
140
|
-
.calls[0]?.[3];
|
|
141
|
-
const appsSdkResult = await appsSdkCallback(new URL("ui://widgets/apps-sdk/my-widget.html"), createMockExtra("__not_used__"));
|
|
142
|
-
expect(appsSdkResult).toEqual({
|
|
143
|
-
contents: [
|
|
144
|
-
{
|
|
145
|
-
uri: "ui://widgets/apps-sdk/my-widget.html",
|
|
146
|
-
mimeType: "text/html+skybridge",
|
|
147
|
-
text: expect.stringContaining('<div id="root"></div>'),
|
|
148
|
-
_meta: {
|
|
149
|
-
"openai/widgetCSP": {
|
|
150
|
-
resource_domains: ["http://localhost:3000"],
|
|
151
|
-
connect_domains: [
|
|
152
|
-
"http://localhost:3000",
|
|
153
|
-
"ws://localhost:3000",
|
|
154
|
-
"ws://localhost:24678",
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
"openai/widgetDomain": "http://localhost:3000",
|
|
158
|
-
"openai/widgetDescription": "Test tool",
|
|
159
|
-
"openai/widgetPrefersBorder": true,
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
});
|
|
164
|
-
expect(appsSdkResult.contents[0]?.text).toContain('window.skybridge = { hostType: "apps-sdk" }');
|
|
165
|
-
const extAppsResourceCallback = mockRegisterResource.mock
|
|
166
|
-
.calls[1]?.[3];
|
|
167
|
-
expect(extAppsResourceCallback).toBeDefined();
|
|
168
|
-
const extAppsResult = await extAppsResourceCallback(new URL("ui://widgets/ext-apps/my-widget.html"), createMockExtra("__not_used__"));
|
|
169
|
-
expect(extAppsResult).toEqual({
|
|
170
|
-
contents: [
|
|
171
|
-
{
|
|
172
|
-
uri: "ui://widgets/ext-apps/my-widget.html",
|
|
173
|
-
mimeType: "text/html;profile=mcp-app",
|
|
174
|
-
text: expect.stringContaining('<div id="root"></div>'),
|
|
175
|
-
_meta: {
|
|
176
|
-
ui: {
|
|
177
|
-
csp: {
|
|
178
|
-
resourceDomains: ["http://localhost:3000"],
|
|
179
|
-
connectDomains: [
|
|
180
|
-
"http://localhost:3000",
|
|
181
|
-
"ws://localhost:3000",
|
|
182
|
-
"ws://localhost:24678",
|
|
183
|
-
],
|
|
184
|
-
},
|
|
185
|
-
domain: "http://localhost:3000",
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
});
|
|
191
|
-
expect(extAppsResult.contents[0]?.text).toContain('window.skybridge = { hostType: "mcp-app" }');
|
|
192
|
-
});
|
|
193
|
-
it("should register tool with ui.resourceUri metadata (not deprecated ui/resourceUri)", async () => {
|
|
194
|
-
const mockToolCallback = vi.fn();
|
|
195
|
-
const mockRegisterResourceConfig = { description: "Test widget" };
|
|
196
|
-
const mockToolConfig = { description: "Test tool" };
|
|
197
|
-
server.registerWidget("my-widget", mockRegisterResourceConfig, mockToolConfig, mockToolCallback);
|
|
198
|
-
expect(mockRegisterTool).toHaveBeenCalledTimes(1);
|
|
199
|
-
const toolCallArgs = mockRegisterTool.mock.calls[0];
|
|
200
|
-
const toolConfig = toolCallArgs?.[1];
|
|
201
|
-
expect(toolConfig._meta).toHaveProperty("ui");
|
|
202
|
-
expect(toolConfig._meta?.ui).toEqual({
|
|
203
|
-
resourceUri: "ui://widgets/ext-apps/my-widget.html",
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
it("should apply meta overrides in correct priority: defaults < ui.* < direct openai/* keys", async () => {
|
|
207
|
-
const mockToolCallback = vi.fn();
|
|
208
|
-
const mockRegisterResourceConfig = {
|
|
209
|
-
description: "Test widget",
|
|
210
|
-
_meta: {
|
|
211
|
-
// ui.csp overrides (middle priority)
|
|
212
|
-
ui: {
|
|
213
|
-
csp: {
|
|
214
|
-
resourceDomains: ["https://from-ui-csp.com"],
|
|
215
|
-
connectDomains: ["https://from-ui-csp.com"],
|
|
216
|
-
},
|
|
217
|
-
domain: "https://from-ui-domain.com",
|
|
218
|
-
prefersBorder: false,
|
|
219
|
-
},
|
|
220
|
-
// Direct openai/* keys (highest priority) - should override ui.*
|
|
221
|
-
"openai/widgetDomain": "https://direct-override.com",
|
|
222
|
-
"openai/widgetPrefersBorder": true,
|
|
223
|
-
},
|
|
224
|
-
};
|
|
225
|
-
const mockToolConfig = { description: "Test tool" };
|
|
226
|
-
server.registerWidget("override-test", mockRegisterResourceConfig, mockToolConfig, mockToolCallback);
|
|
227
|
-
const appsSdkCallback = mockRegisterResource.mock
|
|
228
|
-
.calls[0]?.[3];
|
|
229
|
-
const result = await appsSdkCallback(new URL("ui://widgets/apps-sdk/override-test.html"), createMockExtra("__not_used__"));
|
|
230
|
-
const meta = result.contents[0]?._meta;
|
|
231
|
-
// CSP arrays are merged by index - user value replaces at index 0, defaults remain at other indices
|
|
232
|
-
expect(meta["openai/widgetCSP"]).toEqual({
|
|
233
|
-
resource_domains: ["https://from-ui-csp.com"],
|
|
234
|
-
connect_domains: [
|
|
235
|
-
"https://from-ui-csp.com",
|
|
236
|
-
"ws://localhost:3000",
|
|
237
|
-
"ws://localhost:24678",
|
|
238
|
-
],
|
|
239
|
-
frame_domains: undefined,
|
|
240
|
-
redirect_domains: undefined,
|
|
241
|
-
});
|
|
242
|
-
// Domain should be overridden by direct openai/* key (highest priority)
|
|
243
|
-
expect(meta["openai/widgetDomain"]).toBe("https://direct-override.com");
|
|
244
|
-
// PrefersBorder should be overridden by direct openai/* key (highest priority)
|
|
245
|
-
expect(meta["openai/widgetPrefersBorder"]).toBe(true);
|
|
246
|
-
// Description should be from defaults (toolConfig.description)
|
|
247
|
-
expect(meta["openai/widgetDescription"]).toBe("Test tool");
|
|
248
|
-
});
|
|
249
|
-
});
|
|
250
|
-
//# sourceMappingURL=widget.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widget.test.js","sourceRoot":"","sources":["../../src/test/widget.test.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,EAAE,EAEF,EAAE,GACH,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,MAAM,YAAY,GAAG;IACnB,2BAA2B,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;IACrD,qCAAqC,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE;IACnE,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;CACnC,CAAC;AAEF,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AAEpD,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;IACtB,MAAM,gBAAgB,GAAG,CACvB,IAA+C,EAC/C,GAAG,IAAe,EACsB,EAAE;QAC1C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YAC/D,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAEjC,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IAC5C,CAAC,CAAC;IACF,MAAM,YAAY,GAAG,EAAE,CAAC,EAAE,CAAC,gBAAgB,CAA+B,CAAC;IAE3E,OAAO;QACL,YAAY;QACZ,OAAO,EAAE;YACP,YAAY;SACb;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,IAAI,MAAiB,CAAC;IACtB,IA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