skybridge 0.0.0-dev.66d1090 → 0.0.0-dev.66ea4ea

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/README.md +145 -0
  2. package/bin/run.js +0 -4
  3. package/dist/cli/detect-port.d.ts +18 -0
  4. package/dist/cli/detect-port.js +61 -0
  5. package/dist/cli/detect-port.js.map +1 -0
  6. package/dist/cli/header.d.ts +4 -0
  7. package/dist/cli/header.js +6 -0
  8. package/dist/cli/header.js.map +1 -0
  9. package/dist/cli/run-command.d.ts +2 -0
  10. package/dist/cli/run-command.js +43 -0
  11. package/dist/cli/run-command.js.map +1 -0
  12. package/dist/cli/telemetry.d.ts +7 -0
  13. package/dist/cli/telemetry.js +123 -0
  14. package/dist/cli/telemetry.js.map +1 -0
  15. package/dist/cli/use-execute-steps.d.ts +11 -0
  16. package/dist/cli/use-execute-steps.js +36 -0
  17. package/dist/cli/use-execute-steps.js.map +1 -0
  18. package/dist/cli/use-nodemon.d.ts +6 -0
  19. package/dist/cli/use-nodemon.js +69 -0
  20. package/dist/cli/use-nodemon.js.map +1 -0
  21. package/dist/cli/use-typescript-check.d.ts +8 -0
  22. package/dist/cli/use-typescript-check.js +59 -0
  23. package/dist/cli/use-typescript-check.js.map +1 -0
  24. package/dist/commands/build.d.ts +9 -0
  25. package/dist/commands/build.js +46 -0
  26. package/dist/commands/build.js.map +1 -0
  27. package/dist/commands/dev.d.ts +4 -1
  28. package/dist/commands/dev.js +33 -21
  29. package/dist/commands/dev.js.map +1 -1
  30. package/dist/commands/start.d.ts +4 -2
  31. package/dist/commands/start.js +39 -29
  32. package/dist/commands/start.js.map +1 -1
  33. package/dist/commands/telemetry/disable.d.ts +5 -0
  34. package/dist/commands/telemetry/disable.js +14 -0
  35. package/dist/commands/telemetry/disable.js.map +1 -0
  36. package/dist/commands/telemetry/enable.d.ts +5 -0
  37. package/dist/commands/telemetry/enable.js +14 -0
  38. package/dist/commands/telemetry/enable.js.map +1 -0
  39. package/dist/commands/telemetry/status.d.ts +5 -0
  40. package/dist/commands/telemetry/status.js +14 -0
  41. package/dist/commands/telemetry/status.js.map +1 -0
  42. package/dist/server/asset-base-url-transform-plugin.d.ts +11 -0
  43. package/dist/server/asset-base-url-transform-plugin.js +34 -0
  44. package/dist/server/asset-base-url-transform-plugin.js.map +1 -0
  45. package/dist/server/asset-base-url-transform-plugin.test.js +56 -0
  46. package/dist/server/asset-base-url-transform-plugin.test.js.map +1 -0
  47. package/dist/server/const.d.ts +1 -0
  48. package/dist/server/const.js +2 -0
  49. package/dist/server/const.js.map +1 -0
  50. package/dist/server/express.d.ts +9 -0
  51. package/dist/server/express.js +72 -0
  52. package/dist/server/express.js.map +1 -0
  53. package/dist/server/express.test.d.ts +1 -0
  54. package/dist/server/express.test.js +74 -0
  55. package/dist/server/express.test.js.map +1 -0
  56. package/dist/server/server.d.ts +8 -4
  57. package/dist/server/server.js +131 -59
  58. package/dist/server/server.js.map +1 -1
  59. package/dist/server/templateHelper.d.ts +1 -0
  60. package/dist/server/templateHelper.js.map +1 -1
  61. package/dist/server/templates/development.hbs +3 -2
  62. package/dist/server/templates/production.hbs +1 -2
  63. package/dist/server/widgetsDevServer.js +17 -1
  64. package/dist/server/widgetsDevServer.js.map +1 -1
  65. package/dist/test/widget.test.js +43 -16
  66. package/dist/test/widget.test.js.map +1 -1
  67. package/dist/web/bridges/apps-sdk/adaptor.d.ts +22 -0
  68. package/dist/web/bridges/apps-sdk/adaptor.js +71 -0
  69. package/dist/web/bridges/apps-sdk/adaptor.js.map +1 -0
  70. package/dist/web/bridges/apps-sdk/bridge.d.ts +10 -0
  71. package/dist/web/bridges/{apps-sdk-bridge.js → apps-sdk/bridge.js} +2 -2
  72. package/dist/web/bridges/apps-sdk/bridge.js.map +1 -0
  73. package/dist/web/bridges/apps-sdk/index.d.ts +5 -0
  74. package/dist/web/bridges/apps-sdk/index.js +5 -0
  75. package/dist/web/bridges/apps-sdk/index.js.map +1 -0
  76. package/dist/web/bridges/apps-sdk/types.d.ts +118 -0
  77. package/dist/web/bridges/apps-sdk/types.js +10 -0
  78. package/dist/web/bridges/apps-sdk/types.js.map +1 -0
  79. package/dist/web/bridges/apps-sdk/use-apps-sdk-context.d.ts +2 -0
  80. package/dist/web/bridges/{hooks/use-apps-sdk-bridge.js → apps-sdk/use-apps-sdk-context.js} +3 -3
  81. package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js.map +1 -0
  82. package/dist/web/bridges/get-adaptor.d.ts +2 -0
  83. package/dist/web/bridges/get-adaptor.js +8 -0
  84. package/dist/web/bridges/get-adaptor.js.map +1 -0
  85. package/dist/web/bridges/index.d.ts +5 -4
  86. package/dist/web/bridges/index.js +5 -4
  87. package/dist/web/bridges/index.js.map +1 -1
  88. package/dist/web/bridges/mcp-app/adaptor.d.ts +36 -0
  89. package/dist/web/bridges/mcp-app/adaptor.js +190 -0
  90. package/dist/web/bridges/mcp-app/adaptor.js.map +1 -0
  91. package/dist/web/bridges/{mcp-app-bridge.d.ts → mcp-app/bridge.d.ts} +10 -13
  92. package/dist/web/bridges/{mcp-app-bridge.js → mcp-app/bridge.js} +76 -33
  93. package/dist/web/bridges/mcp-app/bridge.js.map +1 -0
  94. package/dist/web/bridges/mcp-app/index.d.ts +4 -0
  95. package/dist/web/bridges/mcp-app/index.js +4 -0
  96. package/dist/web/bridges/mcp-app/index.js.map +1 -0
  97. package/dist/web/bridges/mcp-app/types.d.ts +8 -0
  98. package/dist/web/bridges/mcp-app/types.js +2 -0
  99. package/dist/web/bridges/mcp-app/types.js.map +1 -0
  100. package/dist/web/bridges/mcp-app/use-mcp-app-context.d.ts +5 -0
  101. package/dist/web/bridges/{hooks/use-mcp-app-bridge.js → mcp-app/use-mcp-app-context.js} +3 -3
  102. package/dist/web/bridges/mcp-app/use-mcp-app-context.js.map +1 -0
  103. package/dist/web/bridges/mcp-app/use-mcp-app-context.test.d.ts +1 -0
  104. package/dist/web/bridges/{hooks/use-mcp-app-bridge.test.js → mcp-app/use-mcp-app-context.test.js} +17 -13
  105. package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js.map +1 -0
  106. package/dist/web/bridges/types.d.ts +65 -24
  107. package/dist/web/bridges/use-host-context.d.ts +2 -0
  108. package/dist/web/bridges/use-host-context.js +8 -0
  109. package/dist/web/bridges/use-host-context.js.map +1 -0
  110. package/dist/web/components/modal-provider.d.ts +4 -0
  111. package/dist/web/components/modal-provider.js +47 -0
  112. package/dist/web/components/modal-provider.js.map +1 -0
  113. package/dist/web/create-store.js +6 -7
  114. package/dist/web/create-store.js.map +1 -1
  115. package/dist/web/create-store.test.js +108 -52
  116. package/dist/web/create-store.test.js.map +1 -1
  117. package/dist/web/data-llm.js +5 -3
  118. package/dist/web/data-llm.js.map +1 -1
  119. package/dist/web/data-llm.test.js +130 -65
  120. package/dist/web/data-llm.test.js.map +1 -1
  121. package/dist/web/generate-helpers.d.ts +3 -2
  122. package/dist/web/generate-helpers.js +1 -1
  123. package/dist/web/generate-helpers.js.map +1 -1
  124. package/dist/web/helpers/state.js +13 -8
  125. package/dist/web/helpers/state.js.map +1 -1
  126. package/dist/web/hooks/index.d.ts +1 -1
  127. package/dist/web/hooks/index.js +1 -1
  128. package/dist/web/hooks/index.js.map +1 -1
  129. package/dist/web/hooks/test/utils.d.ts +8 -2
  130. package/dist/web/hooks/test/utils.js +33 -13
  131. package/dist/web/hooks/test/utils.js.map +1 -1
  132. package/dist/web/hooks/use-call-tool.d.ts +3 -2
  133. package/dist/web/hooks/use-call-tool.js +2 -2
  134. package/dist/web/hooks/use-call-tool.js.map +1 -1
  135. package/dist/web/hooks/use-call-tool.test-d.js +1 -1
  136. package/dist/web/hooks/use-call-tool.test-d.js.map +1 -1
  137. package/dist/web/hooks/use-call-tool.test.js +3 -3
  138. package/dist/web/hooks/use-call-tool.test.js.map +1 -1
  139. package/dist/web/hooks/use-display-mode.js +3 -4
  140. package/dist/web/hooks/use-display-mode.js.map +1 -1
  141. package/dist/web/hooks/use-files.d.ts +2 -6
  142. package/dist/web/hooks/use-files.js +4 -2
  143. package/dist/web/hooks/use-files.js.map +1 -1
  144. package/dist/web/hooks/use-files.test.js +6 -1
  145. package/dist/web/hooks/use-files.test.js.map +1 -1
  146. package/dist/web/hooks/use-layout.d.ts +2 -2
  147. package/dist/web/hooks/use-layout.js +4 -4
  148. package/dist/web/hooks/use-layout.js.map +1 -1
  149. package/dist/web/hooks/use-layout.test.js +6 -5
  150. package/dist/web/hooks/use-layout.test.js.map +1 -1
  151. package/dist/web/hooks/use-open-external.js +2 -2
  152. package/dist/web/hooks/use-open-external.test.js +1 -1
  153. package/dist/web/hooks/use-request-modal.d.ts +2 -2
  154. package/dist/web/hooks/use-request-modal.js +9 -7
  155. package/dist/web/hooks/use-request-modal.js.map +1 -1
  156. package/dist/web/hooks/use-send-follow-up-message.js +2 -2
  157. package/dist/web/hooks/use-set-open-in-app-url.d.ts +1 -0
  158. package/dist/web/hooks/use-set-open-in-app-url.js +8 -0
  159. package/dist/web/hooks/use-set-open-in-app-url.js.map +1 -0
  160. package/dist/web/hooks/use-set-open-in-app-url.test.d.ts +1 -0
  161. package/dist/web/hooks/use-set-open-in-app-url.test.js +43 -0
  162. package/dist/web/hooks/use-set-open-in-app-url.test.js.map +1 -0
  163. package/dist/web/hooks/use-tool-info.js +4 -4
  164. package/dist/web/hooks/use-tool-info.js.map +1 -1
  165. package/dist/web/hooks/use-tool-info.test.js +4 -4
  166. package/dist/web/hooks/use-tool-info.test.js.map +1 -1
  167. package/dist/web/hooks/use-user.d.ts +1 -1
  168. package/dist/web/hooks/use-user.js +3 -3
  169. package/dist/web/hooks/use-user.js.map +1 -1
  170. package/dist/web/hooks/use-user.test.js +4 -3
  171. package/dist/web/hooks/use-user.test.js.map +1 -1
  172. package/dist/web/hooks/use-widget-state.js +10 -10
  173. package/dist/web/hooks/use-widget-state.js.map +1 -1
  174. package/dist/web/hooks/use-widget-state.test.js +7 -6
  175. package/dist/web/hooks/use-widget-state.test.js.map +1 -1
  176. package/dist/web/mount-widget.js +9 -1
  177. package/dist/web/mount-widget.js.map +1 -1
  178. package/dist/web/plugin/plugin.js +16 -9
  179. package/dist/web/plugin/plugin.js.map +1 -1
  180. package/dist/web/proxy.js +0 -1
  181. package/dist/web/proxy.js.map +1 -1
  182. package/dist/web/types.d.ts +0 -133
  183. package/dist/web/types.js +0 -9
  184. package/dist/web/types.js.map +1 -1
  185. package/package.json +32 -21
  186. package/tsconfig.base.json +28 -0
  187. package/dist/cli/use-version.d.ts +0 -1
  188. package/dist/cli/use-version.js +0 -33
  189. package/dist/cli/use-version.js.map +0 -1
  190. package/dist/web/bridges/adaptors/apps-sdk-adaptor.d.ts +0 -13
  191. package/dist/web/bridges/adaptors/apps-sdk-adaptor.js +0 -33
  192. package/dist/web/bridges/adaptors/apps-sdk-adaptor.js.map +0 -1
  193. package/dist/web/bridges/adaptors/mcp-app-adaptor.d.ts +0 -16
  194. package/dist/web/bridges/adaptors/mcp-app-adaptor.js +0 -115
  195. package/dist/web/bridges/adaptors/mcp-app-adaptor.js.map +0 -1
  196. package/dist/web/bridges/apps-sdk-bridge.d.ts +0 -10
  197. package/dist/web/bridges/apps-sdk-bridge.js.map +0 -1
  198. package/dist/web/bridges/hooks/use-adaptor.d.ts +0 -2
  199. package/dist/web/bridges/hooks/use-adaptor.js +0 -8
  200. package/dist/web/bridges/hooks/use-adaptor.js.map +0 -1
  201. package/dist/web/bridges/hooks/use-apps-sdk-bridge.d.ts +0 -2
  202. package/dist/web/bridges/hooks/use-apps-sdk-bridge.js.map +0 -1
  203. package/dist/web/bridges/hooks/use-bridge.d.ts +0 -2
  204. package/dist/web/bridges/hooks/use-bridge.js +0 -8
  205. package/dist/web/bridges/hooks/use-bridge.js.map +0 -1
  206. package/dist/web/bridges/hooks/use-mcp-app-bridge.d.ts +0 -5
  207. package/dist/web/bridges/hooks/use-mcp-app-bridge.js.map +0 -1
  208. package/dist/web/bridges/hooks/use-mcp-app-bridge.test.js.map +0 -1
  209. package/dist/web/bridges/mcp-app-bridge.js.map +0 -1
  210. package/dist/web/hooks/use-openai-global.d.ts +0 -3
  211. package/dist/web/hooks/use-openai-global.js +0 -6
  212. package/dist/web/hooks/use-openai-global.js.map +0 -1
  213. /package/dist/{web/bridges/hooks/use-mcp-app-bridge.test.d.ts → server/asset-base-url-transform-plugin.test.d.ts} +0 -0
