skybridge 0.0.0-dev.b96ae66 → 0.0.0-dev.bc5889f

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.
@@ -1,5 +1,5 @@
1
1
  <base href="{{serverUrl}}" />
2
- <script> window.skybridge = { hostType: "{{hostType}}" }; </script>
2
+ <script type="module">window.skybridge = { hostType: "{{hostType}}" };</script>
3
3
  <script type="module">
4
4
  import { injectIntoGlobalHook } from "{{serverUrl}}/@react-refresh";
5
5
  injectIntoGlobalHook(window); window.$RefreshReg$ = () => {};
@@ -1,5 +1,5 @@
1
1
  <base href="{{serverUrl}}" />
2
- <script> window.skybridge = { hostType: "{{hostType}}" }; </script>
2
+ <script type="module">window.skybridge = { hostType: "{{hostType}}" };</script>
3
3
  <div id="root"></div>
4
4
  <script type="module">
5
5
  import('{{serverUrl}}/assets/{{widgetFile}}');
@@ -1,2 +1,2 @@
1
- import type { IBridgeMethods } from "./types";
2
- export declare const requestDisplayMode: IBridgeMethods["requestDisplayMode"];
1
+ import type { Methods } from "./types";
2
+ export declare const requestDisplayMode: Methods["requestDisplayMode"];
@@ -1,4 +1,4 @@
1
- export const requestDisplayMode = ({ mode, }) => {
1
+ export const requestDisplayMode = ({ mode }) => {
2
2
  return window.openai.requestDisplayMode({ mode });
3
3
  };
4
4
  //# sourceMappingURL=apps-sdk-adapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"apps-sdk-adapter.js","sourceRoot":"","sources":["../../../../src/web/bridges/apps-sdk-adapter.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAyC,CAAC,EACvE,IAAI,GACL,EAAE,EAAE;IACH,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC"}
1
+ {"version":3,"file":"apps-sdk-adapter.js","sourceRoot":"","sources":["../../../../src/web/bridges/apps-sdk-adapter.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAkC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC5E,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- import type { IBridgeMethods } from "./types";
2
- export declare const getBridgeMethods: () => IBridgeMethods;
1
+ import type { Methods } from "./types";
2
+ export declare const getBridgeMethods: () => Methods;
@@ -1 +1 @@
1
- {"version":3,"file":"get-bridge-methods.js","sourceRoot":"","sources":["../../../../src/web/bridges/get-bridge-methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;AAGnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAmB,EAAE;IACnD,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,KAAK,UAAU;QAC7C,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,aAAa,CAAC;AACpB,CAAC,CAAC"}
1
+ {"version":3,"file":"get-bridge-methods.js","sourceRoot":"","sources":["../../../../src/web/bridges/get-bridge-methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;AAGnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAY,EAAE;IAC5C,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,KAAK,UAAU;QAC7C,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,aAAa,CAAC;AACpB,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { useSyncExternalStore } from "react";
2
2
  import { AppsSdkBridge } from "../apps-sdk-bridge";
3
3
  import { McpAppBridge } from "../mcp-app-bridge";
4
- const DEFAULT_VALUE_FOR_MCP_APP_BRIDGE = {
4
+ const getDefaultValuesFromMcpAppBridge = () => ({
5
5
  theme: "light",
6
6
  locale: "en-US",
7
7
  displayMode: "inline",
@@ -14,8 +14,8 @@ const DEFAULT_VALUE_FOR_MCP_APP_BRIDGE = {
14
14
  },
15
15
  },
16
16
  maxHeight: window.innerHeight,
17
- };
18
- const getExternalStore = (key, defaultValue = DEFAULT_VALUE_FOR_MCP_APP_BRIDGE[key]) => {
17
+ });
18
+ const getExternalStore = (key, defaultValue = getDefaultValuesFromMcpAppBridge()[key]) => {
19
19
  const hostType = window.skybridge.hostType;
20
20
  if (hostType === "apps-sdk") {
21
21
  const bridge = AppsSdkBridge.getInstance();
@@ -50,7 +50,7 @@ const getExternalStore = (key, defaultValue = DEFAULT_VALUE_FOR_MCP_APP_BRIDGE[k
50
50
  getSnapshot: () => (bridge.getSnapshot(key) ?? defaultValue),
51
51
  };
52
52
  };
53
- export const useBridge = (key, defaultValue = DEFAULT_VALUE_FOR_MCP_APP_BRIDGE[key]) => {
53
+ export const useBridge = (key, defaultValue = getDefaultValuesFromMcpAppBridge()[key]) => {
54
54
  const externalStore = getExternalStore(key, defaultValue);
55
55
  return useSyncExternalStore(externalStore.subscribe, externalStore.getSnapshot);
56
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-bridge.js","sourceRoot":"","sources":["../../../../../src/web/bridges/hooks/use-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQjD,MAAM,gCAAgC,GAAoB;IACxD,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;SACR;KACF;IACD,SAAS,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CACzB,aAAa,CAAC,SAAS,EACvB,aAAa,CAAC,WAAW,CAC1B,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ export { getBridgeMethods } from "./get-bridge-methods.js";
1
2
  export { useAppsSdkBridge } from "./hooks/use-apps-sdk-bridge.js";
2
3
  export { useBridge } from "./hooks/use-bridge.js";
3
4
  export { useMcpAppBridge } from "./hooks/use-mcp-app-bridge.js";
@@ -1,3 +1,4 @@
1
+ export { getBridgeMethods } from "./get-bridge-methods.js";
1
2
  export { useAppsSdkBridge } from "./hooks/use-apps-sdk-bridge.js";
2
3
  export { useBridge } from "./hooks/use-bridge.js";
3
4
  export { useMcpAppBridge } from "./hooks/use-mcp-app-bridge.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/web/bridges/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/web/bridges/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC"}
@@ -1,2 +1,2 @@
1
- import type { IBridgeMethods } from "./types";
2
- export declare const requestDisplayMode: IBridgeMethods["requestDisplayMode"];
1
+ import type { Methods } from "./types";
2
+ export declare const requestDisplayMode: Methods["requestDisplayMode"];
@@ -1,5 +1,5 @@
1
1
  import { McpAppBridge } from "./mcp-app-bridge";
2
- export const requestDisplayMode = ({ mode, }) => {
2
+ export const requestDisplayMode = ({ mode }) => {
3
3
  const bridge = McpAppBridge.getInstance();
4
4
  if (mode !== "modal") {
5
5
  return bridge.request({
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-app-adapter.js","sourceRoot":"","sources":["../../../../src/web/bridges/mcp-app-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,MAAM,CAAC,MAAM,kBAAkB,GAAyC,CAAC,EACvE,IAAI,GACL,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;IAC1C,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC,OAAO,CAGnB;YACA,MAAM,EAAE,yBAAyB;YACjC,MAAM,EAAE,EAAE,IAAI,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACtE,CAAC,CAAC"}
1
+ {"version":3,"file":"mcp-app-adapter.js","sourceRoot":"","sources":["../../../../src/web/bridges/mcp-app-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,MAAM,CAAC,MAAM,kBAAkB,GAAkC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC5E,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;IAC1C,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC,OAAO,CAGnB;YACA,MAAM,EAAE,yBAAyB;YACjC,MAAM,EAAE,EAAE,IAAI,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACtE,CAAC,CAAC"}
@@ -1,15 +1,15 @@
1
- export type IBridgeMethods = {
1
+ export type Methods = {
2
2
  requestDisplayMode({ mode }: {
3
- mode: BridgeDisplayMode;
3
+ mode: DisplayMode;
4
4
  }): Promise<{
5
- mode: BridgeDisplayMode;
5
+ mode: DisplayMode;
6
6
  }>;
7
7
  };
8
- export type BridgeDisplayMode = "pip" | "inline" | "fullscreen" | "modal";
8
+ export type DisplayMode = "pip" | "inline" | "fullscreen" | "modal";
9
9
  export interface BridgeInterface {
10
10
  theme: "light" | "dark";
11
11
  locale: string;
12
- displayMode: BridgeDisplayMode;
12
+ displayMode: DisplayMode;
13
13
  safeArea: {
14
14
  insets: {
15
15
  top: number;
@@ -1,4 +1,4 @@
1
1
  import type { DisplayMode } from "../types.js";
2
- export declare function useDisplayMode(): readonly [import("../bridges/types.js").BridgeDisplayMode, (mode: DisplayMode) => Promise<{
3
- mode: import("../bridges/types.js").BridgeDisplayMode;
2
+ export declare function useDisplayMode(): readonly [import("../bridges/types.js").DisplayMode, (mode: DisplayMode) => Promise<{
3
+ mode: import("../bridges/types.js").DisplayMode;
4
4
  }>];
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "skybridge",
3
- "version": "0.0.0-dev.b96ae66",
3
+ "version": "0.0.0-dev.bc5889f",
4
4
  "description": "Skybridge is a framework for building ChatGPT apps",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/alpic-ai/skybridge.git"
8
+ },
5
9
  "type": "module",
6
10
  "files": [
7
11
  "dist"