skybridge 0.0.0-dev.ea7f5b5 → 0.0.0-dev.eab1d07
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/LICENSE +21 -674
- package/README.md +84 -397
- package/bin/run.js +5 -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/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-nodemon.d.ts +6 -0
- package/dist/cli/use-nodemon.js +61 -0
- package/dist/cli/use-nodemon.js.map +1 -0
- package/dist/cli/use-typescript-check.d.ts +8 -0
- package/dist/cli/use-typescript-check.js +59 -0
- package/dist/cli/use-typescript-check.js.map +1 -0
- package/dist/commands/build.d.ts +9 -0
- package/dist/commands/build.js +46 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/dev.d.ts +9 -0
- package/dist/commands/dev.js +31 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/start.d.ts +7 -0
- package/dist/commands/start.js +28 -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 +11 -0
- package/dist/server/asset-base-url-transform-plugin.js +34 -0
- package/dist/server/asset-base-url-transform-plugin.js.map +1 -0
- package/dist/server/asset-base-url-transform-plugin.test.js +56 -0
- package/dist/server/asset-base-url-transform-plugin.test.js.map +1 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js.map +1 -0
- package/dist/{src/server → server}/inferUtilityTypes.d.ts +10 -0
- package/dist/server/inferUtilityTypes.js.map +1 -0
- package/dist/server/server.d.ts +99 -0
- package/dist/server/server.js +153 -0
- package/dist/server/server.js.map +1 -0
- package/dist/{src/server → server}/templateHelper.d.ts +4 -0
- package/dist/{src/server → server}/templateHelper.js +5 -4
- package/dist/server/templateHelper.js.map +1 -0
- package/dist/server/templates/development.hbs +67 -0
- package/dist/{src/server → server}/templates/production.hbs +1 -1
- package/dist/{src/server → server}/widgetsDevServer.d.ts +2 -2
- package/dist/server/widgetsDevServer.js +57 -0
- package/dist/server/widgetsDevServer.js.map +1 -0
- package/dist/{src/test → test}/utils.d.ts +54 -8
- package/dist/{src/test → test}/utils.js +81 -3
- package/dist/test/utils.js.map +1 -0
- package/dist/test/widget.test.js +255 -0
- package/dist/test/widget.test.js.map +1 -0
- package/dist/web/bridges/apps-sdk/adaptor.d.ts +22 -0
- package/dist/web/bridges/apps-sdk/adaptor.js +64 -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 +46 -0
- 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/{src/web → web/bridges/apps-sdk}/types.d.ts +27 -45
- package/dist/{src/web → web/bridges/apps-sdk}/types.js +0 -1
- 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/apps-sdk/use-apps-sdk-context.js +7 -0
- 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 -0
- package/dist/web/bridges/index.js +6 -0
- package/dist/web/bridges/index.js.map +1 -0
- package/dist/web/bridges/mcp-app/adaptor.d.ts +36 -0
- package/dist/web/bridges/mcp-app/adaptor.js +188 -0
- package/dist/web/bridges/mcp-app/adaptor.js.map +1 -0
- package/dist/web/bridges/mcp-app/bridge.d.ts +43 -0
- package/dist/web/bridges/mcp-app/bridge.js +255 -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 +5 -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.js +66 -0
- package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js.map +1 -0
- package/dist/web/bridges/types.d.ts +98 -0
- package/dist/web/bridges/types.js +2 -0
- package/dist/web/bridges/types.js.map +1 -0
- 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 +47 -0
- package/dist/web/components/modal-provider.js.map +1 -0
- package/dist/web/create-store.js +24 -0
- package/dist/web/create-store.js.map +1 -0
- package/dist/web/create-store.test.js +126 -0
- package/dist/web/create-store.test.js.map +1 -0
- package/dist/{src/web → web}/data-llm.js +11 -7
- package/dist/web/data-llm.js.map +1 -0
- package/dist/web/data-llm.test.js +139 -0
- package/dist/web/data-llm.test.js.map +1 -0
- package/dist/{src/web → web}/generate-helpers.d.ts +11 -8
- package/dist/{src/web → web}/generate-helpers.js +5 -3
- package/dist/web/generate-helpers.js.map +1 -0
- package/dist/{src/web → web}/generate-helpers.test-d.js +59 -3
- package/dist/web/generate-helpers.test-d.js.map +1 -0
- package/dist/{src/web → web}/generate-helpers.test.js +1 -1
- package/dist/web/generate-helpers.test.js.map +1 -0
- package/dist/{src/web → web}/helpers/state.js +14 -9
- package/dist/web/helpers/state.js.map +1 -0
- package/dist/{src/web → web}/helpers/state.test.js +2 -2
- package/dist/web/helpers/state.test.js.map +1 -0
- package/dist/{src/web → web}/hooks/index.d.ts +4 -5
- package/dist/{src/web → web}/hooks/index.js +3 -4
- package/dist/web/hooks/index.js.map +1 -0
- package/dist/web/hooks/test/utils.d.ts +16 -0
- package/dist/web/hooks/test/utils.js +60 -0
- package/dist/web/hooks/test/utils.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-call-tool.d.ts +3 -2
- package/dist/{src/web → web}/hooks/use-call-tool.js +12 -4
- package/dist/web/hooks/use-call-tool.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-call-tool.test-d.js +1 -1
- package/dist/web/hooks/use-call-tool.test-d.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-call-tool.test.js +35 -16
- package/dist/web/hooks/use-call-tool.test.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-display-mode.d.ts +1 -1
- package/dist/web/hooks/use-display-mode.js +9 -0
- package/dist/web/hooks/use-display-mode.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-display-mode.test.js +3 -2
- package/dist/web/hooks/use-display-mode.test.js.map +1 -0
- package/dist/web/hooks/use-files.d.ts +6 -0
- package/dist/web/hooks/use-files.js +9 -0
- package/dist/web/hooks/use-files.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-files.test.js +6 -5
- package/dist/web/hooks/use-files.test.js.map +1 -0
- package/dist/web/hooks/use-layout.d.ts +22 -0
- package/dist/web/hooks/use-layout.js +23 -0
- package/dist/web/hooks/use-layout.js.map +1 -0
- package/dist/web/hooks/use-layout.test.js +96 -0
- package/dist/web/hooks/use-layout.test.js.map +1 -0
- package/dist/web/hooks/use-open-external.js +8 -0
- package/dist/web/hooks/use-open-external.js.map +1 -0
- package/dist/web/hooks/use-open-external.test.js +50 -0
- package/dist/web/hooks/use-open-external.test.js.map +1 -0
- package/dist/web/hooks/use-request-modal.d.ts +9 -0
- package/dist/web/hooks/use-request-modal.js +16 -0
- package/dist/web/hooks/use-request-modal.js.map +1 -0
- package/dist/web/hooks/use-request-modal.test.js +57 -0
- package/dist/web/hooks/use-request-modal.test.js.map +1 -0
- package/dist/web/hooks/use-send-follow-up-message.js +8 -0
- package/dist/web/hooks/use-send-follow-up-message.js.map +1 -0
- 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.js +49 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-tool-info.d.ts +13 -2
- package/dist/web/hooks/use-tool-info.js +26 -0
- package/dist/web/hooks/use-tool-info.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-tool-info.test-d.js +40 -5
- package/dist/web/hooks/use-tool-info.test-d.js.map +1 -0
- package/dist/web/hooks/use-tool-info.test.js +130 -0
- package/dist/web/hooks/use-tool-info.test.js.map +1 -0
- package/dist/web/hooks/use-user.d.ts +18 -0
- package/dist/web/hooks/use-user.js +19 -0
- package/dist/web/hooks/use-user.js.map +1 -0
- package/dist/web/hooks/use-user.test.js +94 -0
- package/dist/web/hooks/use-user.test.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-widget-state.js +11 -11
- package/dist/web/hooks/use-widget-state.js.map +1 -0
- package/dist/{src/web → web}/hooks/use-widget-state.test.js +3 -2
- package/dist/web/hooks/use-widget-state.test.js.map +1 -0
- package/dist/{src/web → web}/index.d.ts +5 -4
- package/dist/{src/web → web}/index.js +5 -4
- package/dist/web/index.js.map +1 -0
- package/dist/{src/web → web}/mount-widget.js +9 -1
- package/dist/web/mount-widget.js.map +1 -0
- package/dist/web/plugin/data-llm.test.d.ts +1 -0
- package/dist/web/plugin/data-llm.test.js.map +1 -0
- package/dist/web/plugin/plugin.js +46 -0
- package/dist/web/plugin/plugin.js.map +1 -0
- package/dist/{src/web → web}/plugin/transform-data-llm.js +6 -3
- package/dist/web/plugin/transform-data-llm.js.map +1 -0
- package/dist/web/plugin/transform-data-llm.test.d.ts +1 -0
- package/dist/web/plugin/transform-data-llm.test.js.map +1 -0
- package/dist/{src/web → web}/proxy.js +6 -2
- package/dist/web/proxy.js.map +1 -0
- package/dist/web/types.d.ts +16 -0
- package/dist/web/types.js +2 -0
- package/dist/web/types.js.map +1 -0
- package/package.json +62 -35
- package/dist/src/server/index.d.ts +0 -4
- package/dist/src/server/index.js.map +0 -1
- package/dist/src/server/inferUtilityTypes.js.map +0 -1
- package/dist/src/server/server.d.ts +0 -48
- package/dist/src/server/server.js +0 -62
- package/dist/src/server/server.js.map +0 -1
- package/dist/src/server/templateHelper.js.map +0 -1
- package/dist/src/server/templates/development.hbs +0 -12
- package/dist/src/server/widgetsDevServer.js +0 -39
- package/dist/src/server/widgetsDevServer.js.map +0 -1
- package/dist/src/test/utils.js.map +0 -1
- package/dist/src/test/widget.test.js +0 -90
- package/dist/src/test/widget.test.js.map +0 -1
- package/dist/src/web/create-store.js +0 -25
- package/dist/src/web/create-store.js.map +0 -1
- package/dist/src/web/create-store.test.js +0 -70
- package/dist/src/web/create-store.test.js.map +0 -1
- package/dist/src/web/data-llm.js.map +0 -1
- package/dist/src/web/data-llm.test.js +0 -76
- package/dist/src/web/data-llm.test.js.map +0 -1
- package/dist/src/web/generate-helpers.js.map +0 -1
- package/dist/src/web/generate-helpers.test-d.js.map +0 -1
- package/dist/src/web/generate-helpers.test.js.map +0 -1
- package/dist/src/web/helpers/state.js.map +0 -1
- package/dist/src/web/helpers/state.test.js.map +0 -1
- package/dist/src/web/hooks/index.js.map +0 -1
- package/dist/src/web/hooks/use-call-tool.js.map +0 -1
- package/dist/src/web/hooks/use-call-tool.test-d.js.map +0 -1
- package/dist/src/web/hooks/use-call-tool.test.js.map +0 -1
- package/dist/src/web/hooks/use-display-mode.js +0 -7
- package/dist/src/web/hooks/use-display-mode.js.map +0 -1
- package/dist/src/web/hooks/use-display-mode.test.js.map +0 -1
- package/dist/src/web/hooks/use-files.d.ts +0 -10
- package/dist/src/web/hooks/use-files.js +0 -7
- package/dist/src/web/hooks/use-files.js.map +0 -1
- package/dist/src/web/hooks/use-files.test.js.map +0 -1
- package/dist/src/web/hooks/use-locale.d.ts +0 -1
- package/dist/src/web/hooks/use-locale.js +0 -5
- package/dist/src/web/hooks/use-locale.js.map +0 -1
- package/dist/src/web/hooks/use-locale.test.js +0 -21
- package/dist/src/web/hooks/use-locale.test.js.map +0 -1
- package/dist/src/web/hooks/use-open-external.js +0 -6
- package/dist/src/web/hooks/use-open-external.js.map +0 -1
- package/dist/src/web/hooks/use-open-external.test.js +0 -24
- package/dist/src/web/hooks/use-open-external.test.js.map +0 -1
- package/dist/src/web/hooks/use-openai-global.d.ts +0 -2
- package/dist/src/web/hooks/use-openai-global.js +0 -23
- package/dist/src/web/hooks/use-openai-global.js.map +0 -1
- package/dist/src/web/hooks/use-request-modal.d.ts +0 -6
- package/dist/src/web/hooks/use-request-modal.js +0 -9
- package/dist/src/web/hooks/use-request-modal.js.map +0 -1
- package/dist/src/web/hooks/use-request-modal.test.js +0 -24
- package/dist/src/web/hooks/use-request-modal.test.js.map +0 -1
- package/dist/src/web/hooks/use-send-follow-up-message.js +0 -11
- package/dist/src/web/hooks/use-send-follow-up-message.js.map +0 -1
- package/dist/src/web/hooks/use-theme.d.ts +0 -1
- package/dist/src/web/hooks/use-theme.js +0 -5
- package/dist/src/web/hooks/use-theme.js.map +0 -1
- package/dist/src/web/hooks/use-theme.test.js +0 -26
- package/dist/src/web/hooks/use-theme.test.js.map +0 -1
- package/dist/src/web/hooks/use-tool-info.js +0 -22
- package/dist/src/web/hooks/use-tool-info.js.map +0 -1
- package/dist/src/web/hooks/use-tool-info.test-d.js.map +0 -1
- package/dist/src/web/hooks/use-tool-info.test.js +0 -59
- package/dist/src/web/hooks/use-tool-info.test.js.map +0 -1
- package/dist/src/web/hooks/use-user-agent.d.ts +0 -1
- package/dist/src/web/hooks/use-user-agent.js +0 -5
- package/dist/src/web/hooks/use-user-agent.js.map +0 -1
- package/dist/src/web/hooks/use-user-agent.test.js +0 -31
- package/dist/src/web/hooks/use-user-agent.test.js.map +0 -1
- package/dist/src/web/hooks/use-widget-state.js.map +0 -1
- package/dist/src/web/hooks/use-widget-state.test.js.map +0 -1
- package/dist/src/web/index.js.map +0 -1
- package/dist/src/web/mount-widget.js.map +0 -1
- package/dist/src/web/plugin/data-llm.test.js.map +0 -1
- package/dist/src/web/plugin/plugin.js +0 -33
- package/dist/src/web/plugin/plugin.js.map +0 -1
- package/dist/src/web/plugin/transform-data-llm.js.map +0 -1
- package/dist/src/web/plugin/transform-data-llm.test.js.map +0 -1
- package/dist/src/web/proxy.js.map +0 -1
- package/dist/src/web/types.js.map +0 -1
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -8
- package/dist/vitest.config.js.map +0 -1
- /package/dist/{src/test/widget.test.d.ts → server/asset-base-url-transform-plugin.test.d.ts} +0 -0
- /package/dist/{src/server → server}/index.js +0 -0
- /package/dist/{src/server → server}/inferUtilityTypes.js +0 -0
- /package/dist/{src/web/create-store.test.d.ts → test/widget.test.d.ts} +0 -0
- /package/dist/{src/web/data-llm.test.d.ts → web/bridges/mcp-app/use-mcp-app-context.test.d.ts} +0 -0
- /package/dist/{src/web → web}/create-store.d.ts +0 -0
- /package/dist/{src/web/generate-helpers.test-d.d.ts → web/create-store.test.d.ts} +0 -0
- /package/dist/{src/web → web}/data-llm.d.ts +0 -0
- /package/dist/{src/web/plugin → web}/data-llm.test.d.ts +0 -0
- /package/dist/{src/web/generate-helpers.test.d.ts → web/generate-helpers.test-d.d.ts} +0 -0
- /package/dist/{src/web/helpers/state.test.d.ts → web/generate-helpers.test.d.ts} +0 -0
- /package/dist/{src/web → web}/helpers/state.d.ts +0 -0
- /package/dist/{src/web/hooks/use-call-tool.test-d.d.ts → web/helpers/state.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-call-tool.test.d.ts → web/hooks/use-call-tool.test-d.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-display-mode.test.d.ts → web/hooks/use-call-tool.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-files.test.d.ts → web/hooks/use-display-mode.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-locale.test.d.ts → web/hooks/use-files.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-open-external.test.d.ts → web/hooks/use-layout.test.d.ts} +0 -0
- /package/dist/{src/web → web}/hooks/use-open-external.d.ts +0 -0
- /package/dist/{src/web/hooks/use-request-modal.test.d.ts → web/hooks/use-open-external.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-theme.test.d.ts → web/hooks/use-request-modal.test.d.ts} +0 -0
- /package/dist/{src/web → web}/hooks/use-send-follow-up-message.d.ts +0 -0
- /package/dist/{src/web/hooks/use-tool-info.test-d.d.ts → web/hooks/use-set-open-in-app-url.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-tool-info.test.d.ts → web/hooks/use-tool-info.test-d.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-user-agent.test.d.ts → web/hooks/use-tool-info.test.d.ts} +0 -0
- /package/dist/{src/web/hooks/use-widget-state.test.d.ts → web/hooks/use-user.test.d.ts} +0 -0
- /package/dist/{src/web → web}/hooks/use-widget-state.d.ts +0 -0
- /package/dist/{src/web/plugin/transform-data-llm.test.d.ts → web/hooks/use-widget-state.test.d.ts} +0 -0
- /package/dist/{src/web → web}/mount-widget.d.ts +0 -0
- /package/dist/{src/web → web}/plugin/data-llm.test.js +0 -0
- /package/dist/{src/web → web}/plugin/plugin.d.ts +0 -0
- /package/dist/{src/web → web}/plugin/transform-data-llm.d.ts +0 -0
- /package/dist/{src/web → web}/plugin/transform-data-llm.test.js +0 -0
- /package/dist/{src/web → web}/proxy.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,457 +1,144 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
**Skybridge is the TypeScript framework for building ChatGPT apps**
|
|
6
|
-
|
|
7
|
-
[](https://alpic.ai)
|
|
8
|
-
|
|
9
|
-

|
|
10
|
-

|
|
11
|
-

|
|
12
|
-
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
Skybridge is a fullstack library. It comes with modular packages aiming at simplifying the development of ChatGPT apps:
|
|
3
|
+
<img alt="Skybridge" src="https://raw.githubusercontent.com/alpic-ai/skybridge/main/docs/images/github-banner.png" width="100%">
|
|
16
4
|
|
|
17
|
-
|
|
18
|
-
- collection of React hooks for state management, async data fetching
|
|
19
|
-
- attribute for widget-to-context synchronization
|
|
5
|
+
<br />
|
|
20
6
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## Get Involved
|
|
24
|
-
|
|
25
|
-
We welcome issues and pull requests!</br>
|
|
26
|
-
Participate in [GitHub discussions](https://github.com/alpic-ai/skybridge/discussions)</br>
|
|
27
|
-
Chat with the community on [Discord](https://discord.com/invite/gNAazGueab)</br>
|
|
28
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions
|
|
7
|
+
# Skybridge
|
|
29
8
|
|
|
30
|
-
|
|
9
|
+
**Build ChatGPT & MCP Apps. The Modern TypeScript Way.**
|
|
31
10
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
11
|
+
The fullstack TypeScript framework for AI-embedded widgets.<br />
|
|
12
|
+
**Type-safe. React-powered. Platform-agnostic.**
|
|
35
13
|
|
|
36
|
-
|
|
14
|
+
<br />
|
|
37
15
|
|
|
38
|
-
|
|
16
|
+
[](https://www.npmjs.com/package/skybridge)
|
|
17
|
+
[](https://www.npmjs.com/package/skybridge)
|
|
18
|
+
[](https://github.com/alpic-ai/skybridge/blob/main/LICENSE)
|
|
39
19
|
|
|
40
|
-
|
|
20
|
+
<br />
|
|
41
21
|
|
|
42
|
-
|
|
22
|
+
[Documentation](https://docs.skybridge.tech) · [Quick Start](https://docs.skybridge.tech/quickstart/create-new-app) · [Showcase](https://docs.skybridge.tech/showcase)
|
|
43
23
|
|
|
44
|
-
|
|
24
|
+
</div>
|
|
45
25
|
|
|
46
|
-
|
|
26
|
+
<br />
|
|
47
27
|
|
|
48
|
-
|
|
49
|
-
server/
|
|
50
|
-
└── src/
|
|
51
|
-
└── index.ts // Register the widget with McpServer.widget()
|
|
52
|
-
web/
|
|
53
|
-
└── src/
|
|
54
|
-
└── widgets/
|
|
55
|
-
└── pokemon.tsx // Use the same widget name as the file name
|
|
56
|
-
```
|
|
28
|
+
## ✨ Why Skybridge?
|
|
57
29
|
|
|
58
|
-
|
|
30
|
+
ChatGPT Apps and MCP Apps let you embed **rich, interactive UIs** directly in AI conversations. But the raw SDKs are low-level—no hooks, no type safety, no dev tools, and no HMR.
|
|
59
31
|
|
|
60
|
-
|
|
61
|
-
import { McpServer } from "skybridge/server";
|
|
32
|
+
**Skybridge fixes that.**
|
|
62
33
|
|
|
63
|
-
|
|
34
|
+
| | |
|
|
35
|
+
|:--|:--|
|
|
36
|
+
| 👨💻 **Full Dev Environment** — HMR, debug traces, and local devtools. No more refresh loops. | ✅ **End-to-End Type Safety** — tRPC-style inference from server to widget. Autocomplete everywhere. |
|
|
37
|
+
| 🔄 **Widget-to-Model Sync** — Keep the model aware of UI state with `data-llm`. Dual surfaces, one source of truth. | ⚒️ **React Query-style Hooks** — `isPending`, `isError`, callbacks. State management you already know. |
|
|
38
|
+
| 🌐 **Platform Agnostic** — Write once, run anywhere. Works with ChatGPT (Apps SDK) and MCP-compatible clients. | 📦 **Showcase Examples** — Production-ready examples to learn from and build upon. |
|
|
64
39
|
|
|
65
|
-
|
|
66
|
-
"pokemon"
|
|
67
|
-
// Remaining arguments...
|
|
68
|
-
);
|
|
69
|
-
```
|
|
40
|
+
<br />
|
|
70
41
|
|
|
71
|
-
|
|
42
|
+
## 🚀 Get Started
|
|
72
43
|
|
|
73
|
-
|
|
74
|
-
import { mountWidget } from "skybridge/web";
|
|
44
|
+
**Create a new app:**
|
|
75
45
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
mountWidget(<Pokemon />);
|
|
46
|
+
```bash
|
|
47
|
+
npm create skybridge@latest
|
|
81
48
|
```
|
|
82
49
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
### skybridge/server
|
|
86
|
-
|
|
87
|
-
The `skybridge/server` package is a drop-in replacement of the `@modelcontextprotocol/sdk` official `McpServer` class with extra features for widget development. If you're already using the `@modelcontextprotocol/sdk`, you can simply replace your `McpServer` import with `skybridge/server` and you're good to go.
|
|
88
|
-
|
|
89
|
-
### skybridge/web
|
|
90
|
-
|
|
91
|
-
The `skybridge/web` package is a react library with hooks and components to build widgets on the underlying _OpenAI iFrame skybridge_ runtime.
|
|
50
|
+
**Or add to an existing project:**
|
|
92
51
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
import { skybridge } from "skybridge/web";
|
|
100
|
-
|
|
101
|
-
export default defineConfig({
|
|
102
|
-
plugins: [skybridge()],
|
|
103
|
-
});
|
|
52
|
+
```bash
|
|
53
|
+
npm i skybridge
|
|
54
|
+
yarn add skybridge
|
|
55
|
+
pnpm add skybridge
|
|
56
|
+
bun add skybridge
|
|
57
|
+
deno add skybridge
|
|
104
58
|
```
|
|
105
59
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Skybridge provides fully typed hooks that give you autocomplete for tool names and type inference for inputs/outputs - similar to tRPC. This is opt-in and requires exporting your server type.
|
|
109
|
-
|
|
110
|
-
> **Tip:** For the best TypeScript experience, use typed hooks throughout your application. They provide autocomplete, type safety, and better IDE support.
|
|
111
|
-
|
|
112
|
-
> **Important:** For `generateHelpers` to work correctly, your MCP server must be defined using method chaining (e.g., `server.widget(...).widget(...).registerTool(...)`). This ensures TypeScript can properly infer the tool registry type from the chained calls.
|
|
60
|
+
<div align="center">
|
|
113
61
|
|
|
114
|
-
|
|
62
|
+
**👉 [Read the Docs](https://docs.skybridge.tech) 👈**
|
|
115
63
|
|
|
116
|
-
|
|
64
|
+
</div>
|
|
117
65
|
|
|
118
|
-
|
|
119
|
-
import { McpServer } from "skybridge/server";
|
|
120
|
-
import { z } from "zod";
|
|
121
|
-
|
|
122
|
-
const server = new McpServer({ name: "my-app", version: "1.0" }, {})
|
|
123
|
-
.widget(
|
|
124
|
-
"search-voyage",
|
|
125
|
-
{},
|
|
126
|
-
{
|
|
127
|
-
inputSchema: { destination: z.string() },
|
|
128
|
-
},
|
|
129
|
-
async ({ destination }) => {
|
|
130
|
-
return {
|
|
131
|
-
content: [{ type: "text", text: `Found trips to ${destination}` }],
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
.registerTool(
|
|
136
|
-
"calculate-price",
|
|
137
|
-
{
|
|
138
|
-
inputSchema: { tripId: z.string() },
|
|
139
|
-
},
|
|
140
|
-
async ({ tripId }) => {
|
|
141
|
-
return { content: [{ type: "text", text: `Price for ${tripId}` }] };
|
|
142
|
-
}
|
|
143
|
-
);
|
|
66
|
+
<br />
|
|
144
67
|
|
|
145
|
-
|
|
146
|
-
```
|
|
68
|
+
## 📦 Architecture
|
|
147
69
|
|
|
148
|
-
|
|
70
|
+
Skybridge is a fullstack framework with unified server and client modules:
|
|
149
71
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const server = new McpServer({ name: "my-app", version: "1.0" }, {});
|
|
155
|
-
|
|
156
|
-
server.widget(
|
|
157
|
-
"search-voyage",
|
|
158
|
-
{},
|
|
159
|
-
{
|
|
160
|
-
inputSchema: { destination: z.string() },
|
|
161
|
-
},
|
|
162
|
-
async ({ destination }) => {
|
|
163
|
-
return {
|
|
164
|
-
content: [{ type: "text", text: `Found trips to ${destination}` }],
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
server.registerTool(
|
|
170
|
-
"calculate-price",
|
|
171
|
-
{
|
|
172
|
-
inputSchema: { tripId: z.string() },
|
|
173
|
-
},
|
|
174
|
-
async ({ tripId }) => {
|
|
175
|
-
return { content: [{ type: "text", text: `Price for ${tripId}` }] };
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
export type AppType = typeof server; // ❌ Type inference fails - tool registry is empty
|
|
180
|
-
```
|
|
72
|
+
- **`skybridge/server`** — Define tools and widgets with full type inference. Extends the MCP SDK.
|
|
73
|
+
- **`skybridge/web`** — React hooks that consume your server types. Works with Apps SDK (ChatGPT) and MCP Apps.
|
|
74
|
+
- **Dev Environment** — Vite plugin with HMR, DevTools emulator, and optimized builds.
|
|
181
75
|
|
|
182
|
-
|
|
76
|
+
### Server
|
|
183
77
|
|
|
184
78
|
```ts
|
|
185
79
|
import { McpServer } from "skybridge/server";
|
|
186
|
-
import { z } from "zod";
|
|
187
|
-
|
|
188
|
-
const server = new McpServer({ name: "my-app", version: "1.0" }, {})
|
|
189
|
-
.widget(
|
|
190
|
-
"search-voyage",
|
|
191
|
-
{},
|
|
192
|
-
{
|
|
193
|
-
description: "Search for trips",
|
|
194
|
-
inputSchema: {
|
|
195
|
-
destination: z.string(),
|
|
196
|
-
departureDate: z.string().optional(),
|
|
197
|
-
},
|
|
198
|
-
outputSchema: {
|
|
199
|
-
results: z.array(z.object({ id: z.string(), name: z.string() })),
|
|
200
|
-
totalCount: z.number(),
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
async ({ destination }) => {
|
|
204
|
-
// Your tool logic here...
|
|
205
|
-
return {
|
|
206
|
-
content: [{ type: "text", text: `Found trips to ${destination}` }],
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
)
|
|
210
|
-
.widget(
|
|
211
|
-
"get-details",
|
|
212
|
-
{},
|
|
213
|
-
{
|
|
214
|
-
inputSchema: { tripId: z.string() },
|
|
215
|
-
},
|
|
216
|
-
async ({ tripId }) => {
|
|
217
|
-
return { content: [{ type: "text", text: `Details for ${tripId}` }] };
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
// Export the server type for the client
|
|
222
|
-
export type AppType = typeof server;
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
_One-time setup (web/src/skybridge.ts)_
|
|
226
|
-
|
|
227
|
-
Create typed hooks once and export them for use across your app. This file acts as a bridge between your server types and your widgets:
|
|
228
|
-
|
|
229
|
-
```ts
|
|
230
|
-
import type { AppType } from "../server"; // type-only import
|
|
231
|
-
import { generateHelpers } from "skybridge/web";
|
|
232
80
|
|
|
233
|
-
|
|
81
|
+
server.registerWidget("flights", {}, {
|
|
82
|
+
inputSchema: { destination: z.string() },
|
|
83
|
+
}, async ({ destination }) => {
|
|
84
|
+
const flights = await searchFlights(destination);
|
|
85
|
+
return { structuredContent: { flights } };
|
|
86
|
+
});
|
|
234
87
|
```
|
|
235
88
|
|
|
236
|
-
|
|
89
|
+
### Widget
|
|
237
90
|
|
|
238
91
|
```tsx
|
|
239
|
-
import { useCallTool, useToolInfo } from "../skybridge"; // import typed hooks
|
|
240
|
-
|
|
241
|
-
export function SearchWidget() {
|
|
242
|
-
const { callTool, data, isPending } = useCallTool("search-voyage");
|
|
243
|
-
// ^ autocomplete for tool names
|
|
244
|
-
const toolInfo = useToolInfo<"search-voyage">();
|
|
245
|
-
// ^ autocomplete for widget names
|
|
246
|
-
|
|
247
|
-
const handleSearch = () => {
|
|
248
|
-
callTool({ destination: "Spain" });
|
|
249
|
-
// ^ autocomplete for input fields
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
return (
|
|
253
|
-
<div>
|
|
254
|
-
<button onClick={handleSearch} disabled={isPending}>
|
|
255
|
-
Search
|
|
256
|
-
</button>
|
|
257
|
-
{toolInfo.isSuccess && (
|
|
258
|
-
<div>Found {toolInfo.output.structuredContent.totalCount} results</div>
|
|
259
|
-
// ^ typed output
|
|
260
|
-
)}
|
|
261
|
-
</div>
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
**Hooks**
|
|
267
|
-
|
|
268
|
-
The `skybridge/web` package comes with a set of hooks to help you build your widgets :
|
|
269
|
-
|
|
270
|
-
- `useOpenAiGlobal`: A generic hook to get any global data from the OpenAI iFrame skybridge runtime (in `window.openai`).
|
|
271
|
-
- `useToolOutput`: A hook to get the initial tool `structuredContent` returned when rendering the widget for the first time. The data inside this hook is not updated when the tool is called again.
|
|
272
|
-
- `useToolResponseMetadata`: A hook to get the initial tool `meta` returned when rendering the widget for the first time. The data inside this hook is not updated when the tool is called again.
|
|
273
|
-
- `useToolInfo`: A hook to get the tool input, output, and response metadata with type inference. Provides a discriminated union based on status (pending/success).
|
|
274
|
-
- `useCallTool`: A @tanstack/react-query inspired hook to send make additional tool calls inside a widget.
|
|
275
|
-
- `generateHelpers`: A factory that creates typed versions of `useCallTool` and `useToolInfo` with full type inference from your server type.
|
|
276
|
-
|
|
277
|
-
_useOpenAiGlobal_
|
|
278
|
-
|
|
279
|
-
```ts
|
|
280
|
-
import { useOpenAiGlobal } from "skybridge/web";
|
|
281
|
-
|
|
282
|
-
const theme = useOpenAiGlobal("theme");
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
_useToolOutput_
|
|
286
|
-
|
|
287
|
-
```ts
|
|
288
|
-
import { useToolOutput } from "skybridge/web";
|
|
289
|
-
|
|
290
|
-
const toolOutput = useToolOutput();
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
_useToolResponseMetadata_
|
|
294
|
-
|
|
295
|
-
```ts
|
|
296
|
-
import { useToolResponseMetadata } from "skybridge/web";
|
|
297
|
-
|
|
298
|
-
const toolResponseMetadata = useToolResponseMetadata();
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
_useToolInfo_
|
|
302
|
-
|
|
303
|
-
```ts
|
|
304
92
|
import { useToolInfo } from "skybridge/web";
|
|
305
93
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
output: { results: string[] };
|
|
309
|
-
responseMetadata: { id: number };
|
|
310
|
-
}>();
|
|
311
|
-
|
|
312
|
-
// toolInfo.input is typed based on the input type
|
|
313
|
-
// toolInfo.output.structuredContent is typed based on the output type (undefined when pending)
|
|
314
|
-
// toolInfo.status narrows correctly: "pending" | "success"
|
|
94
|
+
function FlightsWidget() {
|
|
95
|
+
const { output } = useToolInfo();
|
|
315
96
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
if (toolInfo.isSuccess) {
|
|
322
|
-
// toolInfo.output.structuredContent is typed here
|
|
323
|
-
console.log(toolInfo.output.structuredContent.results);
|
|
324
|
-
}
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
_useToolInfo_ with typed hooks (recommended)
|
|
328
|
-
|
|
329
|
-
```tsx
|
|
330
|
-
import { useToolInfo } from "../skybridge"; // import typed hooks
|
|
331
|
-
|
|
332
|
-
export function SearchWidget() {
|
|
333
|
-
const toolInfo = useToolInfo<"search-voyage">();
|
|
334
|
-
// ^ autocomplete for widget names
|
|
335
|
-
// toolInfo.input is typed as { destination: string; departureDate?: string; ... }
|
|
336
|
-
// toolInfo.output.structuredContent is typed as { results: Array<...>; totalCount: number; }
|
|
337
|
-
|
|
338
|
-
if (toolInfo.isSuccess) {
|
|
339
|
-
return (
|
|
340
|
-
<div>Found {toolInfo.output.structuredContent.totalCount} results</div>
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
return <div>Searching for {toolInfo.input.destination}...</div>;
|
|
97
|
+
return output.structuredContent.flights.map(flight =>
|
|
98
|
+
<FlightCard key={flight.id} flight={flight} />
|
|
99
|
+
);
|
|
345
100
|
}
|
|
346
101
|
```
|
|
347
102
|
|
|
348
|
-
|
|
103
|
+
<br />
|
|
349
104
|
|
|
350
|
-
|
|
351
|
-
import { useCallTool } from "skybridge/web";
|
|
352
|
-
|
|
353
|
-
export const TestTool: React.FunctionComponent = () => {
|
|
354
|
-
const { callTool, isPending } = useCallTool("myToolName");
|
|
355
|
-
|
|
356
|
-
return (
|
|
357
|
-
<div>
|
|
358
|
-
<button
|
|
359
|
-
disabled={isPending}
|
|
360
|
-
onClick={() => {
|
|
361
|
-
callTool({ input: "test input" }, {
|
|
362
|
-
onSuccess: (data) => {
|
|
363
|
-
alert("Tool returned: " + data);
|
|
364
|
-
},
|
|
365
|
-
});
|
|
366
|
-
>
|
|
367
|
-
Call Tool inside a widget
|
|
368
|
-
</button>
|
|
369
|
-
</div>
|
|
370
|
-
);
|
|
371
|
-
};
|
|
372
|
-
```
|
|
105
|
+
## 🎯 Features at a Glance
|
|
373
106
|
|
|
374
|
-
|
|
107
|
+
- **Live Reload** — Vite HMR. See changes instantly without reinstalling.
|
|
108
|
+
- **Typed Hooks** — Full autocomplete for tools, inputs, outputs.
|
|
109
|
+
- **Widget → Tool Calls** — Trigger server actions from UI.
|
|
110
|
+
- **Dual Surface Sync** — Keep model aware of what users see with `data-llm`.
|
|
111
|
+
- **React Query-style API** — `isPending`, `isError`, callbacks.
|
|
112
|
+
- **Platform Agnostic** — Works with ChatGPT (Apps SDK) and MCP Apps clients (Goose, VSCode, etc.).
|
|
113
|
+
- **MCP Compatible** — Extends the official SDK. Works with any MCP client.
|
|
375
114
|
|
|
376
|
-
|
|
377
|
-
import { useCallTool } from "skybridge/web";
|
|
378
|
-
|
|
379
|
-
export const TestTool: React.FunctionComponent = () => {
|
|
380
|
-
const { callToolAsync, isPending } = useCallTool("myToolName");
|
|
381
|
-
|
|
382
|
-
return (
|
|
383
|
-
<div>
|
|
384
|
-
<button
|
|
385
|
-
disabled={isPending}
|
|
386
|
-
onClick={async () => {
|
|
387
|
-
const data = await callToolAsync({ input: "test input" });
|
|
388
|
-
alert("Tool returned: " + data);
|
|
389
|
-
}}
|
|
390
|
-
>
|
|
391
|
-
Call Tool inside a widget
|
|
392
|
-
</button>
|
|
393
|
-
</div>
|
|
394
|
-
);
|
|
395
|
-
};
|
|
396
|
-
```
|
|
115
|
+
<br />
|
|
397
116
|
|
|
398
|
-
|
|
117
|
+
## 📖 Showcase
|
|
399
118
|
|
|
400
|
-
|
|
119
|
+
Explore production-ready examples:
|
|
401
120
|
|
|
402
|
-
|
|
121
|
+
| Example | Description | Demo | Code |
|
|
122
|
+
|------------------------|----------------------------------------------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------------------------|
|
|
123
|
+
| **Capitals Explorer** | Interactive world map with geolocation and Wikipedia integration | [Try Demo](https://capitals.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/capitals) |
|
|
124
|
+
| **Ecommerce Carousel** | Product carousel with cart, localization, and modals | [Try Demo](https://ecommerce.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/ecom-carousel) |
|
|
125
|
+
| **Everything** | Comprehensive playground showcasing all hooks and features | [Try Demo](https://everything.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/everything) |
|
|
126
|
+
| **Productivity** | Data visualization dashboard demonstrating Skybridge capabilities for MCP Apps | [Try Demo](https://productivity.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/productivity) |
|
|
403
127
|
|
|
404
|
-
|
|
405
|
-
import { createStore } from "skybridge/web";
|
|
406
|
-
|
|
407
|
-
type CounterState = {
|
|
408
|
-
count: number;
|
|
409
|
-
increment: () => void;
|
|
410
|
-
decrement: () => void;
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
const useCounterStore = createStore<CounterState>(
|
|
414
|
-
(set) => ({
|
|
415
|
-
count: 0,
|
|
416
|
-
increment: () => set((state) => ({ count: state.count + 1 })),
|
|
417
|
-
decrement: () => set((state) => ({ count: state.count - 1 })),
|
|
418
|
-
}),
|
|
419
|
-
{ count: 0 } // Optional default state
|
|
420
|
-
);
|
|
421
|
-
|
|
422
|
-
// Use in your component
|
|
423
|
-
function CounterWidget() {
|
|
424
|
-
const { count, increment, decrement } = useCounterStore();
|
|
425
|
-
|
|
426
|
-
return (
|
|
427
|
-
<div>
|
|
428
|
-
<p>Count: {count}</p>
|
|
429
|
-
<button onClick={increment}>Increment</button>
|
|
430
|
-
<button onClick={decrement}>Decrement</button>
|
|
431
|
-
</div>
|
|
432
|
-
);
|
|
433
|
-
}
|
|
434
|
-
```
|
|
128
|
+
See all examples in the [Showcase](https://docs.skybridge.tech/showcase) or browse the [examples/](examples/) directory.
|
|
435
129
|
|
|
436
|
-
|
|
130
|
+
<br />
|
|
437
131
|
|
|
438
|
-
|
|
439
|
-
- Syncs with external state changes from the host
|
|
440
|
-
- Only serializes state data, not methods
|
|
132
|
+
<div align="center">
|
|
441
133
|
|
|
442
|
-
|
|
134
|
+
[](https://github.com/alpic-ai/skybridge/discussions)
|
|
135
|
+
[](https://github.com/alpic-ai/skybridge/issues)
|
|
136
|
+
[](https://discord.com/invite/gNAazGueab)
|
|
443
137
|
|
|
444
|
-
|
|
138
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions
|
|
445
139
|
|
|
446
|
-
|
|
447
|
-
2. Create a new vite project in a folder named `web` and install the `skybridge` package
|
|
448
|
-
3. Replace the `vite.config.ts` file with the following:
|
|
140
|
+
<br />
|
|
449
141
|
|
|
450
|
-
|
|
451
|
-
import { defineConfig } from "vite";
|
|
452
|
-
import { skybridge } from "skybridge/web";
|
|
142
|
+
**[MIT License](LICENSE)** · Made with ❤️ by **[Alpic](https://alpic.ai)**
|
|
453
143
|
|
|
454
|
-
|
|
455
|
-
plugins: [skybridge()],
|
|
456
|
-
});
|
|
457
|
-
```
|
|
144
|
+
</div>
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
export const Header = ({ version, children, }) => {
|
|
4
|
+
return (_jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "cyan", bold: true, children: ["\u26F0", " ", "Welcome to Skybridge"] }), _jsxs(Text, { color: "cyan", children: [" v", version] }), children] }));
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/cli/header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,OAAO,EACP,QAAQ,GAIT,EAAE,EAAE;IACH,OAAO,CACL,MAAC,GAAG,IAAC,YAAY,EAAE,CAAC,aAClB,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,IAAI,6BACnB,IAAI,4BACD,EACP,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,mBAAI,OAAO,IAAQ,EACpC,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
export function runCommand(command, options = {
|
|
3
|
+
stdio: ["ignore", "inherit", "inherit"],
|
|
4
|
+
}) {
|
|
5
|
+
return new Promise((resolve, reject) => {
|
|
6
|
+
const stdoutChunks = [];
|
|
7
|
+
const stderrChunks = [];
|
|
8
|
+
const proc = spawn(command, {
|
|
9
|
+
...options,
|
|
10
|
+
shell: true,
|
|
11
|
+
});
|
|
12
|
+
if (proc.stdout) {
|
|
13
|
+
proc.stdout.on("data", (chunk) => {
|
|
14
|
+
stdoutChunks.push(chunk);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (proc.stderr) {
|
|
18
|
+
proc.stderr.on("data", (chunk) => {
|
|
19
|
+
stderrChunks.push(chunk);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
proc.on("close", (code) => {
|
|
23
|
+
if (code === 0) {
|
|
24
|
+
resolve();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const stdoutOutput = Buffer.concat(stdoutChunks).toString();
|
|
28
|
+
const stderrOutput = Buffer.concat(stderrChunks).toString();
|
|
29
|
+
const allOutput = [stdoutOutput, stderrOutput]
|
|
30
|
+
.filter((output) => output.trim())
|
|
31
|
+
.join("\n");
|
|
32
|
+
const errorMessage = allOutput
|
|
33
|
+
? `Command failed with exit code ${code}\n${allOutput}`
|
|
34
|
+
: `Command failed with exit code ${code}`;
|
|
35
|
+
reject(new Error(errorMessage));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
proc.on("error", (error) => {
|
|
39
|
+
reject(error);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=run-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-command.js","sourceRoot":"","sources":["../../src/cli/run-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE9D,MAAM,UAAU,UAAU,CACxB,OAAe,EACf,UAAwB;IACtB,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;CACxC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,YAAY,GAAa,EAAE,CAAC;QAClC,MAAM,YAAY,GAAa,EAAE,CAAC;QAElC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,EAAE;YAC1B,GAAG,OAAO;YACV,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QAEH,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC/B,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC/B,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACxB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAC5D,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAC5D,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC;qBAC3C,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;qBACjC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACd,MAAM,YAAY,GAAG,SAAS;oBAC5B,CAAC,CAAC,iCAAiC,IAAI,KAAK,SAAS,EAAE;oBACvD,CAAC,CAAC,iCAAiC,IAAI,EAAE,CAAC;gBAC5C,MAAM,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;YAClC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACzB,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Hook } from "@oclif/core";
|
|
2
|
+
export declare function isEnabled(): boolean;
|
|
3
|
+
export declare function isDebugMode(): boolean;
|
|
4
|
+
export declare function setEnabled(enabled: boolean): void;
|
|
5
|
+
export declare function getMachineId(): string;
|
|
6
|
+
declare const hook: Hook<"finally">;
|
|
7
|
+
export default hook;
|