@@ -5,18 +5,18 @@ export function skybridge() {
5
5
  async config(config) {
6
6
  // Dynamic imports to ensure Node modules are only loaded in Node.js context
7
7
  const { globSync } = await import("node:fs");
8
- const { resolve } = await import("node:path");
8
+ const { basename, dirname, parse, resolve } = await import("node:path");
9
9
  const projectRoot = config.root || process.cwd();
10
10
  const flatWidgetPattern = resolve(projectRoot, "src/widgets/*.{js,ts,jsx,tsx,html}");
11
11
  const dirWidgetPattern = resolve(projectRoot, "src/widgets/*/index.tsx");
12
- const flatWidgets = globSync(flatWidgetPattern).map((file) => [
13
- file.match(/src\/widgets\/([^/]+)\.tsx$/)?.[1],
14
- file,
15
- ]);
16
- const dirWidgets = globSync(dirWidgetPattern).map((file) => [
17
- file.match(/src\/widgets\/([^/]+)\/index\.tsx$/)?.[1],
18
- file,
19
- ]);
12
+ const flatWidgets = globSync(flatWidgetPattern).map((file) => {
13
+ const name = parse(file).name;
14
+ return [name, file];
15
+ });
16
+ const dirWidgets = globSync(dirWidgetPattern).map((file) => {
17
+ const name = basename(dirname(file));
18
+ return [name, file];
19
+ });
20
20
  const input = Object.fromEntries([...flatWidgets, ...dirWidgets]);
21
21
  return {
22
22
  base: "/assets",
@@ -28,6 +28,13 @@ export function skybridge() {
28
28
  input,
29
29
  },
30
30
  },
31
+ experimental: {
32
+ renderBuiltUrl: (filename) => {
33
+ return {
34
+ runtime: `window.skybridge.serverUrl + "/assets/${filename}"`,
35
+ };
36
+ },
37
+ },
31
38
  };
32
39
  },
33
40
  enforce: "pre",
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/web/plugin/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,CAAC,IAAI,CAAC,CAAC,CAAC;gBACrC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,WAAW,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;YAElE,OAAO;gBACL,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE;oBACL,QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,IAAI;oBACZ,YAAY,EAAE,KAAK;oBACnB,aAAa,EAAE;wBACb,KAAK;qBACN;iBACF;gBACD,YAAY,EAAE;oBACZ,cAAc,EAAE,CAAC,QAAQ,EAAE,EAAE;wBAC3B,OAAO;4BACL,OAAO,EAAE,yCAAyC,QAAQ,GAAG;yBAC9D,CAAC;oBACJ,CAAC;iBACF;aACF,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,KAAK;QACd,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE;YACtB,OAAO,MAAM,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1C,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/web/proxy.js CHANGED
@@ -6,7 +6,6 @@ const colors = {
6
6
  };
7
7
  export function installOpenAILoggingProxy() {
8
8
  if (typeof window === "undefined" || !window.openai) {
9
- console.warn("[openai-proxy] window.openai not found, skipping proxy installation");
10
9
  return;
11
10
  }
12
11
  const descriptor = Object.getOwnPropertyDescriptor(window, "openai");
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/web/proxy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;CACR,CAAC;AAEX,MAAM,UAAU,yBAAyB;IACvC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAA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,CAAC;IAEnD,OAAO,CAAC,GAAG,CACT,8DAA8D,EAC9D,UAAU,MAAM,CAAC,KAAK,EAAE,EACxB,UAAU,MAAM,CAAC,IAAI,EAAE,CACxB,CAAC;AACJ,CAAC"}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AAyBf,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,OAAO,iBAAkB,SAAQ,WAErC;IACkB,IAAI,GAAG,wBAAwB,CAAC;CACnD;AAuGD,sDAAsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC3D,MAAM,OAAO,eAAgB,SAAQ,WAEnC;IACkB,IAAI,GAAG,sBAAsB,CAAC;CACjD"}
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,20 @@
1
1
  {
2
2
  "name": "skybridge",
3
- "version": "0.0.0-dev.66d1090",
4
- "description": "Skybridge is a framework for building ChatGPT apps",
3
+ "version": "0.0.0-dev.66ea4ea",
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
10
  "files": [
11
- "dist"
11
+ "dist",
12
+ "README.md",
13
+ "tsconfig.base.json"
12
14
  ],
13
15
  "exports": {
16
+ "./tsconfig": "./tsconfig.base.json",
17
+ "./tsconfig.json": "./tsconfig.base.json",
14
18
  "./server": {
15
19
  "types": "./dist/server/index.d.ts",
16
20
  "default": "./dist/server/index.js"
@@ -30,42 +34,46 @@
30
34
  "license": "ISC",
31
35
  "peerDependencies": {
32
36
  "@modelcontextprotocol/sdk": ">=1.0.0",
37
+ "@skybridge/devtools": ">=0.26.1",
38
+ "nodemon": ">=3.0.0",
33
39
  "react": ">=18.0.0",
34
- "react-dom": ">=18.0.0"
40
+ "react-dom": ">=18.0.0",
41
+ "vite": "^7.3.1"
35
42
  },
36
43
  "dependencies": {
37
- "@babel/core": "^7.28.5",
44
+ "@babel/core": "^7.29.0",
38
45
  "@oclif/core": "^4.8.0",
39
- "cors": "^2.8.5",
46
+ "ci-info": "^4.4.0",
47
+ "cors": "^2.8.6",
40
48
  "dequal": "^2.0.3",
41
- "es-toolkit": "^1.43.0",
49
+ "es-toolkit": "^1.44.0",
42
50
  "express": "^5.2.1",
43
51
  "handlebars": "^4.7.8",
44
- "ink": "^6.6.0",
52
+ "ink": "^6.8.0",
53
+ "posthog-node": "^5.24.17",
45
54
  "superjson": "^2.2.6",
46
- "vite": "^7.3.1",
47
- "zustand": "^5.0.9"
55
+ "zustand": "^5.0.11"
48
56
  },
49
57
  "devDependencies": {
50
- "@modelcontextprotocol/ext-apps": "^0.2.2",
51
- "@modelcontextprotocol/sdk": "^1.25.2",
58
+ "@modelcontextprotocol/ext-apps": "^1.0.1",
59
+ "@modelcontextprotocol/sdk": "^1.27.0",
52
60
  "@testing-library/dom": "^10.4.1",
53
- "@testing-library/react": "^16.3.1",
61
+ "@testing-library/react": "^16.3.2",
54
62
  "@total-typescript/tsconfig": "^1.0.4",
55
63
  "@types/babel__core": "^7.20.5",
56
64
  "@types/cors": "^2.8.19",
57
65
  "@types/express": "^5.0.6",
58
66
  "@types/jsdom": "^27.0.0",
59
- "@types/node": "^24.10.4",
60
- "@types/react": "^19.2.7",
67
+ "@types/node": "^24.10.13",
68
+ "@types/react": "^19.2.14",
61
69
  "@types/react-dom": "^19.2.3",
62
- "@vitest/ui": "^4.0.16",
63
- "jsdom": "^27.4.0",
64
- "shx": "^0.3.4",
70
+ "@vitest/ui": "^4.0.18",
71
+ "jsdom": "^28.1.0",
72
+ "shx": "^0.4.0",
65
73
  "ts-node": "^10.9.2",
66
74
  "typescript": "^5.9.3",
67
- "vitest": "^4.0.16",
68
- "zod": "^4.3.5"
75
+ "vitest": "^4.0.18",
76
+ "zod": "^4.3.6"
69
77
  },
70
78
  "bin": {
71
79
  "sb": "./bin/run.js",
@@ -75,7 +83,10 @@
75
83
  "bin": "skybridge",
76
84
  "commands": "./dist/commands",
77
85
  "dirname": "skybridge",
78
- "topicSeparator": " "
86
+ "topicSeparator": " ",
87
+ "hooks": {
88
+ "finally": "./dist/cli/telemetry"
89
+ }
79
90
  },
80
91
  "scripts": {
81
92
  "build": "shx rm -rf dist && tsc && pnpm run build:templates",
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Module resolution options
4
+ "module": "NodeNext",
5
+ "esModuleInterop": true,
6
+ "verbatimModuleSyntax": true,
7
+
8
+ // Output options
9
+ "noEmit": false,
10
+ "incremental": true,
11
+ "sourceMap": true,
12
+
13
+ // Language and environment options
14
+ "target": "ES2022",
15
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
16
+ "jsx": "react-jsx",
17
+
18
+ // Strictness and checking options
19
+ "strict": true,
20
+ "skipLibCheck": true,
21
+ "forceConsistentCasingInFileNames": true,
22
+
23
+ // Code quality & diagnostics
24
+ "noUnusedLocals": true,
25
+ "noUnusedParameters": true,
26
+ "noFallthroughCasesInSwitch": true
27
+ }
28
+ }
@@ -1 +0,0 @@
1
- export declare const useVersion: () => string | undefined;
@@ -1,33 +0,0 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import { useEffect, useState } from "react";
5
- function findPackageJson(startDir) {
6
- let currentDir = startDir;
7
- const root = path.parse(currentDir).root;
8
- while (currentDir !== root) {
9
- const packageJsonPath = path.join(currentDir, "package.json");
10
- if (existsSync(packageJsonPath)) {
11
- return packageJsonPath;
12
- }
13
- currentDir = path.dirname(currentDir);
14
- }
15
- return null;
16
- }
17
- function getPackageVersion() {
18
- const currentFileDir = path.dirname(fileURLToPath(import.meta.url));
19
- const packageJsonPath = findPackageJson(currentFileDir);
20
- if (!packageJsonPath) {
21
- return "";
22
- }
23
- const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
24
- return packageJson.version || "";
25
- }
26
- export const useVersion = () => {
27
- const [version, setVersion] = useState();
28
- useEffect(() => {
29
- setVersion(getPackageVersion());
30
- }, []);
31
- return version;
32
- };
33
- //# sourceMappingURL=use-version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-version.js","sourceRoot":"","sources":["../../src/cli/use-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,SAAS,eAAe,CAAC,QAAgB;IACvC,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;IAEzC,OAAO,UAAU,KAAK,IAAI,EAAE,CAAC;QAC3B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QAC9D,IAAI,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;YAChC,OAAO,eAAe,CAAC;QACzB,CAAC;QACD,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,iBAAiB;IACxB,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACpE,MAAM,eAAe,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAExD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;IACvE,OAAO,WAAW,CAAC,OAAO,IAAI,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAU,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAClC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { Adaptor, BridgeInterface, CallToolResponse, DisplayMode, ExternalStore } from "../types.js";
2
- export declare class AppsSdkAdaptor implements Adaptor {
3
- private static instance;
4
- static getInstance(): AppsSdkAdaptor;
5
- static resetInstance(): void;
6
- getExternalStore<K extends keyof BridgeInterface>(key: K): ExternalStore<K>;
7
- callTool: <ToolArgs extends Record<string, unknown> | null = null, ToolResponse extends CallToolResponse = CallToolResponse>(name: string, args: ToolArgs) => Promise<ToolResponse>;
8
- requestDisplayMode: (mode: DisplayMode) => Promise<{
9
- mode: DisplayMode;
10
- }>;
11
- sendFollowUpMessage: (prompt: string) => Promise<void>;
12
- openExternal(href: string): void;
13
- }
@@ -1,33 +0,0 @@
1
- import { AppsSdkBridge } from "../apps-sdk-bridge.js";
2
- export class AppsSdkAdaptor {
3
- static instance = null;
4
- static getInstance() {
5
- if (!AppsSdkAdaptor.instance) {
6
- AppsSdkAdaptor.instance = new AppsSdkAdaptor();
7
- }
8
- return AppsSdkAdaptor.instance;
9
- }
10
- static resetInstance() {
11
- AppsSdkAdaptor.instance = null;
12
- }
13
- getExternalStore(key) {
14
- const bridge = AppsSdkBridge.getInstance();
15
- return {
16
- subscribe: bridge.subscribe(key),
17
- getSnapshot: () => bridge.getSnapshot(key),
18
- };
19
- }
20
- callTool = async (name, args) => {
21
- return window.openai.callTool(name, args);
22
- };
23
- requestDisplayMode = (mode) => {
24
- return window.openai.requestDisplayMode({ mode });
25
- };
26
- sendFollowUpMessage = (prompt) => {
27
- return window.openai.sendFollowUpMessage({ prompt });
28
- };
29
- openExternal(href) {
30
- window.openai.openExternal({ href });
31
- }
32
- }
33
- //# sourceMappingURL=apps-sdk-adaptor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apps-sdk-adaptor.js","sourceRoot":"","sources":["../../../../src/web/bridges/adaptors/apps-sdk-adaptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAStD,MAAM,OAAO,cAAc;IACjB,MAAM,CAAC,QAAQ,GAA0B,IAAI,CAAC;IAE/C,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;YAC7B,cAAc,CAAC,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;QACjD,CAAC;QACD,OAAO,cAAc,CAAC,QAAQ,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,aAAa;QACzB,cAAc,CAAC,QAAQ,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,gBAAgB,CACrB,GAAM;QAEN,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC;QAC3C,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC;YAChC,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC;SAC3C,CAAC;IACJ,CAAC;IAEM,QAAQ,GAAG,KAAK,EAIrB,IAAY,EACZ,IAAc,EACS,EAAE;QACzB,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAyB,IAAI,EAAE,IAAI,CAAC,CAAC;IACpE,CAAC,CAAC;IAEK,kBAAkB,GAAG,CAC1B,IAAiB,EACe,EAAE;QAClC,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC;IAEK,mBAAmB,GAAG,CAAC,MAAc,EAAiB,EAAE;QAC7D,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC;IAEK,YAAY,CAAC,IAAY;QAC9B,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { McpUiRequestDisplayModeResult } from "@modelcontextprotocol/ext-apps";
2
- import type { Adaptor, BridgeInterface, CallToolResponse, DisplayMode, ExternalStore } from "../types.js";
3
- export declare class McpAppAdaptor implements Adaptor {
4
- private static instance;
5
- private stores;
6
- private constructor();
7
- static getInstance(): McpAppAdaptor;
8
- static resetInstance(): void;
9
- getExternalStore<K extends keyof BridgeInterface>(key: K): ExternalStore<K>;
10
- callTool: <ToolArgs extends Record<string, unknown> | null = null, ToolResponse extends CallToolResponse = CallToolResponse>(name: string, args: ToolArgs) => Promise<ToolResponse>;
11
- requestDisplayMode: (mode: DisplayMode) => Promise<McpUiRequestDisplayModeResult>;
12
- sendFollowUpMessage: (prompt: string) => Promise<void>;
13
- openExternal(href: string): void;
14
- private initializeStores;
15
- private createExternalStore;
16
- }
@@ -1,115 +0,0 @@
1
- import { dequal } from "dequal/lite";
2
- import { McpAppBridge, } from "../mcp-app-bridge.js";
3
- export class McpAppAdaptor {
4
- static instance = null;
5
- stores;
6
- constructor() {
7
- this.stores = this.initializeStores();
8
- }
9
- static getInstance() {
10
- if (!McpAppAdaptor.instance) {
11
- McpAppAdaptor.instance = new McpAppAdaptor();
12
- }
13
- return McpAppAdaptor.instance;
14
- }
15
- static resetInstance() {
16
- McpAppAdaptor.instance = null;
17
- }
18
- getExternalStore(key) {
19
- return this.stores[key];
20
- }
21
- callTool = async (name, args) => {
22
- const bridge = McpAppBridge.getInstance();
23
- const response = await bridge.request({
24
- method: "tools/call",
25
- params: {
26
- name,
27
- arguments: args ?? undefined,
28
- },
29
- });
30
- const result = response.content
31
- .filter((content) => content.type === "text")
32
- .map(({ text }) => text)
33
- .join("\n");
34
- return {
35
- content: response.content,
36
- structuredContent: response.structuredContent ?? {},
37
- isError: response.isError ?? false,
38
- result,
39
- _meta: response._meta ?? {},
40
- };
41
- };
42
- requestDisplayMode = (mode) => {
43
- const bridge = McpAppBridge.getInstance();
44
- if (mode !== "modal") {
45
- return bridge.request({
46
- method: "ui/request-display-mode",
47
- params: { mode },
48
- });
49
- }
50
- throw new Error("Modal display mode is not accessible in MCP App.");
51
- };
52
- sendFollowUpMessage = async (prompt) => {
53
- const bridge = McpAppBridge.getInstance();
54
- await bridge.request({
55
- method: "ui/message",
56
- params: {
57
- role: "user",
58
- content: [
59
- {
60
- type: "text",
61
- text: prompt,
62
- },
63
- ],
64
- },
65
- });
66
- };
67
- openExternal(href) {
68
- const bridge = McpAppBridge.getInstance();
69
- bridge.request({
70
- method: "ui/open-link",
71
- params: { url: href },
72
- });
73
- }
74
- initializeStores() {
75
- return {
76
- theme: this.createExternalStore(["theme"], ({ theme }) => theme ?? "light"),
77
- locale: this.createExternalStore(["locale"], ({ locale }) => locale ?? "en-US"),
78
- safeArea: this.createExternalStore(["safeAreaInsets"], ({ safeAreaInsets }) => ({
79
- insets: safeAreaInsets ?? { top: 0, right: 0, bottom: 0, left: 0 },
80
- })),
81
- displayMode: this.createExternalStore(["displayMode"], ({ displayMode }) => displayMode ?? "inline"),
82
- maxHeight: this.createExternalStore(["viewport"], ({ viewport }) => viewport?.maxHeight ?? window.innerHeight),
83
- userAgent: this.createExternalStore(["platform", "deviceCapabilities"], ({ platform, deviceCapabilities }) => ({
84
- device: {
85
- type: platform === "web" ? "desktop" : (platform ?? "unknown"),
86
- },
87
- capabilities: {
88
- hover: true,
89
- touch: true,
90
- ...deviceCapabilities,
91
- },
92
- })),
93
- toolInput: this.createExternalStore(["toolInput"], ({ toolInput }) => toolInput ?? null),
94
- toolOutput: this.createExternalStore(["toolResult"], ({ toolResult }) => toolResult?.structuredContent ?? null),
95
- toolResponseMetadata: this.createExternalStore(["toolResult"], ({ toolResult }) => toolResult?._meta ?? null),
96
- };
97
- }
98
- createExternalStore(keys, computeSnapshot) {
99
- const bridge = McpAppBridge.getInstance();
100
- let cachedValue;
101
- return {
102
- subscribe: bridge.subscribe(keys),
103
- getSnapshot: () => {
104
- const context = Object.fromEntries(keys.map((k) => [k, bridge.getSnapshot(k)]));
105
- const newValue = computeSnapshot(context);
106
- if (cachedValue !== undefined && dequal(cachedValue, newValue)) {
107
- return cachedValue;
108
- }
109
- cachedValue = newValue;
110
- return newValue;
111
- },
112
- };
113
- }
114
- }
115
- //# sourceMappingURL=mcp-app-adaptor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-app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E,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,IAAI,IAAI,CACrC;YACD,UAAU,EAAE,IAAI,CAAC,mBAAmB,CAClC,CAAC,YAAY,CAAC,EACd,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,EAAE,iBAAiB,IAAI,IAAI,CAC1D;YACD,oBAAoB,EAAE,IAAI,CAAC,mBAAmB,CAC5C,CAAC,YAAY,CAAC,EACd,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,EAAE,KAAK,IAAI,IAAI,CAC9C;SACF,CAAC;IACJ,CAAC;IAEO,mBAAmB,CACzB,IAAU,EACV,eAAkD;QAElD,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,WAA0B,CAAC;QAE/B,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YACjC,WAAW,EAAE,GAAG,EAAE;gBAChB,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAChC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CACvB,CAAC;gBACvB,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;gBAE1C,IAAI,WAAW,KAAK,SAAS,IAAI,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC;oBAC/D,OAAO,WAAW,CAAC;gBACrB,CAAC;gBAED,WAAW,GAAG,QAAQ,CAAC;gBACvB,OAAO,QAAQ,CAAC;YAClB,CAAC;SACF,CAAC;IACJ,CAAC"}
@@ -1,10 +0,0 @@
1
- import { type OpenAiProperties } from "../types.js";
2
- import type { Bridge, Subscribe } from "./types.js";
3
- export declare class AppsSdkBridge implements Bridge<OpenAiProperties> {
4
- private static instance;
5
- static getInstance(): AppsSdkBridge;
6
- static resetInstance(): void;
7
- subscribe(key: keyof OpenAiProperties): Subscribe;
8
- subscribe(keys: readonly (keyof OpenAiProperties)[]): Subscribe;
9
- getSnapshot: <K extends keyof OpenAiProperties>(key: K) => (import("../types.js").OpenAiMethods<import("../types.js").UnknownObject> & OpenAiProperties<Record<never, unknown>, import("../types.js").UnknownObject, import("../types.js").UnknownObject, import("../types.js").UnknownObject>)[K];
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"apps-sdk-bridge.js","sourceRoot":"","sources":["../../../src/web/bridges/apps-sdk-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,GAEvB,MAAM,aAAa,CAAC;AAGrB,MAAM,OAAO,aAAa;IAChB,MAAM,CAAC,QAAQ,GAAyB,IAAI,CAAC;IAE9C,MAAM,CAAC,WAAW;QACvB,IACE,MAAM,CAAC,SAAS,CAAC,QAAQ,KAAK,UAAU;YACxC,MAAM,CAAC,MAAM,KAAK,SAAS,EAC3B,CAAC;YACD,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;QACJ,CAAC;QACD,IAAI,aAAa,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YACpC,aAAa,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAC/C,CAAC;QACD,OAAO,aAAa,CAAC,QAAQ,CAAC;IAChC,CAAC;IAEM,MAAM,CAAC,aAAa;QACzB,IAAI,aAAa,CAAC,QAAQ,EAAE,CAAC;YAC3B,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC;QAChC,CAAC;IACH,CAAC;IAIM,SAAS,CACd,SAAuE;QAEvE,MAAM,IAAI,GAAwC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YACxE,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAChB,OAAO,CAAC,QAAoB,EAAE,EAAE;YAC9B,MAAM,eAAe,GAAG,CAAC,KAAsB,EAAE,EAAE;gBACjD,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CACjC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,CACjD,CAAC;gBACF,IAAI,CAAC,iBAAiB,EAAE,CAAC;oBACvB,OAAO;gBACT,CAAC;gBACD,QAAQ,EAAE,CAAC;YACb,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,CAAC,sBAAsB,EAAE,eAAe,EAAE;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;YAEH,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,mBAAmB,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC;YACtE,CAAC,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;IAEM,WAAW,GAAG,CAAmC,GAAM,EAAE,EAAE;QAChE,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CACb,+EAA+E,GAAG,8CAA8C,CACjI,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { Adaptor } from "../types.js";
2
- export declare const useAdaptor: () => Adaptor;
@@ -1,8 +0,0 @@
1
- import { AppsSdkAdaptor } from "../adaptors/apps-sdk-adaptor.js";
2
- import { McpAppAdaptor } from "../adaptors/mcp-app-adaptor.js";
3
- export const useAdaptor = () => {
4
- return window.skybridge.hostType === "apps-sdk"
5
- ? AppsSdkAdaptor.getInstance()
6
- : McpAppAdaptor.getInstance();
7
- };
8
- //# sourceMappingURL=use-adaptor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-adaptor.js","sourceRoot":"","sources":["../../../../src/web/bridges/hooks/use-adaptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,MAAM,CAAC,MAAM,UAAU,GAAG,GAAY,EAAE;IACtC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,KAAK,UAAU;QAC7C,CAAC,CAAC,cAAc,CAAC,WAAW,EAAE;QAC9B,CAAC,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { OpenAiProperties } from "../../types.js";
2
- export declare function useAppsSdkBridge<K extends keyof OpenAiProperties>(key: K): OpenAiProperties[K];
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-apps-sdk-bridge.js","sourceRoot":"","sources":["../../../../src/web/bridges/hooks/use-apps-sdk-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,UAAU,gBAAgB,CAC9B,GAAM;IAEN,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC;IAC3C,OAAO,oBAAoB,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CACtD,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CACxB,CAAC;AACJ,CAAC"}