skybridge 0.0.0-dev.78d86f0 → 0.0.0-dev.7965868

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 (340) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +144 -0
  3. package/bin/run.js +5 -0
  4. package/dist/cli/header.d.ts +4 -0
  5. package/dist/cli/header.js +6 -0
  6. package/dist/cli/header.js.map +1 -0
  7. package/dist/cli/run-command.d.ts +2 -0
  8. package/dist/cli/run-command.js +43 -0
  9. package/dist/cli/run-command.js.map +1 -0
  10. package/dist/cli/server-entry.js +51 -0
  11. package/dist/cli/server-entry.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 +41 -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 +67 -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 +76 -0
  26. package/dist/commands/build.js.map +1 -0
  27. package/dist/commands/dev.d.ts +9 -0
  28. package/dist/commands/dev.js +31 -0
  29. package/dist/commands/dev.js.map +1 -0
  30. package/dist/commands/start.d.ts +7 -0
  31. package/dist/commands/start.js +33 -0
  32. package/dist/commands/start.js.map +1 -0
  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/{src/server → server}/index.d.ts +1 -1
  48. package/dist/{src/server → server}/index.js +1 -1
  49. package/dist/server/index.js.map +1 -0
  50. package/dist/server/inferUtilityTypes.js.map +1 -0
  51. package/dist/server/mcpMiddleware.d.ts +3 -0
  52. package/dist/server/mcpMiddleware.js +48 -0
  53. package/dist/server/mcpMiddleware.js.map +1 -0
  54. package/dist/{src/server → server}/server.d.ts +26 -1
  55. package/dist/server/server.js +139 -0
  56. package/dist/server/server.js.map +1 -0
  57. package/dist/server/templateHelper.js.map +1 -0
  58. package/dist/server/templates/development.hbs +65 -0
  59. package/dist/{src/server → server}/templates/production.hbs +1 -2
  60. package/dist/{src/server → server}/widgetsDevServer.d.ts +2 -2
  61. package/dist/{src/server → server}/widgetsDevServer.js +17 -3
  62. package/dist/server/widgetsDevServer.js.map +1 -0
  63. package/dist/test/utils.js.map +1 -0
  64. package/dist/{src/test → test}/widget.test.js +123 -14
  65. package/dist/test/widget.test.js.map +1 -0
  66. package/dist/web/bridges/apps-sdk/adaptor.d.ts +22 -0
  67. package/dist/web/bridges/apps-sdk/adaptor.js +64 -0
  68. package/dist/web/bridges/apps-sdk/adaptor.js.map +1 -0
  69. package/dist/web/bridges/apps-sdk/bridge.d.ts +10 -0
  70. package/dist/{src/web/bridges/apps-sdk-bridge.js → web/bridges/apps-sdk/bridge.js} +2 -2
  71. package/dist/web/bridges/apps-sdk/bridge.js.map +1 -0
  72. package/dist/web/bridges/apps-sdk/index.d.ts +5 -0
  73. package/dist/web/bridges/apps-sdk/index.js +5 -0
  74. package/dist/web/bridges/apps-sdk/index.js.map +1 -0
  75. package/dist/{src/web → web/bridges/apps-sdk}/types.d.ts +22 -56
  76. package/dist/{src/web → web/bridges/apps-sdk}/types.js +0 -1
  77. package/dist/web/bridges/apps-sdk/types.js.map +1 -0
  78. package/dist/web/bridges/apps-sdk/use-apps-sdk-context.d.ts +2 -0
  79. package/dist/{src/web/bridges/hooks/use-apps-sdk-bridge.js → web/bridges/apps-sdk/use-apps-sdk-context.js} +3 -3
  80. package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js.map +1 -0
  81. package/dist/web/bridges/get-adaptor.d.ts +2 -0
  82. package/dist/web/bridges/get-adaptor.js +8 -0
  83. package/dist/web/bridges/get-adaptor.js.map +1 -0
  84. package/dist/web/bridges/index.d.ts +5 -0
  85. package/dist/web/bridges/index.js +6 -0
  86. package/dist/web/bridges/index.js.map +1 -0
  87. package/dist/web/bridges/mcp-app/adaptor.d.ts +36 -0
  88. package/dist/web/bridges/mcp-app/adaptor.js +185 -0
  89. package/dist/web/bridges/mcp-app/adaptor.js.map +1 -0
  90. package/dist/web/bridges/mcp-app/bridge.d.ts +43 -0
  91. package/dist/{src/web/bridges/mcp-app-bridge.js → web/bridges/mcp-app/bridge.js} +109 -16
  92. package/dist/web/bridges/mcp-app/bridge.js.map +1 -0
  93. package/dist/web/bridges/mcp-app/index.d.ts +4 -0
  94. package/dist/web/bridges/mcp-app/index.js +4 -0
  95. package/dist/web/bridges/mcp-app/index.js.map +1 -0
  96. package/dist/web/bridges/mcp-app/types.d.ts +8 -0
  97. package/dist/web/bridges/mcp-app/types.js.map +1 -0
  98. package/dist/web/bridges/mcp-app/use-mcp-app-context.d.ts +5 -0
  99. package/dist/{src/web/bridges/hooks/use-mcp-app-bridge.js → web/bridges/mcp-app/use-mcp-app-context.js} +3 -3
  100. package/dist/web/bridges/mcp-app/use-mcp-app-context.js.map +1 -0
  101. package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js +66 -0
  102. package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js.map +1 -0
  103. package/dist/web/bridges/types.d.ts +98 -0
  104. package/dist/web/bridges/types.js +2 -0
  105. package/dist/{src/web → web}/bridges/types.js.map +1 -1
  106. package/dist/web/bridges/use-host-context.d.ts +2 -0
  107. package/dist/web/bridges/use-host-context.js +8 -0
  108. package/dist/web/bridges/use-host-context.js.map +1 -0
  109. package/dist/web/components/modal-provider.d.ts +4 -0
  110. package/dist/web/components/modal-provider.js +47 -0
  111. package/dist/web/components/modal-provider.js.map +1 -0
  112. package/dist/{src/web → web}/create-store.js +6 -7
  113. package/dist/web/create-store.js.map +1 -0
  114. package/dist/web/create-store.test.js +126 -0
  115. package/dist/web/create-store.test.js.map +1 -0
  116. package/dist/{src/web → web}/data-llm.js +5 -3
  117. package/dist/web/data-llm.js.map +1 -0
  118. package/dist/web/data-llm.test.js +139 -0
  119. package/dist/web/data-llm.test.js.map +1 -0
  120. package/dist/{src/web → web}/generate-helpers.d.ts +3 -2
  121. package/dist/{src/web → web}/generate-helpers.js +1 -1
  122. package/dist/web/generate-helpers.js.map +1 -0
  123. package/dist/web/generate-helpers.test-d.js.map +1 -0
  124. package/dist/web/generate-helpers.test.js.map +1 -0
  125. package/dist/{src/web → web}/helpers/state.js +13 -8
  126. package/dist/web/helpers/state.js.map +1 -0
  127. package/dist/web/helpers/state.test.js.map +1 -0
  128. package/dist/{src/web → web}/hooks/index.d.ts +1 -1
  129. package/dist/{src/web → web}/hooks/index.js +1 -1
  130. package/dist/web/hooks/index.js.map +1 -0
  131. package/dist/{src/web → web}/hooks/test/utils.d.ts +8 -2
  132. package/dist/web/hooks/test/utils.js +60 -0
  133. package/dist/web/hooks/test/utils.js.map +1 -0
  134. package/dist/{src/web → web}/hooks/use-call-tool.d.ts +2 -1
  135. package/dist/{src/web → web}/hooks/use-call-tool.js +2 -2
  136. package/dist/web/hooks/use-call-tool.js.map +1 -0
  137. package/dist/web/hooks/use-call-tool.test-d.js.map +1 -0
  138. package/dist/{src/web → web}/hooks/use-call-tool.test.js +0 -1
  139. package/dist/web/hooks/use-call-tool.test.js.map +1 -0
  140. package/dist/web/hooks/use-display-mode.js +9 -0
  141. package/dist/web/hooks/use-display-mode.js.map +1 -0
  142. package/dist/web/hooks/use-display-mode.test.js.map +1 -0
  143. package/dist/web/hooks/use-files.d.ts +6 -0
  144. package/dist/web/hooks/use-files.js +9 -0
  145. package/dist/web/hooks/use-files.js.map +1 -0
  146. package/dist/{src/web → web}/hooks/use-files.test.js +5 -4
  147. package/dist/web/hooks/use-files.test.js.map +1 -0
  148. package/dist/{src/web → web}/hooks/use-layout.d.ts +2 -2
  149. package/dist/{src/web → web}/hooks/use-layout.js +4 -4
  150. package/dist/web/hooks/use-layout.js.map +1 -0
  151. package/dist/{src/web → web}/hooks/use-layout.test.js +6 -5
  152. package/dist/web/hooks/use-layout.test.js.map +1 -0
  153. package/dist/{src/web → web}/hooks/use-open-external.js +2 -2
  154. package/dist/web/hooks/use-open-external.js.map +1 -0
  155. package/dist/{src/web → web}/hooks/use-open-external.test.js +1 -1
  156. package/dist/web/hooks/use-open-external.test.js.map +1 -0
  157. package/dist/{src/web → web}/hooks/use-request-modal.d.ts +2 -2
  158. package/dist/web/hooks/use-request-modal.js +16 -0
  159. package/dist/web/hooks/use-request-modal.js.map +1 -0
  160. package/dist/web/hooks/use-request-modal.test.js.map +1 -0
  161. package/dist/{src/web → web}/hooks/use-send-follow-up-message.js +2 -2
  162. package/dist/web/hooks/use-send-follow-up-message.js.map +1 -0
  163. package/dist/web/hooks/use-set-open-in-app-url.d.ts +1 -0
  164. package/dist/web/hooks/use-set-open-in-app-url.js +8 -0
  165. package/dist/web/hooks/use-set-open-in-app-url.js.map +1 -0
  166. package/dist/web/hooks/use-set-open-in-app-url.test.js +49 -0
  167. package/dist/web/hooks/use-set-open-in-app-url.test.js.map +1 -0
  168. package/dist/{src/web → web}/hooks/use-tool-info.js +4 -4
  169. package/dist/web/hooks/use-tool-info.js.map +1 -0
  170. package/dist/web/hooks/use-tool-info.test-d.js.map +1 -0
  171. package/dist/{src/web → web}/hooks/use-tool-info.test.js +4 -4
  172. package/dist/web/hooks/use-tool-info.test.js.map +1 -0
  173. package/dist/{src/web → web}/hooks/use-user.d.ts +1 -1
  174. package/dist/{src/web → web}/hooks/use-user.js +3 -3
  175. package/dist/web/hooks/use-user.js.map +1 -0
  176. package/dist/{src/web → web}/hooks/use-user.test.js +4 -3
  177. package/dist/web/hooks/use-user.test.js.map +1 -0
  178. package/dist/{src/web → web}/hooks/use-widget-state.js +10 -10
  179. package/dist/web/hooks/use-widget-state.js.map +1 -0
  180. package/dist/web/hooks/use-widget-state.test.d.ts +1 -0
  181. package/dist/web/hooks/use-widget-state.test.js.map +1 -0
  182. package/dist/web/index.js.map +1 -0
  183. package/dist/{src/web → web}/mount-widget.js +9 -1
  184. package/dist/web/mount-widget.js.map +1 -0
  185. package/dist/web/plugin/data-llm.test.d.ts +1 -0
  186. package/dist/web/plugin/data-llm.test.js.map +1 -0
  187. package/dist/{src/web → web}/plugin/plugin.js +7 -0
  188. package/dist/web/plugin/plugin.js.map +1 -0
  189. package/dist/web/plugin/transform-data-llm.js.map +1 -0
  190. package/dist/web/plugin/transform-data-llm.test.d.ts +1 -0
  191. package/dist/web/plugin/transform-data-llm.test.js.map +1 -0
  192. package/dist/web/proxy.js.map +1 -0
  193. package/dist/web/types.d.ts +16 -0
  194. package/dist/web/types.js +2 -0
  195. package/dist/web/types.js.map +1 -0
  196. package/package.json +55 -33
  197. package/dist/src/server/devtoolsStaticServer.d.ts +0 -15
  198. package/dist/src/server/devtoolsStaticServer.js +0 -38
  199. package/dist/src/server/devtoolsStaticServer.js.map +0 -1
  200. package/dist/src/server/index.js.map +0 -1
  201. package/dist/src/server/inferUtilityTypes.js.map +0 -1
  202. package/dist/src/server/server.js +0 -82
  203. package/dist/src/server/server.js.map +0 -1
  204. package/dist/src/server/templateHelper.js.map +0 -1
  205. package/dist/src/server/templates/development.hbs +0 -13
  206. package/dist/src/server/widgetsDevServer.js.map +0 -1
  207. package/dist/src/test/utils.js.map +0 -1
  208. package/dist/src/test/widget.test.js.map +0 -1
  209. package/dist/src/web/bridges/adaptors/apps-sdk-adaptor.d.ts +0 -13
  210. package/dist/src/web/bridges/adaptors/apps-sdk-adaptor.js +0 -33
  211. package/dist/src/web/bridges/adaptors/apps-sdk-adaptor.js.map +0 -1
  212. package/dist/src/web/bridges/adaptors/mcp-app-adaptor.d.ts +0 -16
  213. package/dist/src/web/bridges/adaptors/mcp-app-adaptor.js +0 -115
  214. package/dist/src/web/bridges/adaptors/mcp-app-adaptor.js.map +0 -1
  215. package/dist/src/web/bridges/apps-sdk-bridge.d.ts +0 -10
  216. package/dist/src/web/bridges/apps-sdk-bridge.js.map +0 -1
  217. package/dist/src/web/bridges/hooks/use-adaptor.d.ts +0 -2
  218. package/dist/src/web/bridges/hooks/use-adaptor.js +0 -8
  219. package/dist/src/web/bridges/hooks/use-adaptor.js.map +0 -1
  220. package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.d.ts +0 -2
  221. package/dist/src/web/bridges/hooks/use-apps-sdk-bridge.js.map +0 -1
  222. package/dist/src/web/bridges/hooks/use-bridge.d.ts +0 -2
  223. package/dist/src/web/bridges/hooks/use-bridge.js +0 -8
  224. package/dist/src/web/bridges/hooks/use-bridge.js.map +0 -1
  225. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.d.ts +0 -5
  226. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.js.map +0 -1
  227. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js +0 -41
  228. package/dist/src/web/bridges/hooks/use-mcp-app-bridge.test.js.map +0 -1
  229. package/dist/src/web/bridges/index.d.ts +0 -4
  230. package/dist/src/web/bridges/index.js +0 -5
  231. package/dist/src/web/bridges/index.js.map +0 -1
  232. package/dist/src/web/bridges/mcp-app-bridge.d.ts +0 -38
  233. package/dist/src/web/bridges/mcp-app-bridge.js.map +0 -1
  234. package/dist/src/web/bridges/types.d.ts +0 -57
  235. package/dist/src/web/create-store.js.map +0 -1
  236. package/dist/src/web/create-store.test.js +0 -70
  237. package/dist/src/web/create-store.test.js.map +0 -1
  238. package/dist/src/web/data-llm.js.map +0 -1
  239. package/dist/src/web/data-llm.test.js +0 -76
  240. package/dist/src/web/data-llm.test.js.map +0 -1
  241. package/dist/src/web/generate-helpers.js.map +0 -1
  242. package/dist/src/web/generate-helpers.test-d.js.map +0 -1
  243. package/dist/src/web/generate-helpers.test.js.map +0 -1
  244. package/dist/src/web/helpers/state.js.map +0 -1
  245. package/dist/src/web/helpers/state.test.js.map +0 -1
  246. package/dist/src/web/hooks/index.js.map +0 -1
  247. package/dist/src/web/hooks/test/utils.js +0 -40
  248. package/dist/src/web/hooks/test/utils.js.map +0 -1
  249. package/dist/src/web/hooks/use-call-tool.js.map +0 -1
  250. package/dist/src/web/hooks/use-call-tool.test-d.js.map +0 -1
  251. package/dist/src/web/hooks/use-call-tool.test.js.map +0 -1
  252. package/dist/src/web/hooks/use-display-mode.js +0 -10
  253. package/dist/src/web/hooks/use-display-mode.js.map +0 -1
  254. package/dist/src/web/hooks/use-display-mode.test.js.map +0 -1
  255. package/dist/src/web/hooks/use-files.d.ts +0 -10
  256. package/dist/src/web/hooks/use-files.js +0 -7
  257. package/dist/src/web/hooks/use-files.js.map +0 -1
  258. package/dist/src/web/hooks/use-files.test.js.map +0 -1
  259. package/dist/src/web/hooks/use-layout.js.map +0 -1
  260. package/dist/src/web/hooks/use-layout.test.js.map +0 -1
  261. package/dist/src/web/hooks/use-open-external.js.map +0 -1
  262. package/dist/src/web/hooks/use-open-external.test.js.map +0 -1
  263. package/dist/src/web/hooks/use-openai-global.d.ts +0 -3
  264. package/dist/src/web/hooks/use-openai-global.js +0 -6
  265. package/dist/src/web/hooks/use-openai-global.js.map +0 -1
  266. package/dist/src/web/hooks/use-request-modal.js +0 -14
  267. package/dist/src/web/hooks/use-request-modal.js.map +0 -1
  268. package/dist/src/web/hooks/use-request-modal.test.js.map +0 -1
  269. package/dist/src/web/hooks/use-send-follow-up-message.js.map +0 -1
  270. package/dist/src/web/hooks/use-tool-info.js.map +0 -1
  271. package/dist/src/web/hooks/use-tool-info.test-d.js.map +0 -1
  272. package/dist/src/web/hooks/use-tool-info.test.js.map +0 -1
  273. package/dist/src/web/hooks/use-user.js.map +0 -1
  274. package/dist/src/web/hooks/use-user.test.js.map +0 -1
  275. package/dist/src/web/hooks/use-widget-state.js.map +0 -1
  276. package/dist/src/web/hooks/use-widget-state.test.js.map +0 -1
  277. package/dist/src/web/index.js.map +0 -1
  278. package/dist/src/web/mount-widget.js.map +0 -1
  279. package/dist/src/web/plugin/data-llm.test.js.map +0 -1
  280. package/dist/src/web/plugin/plugin.js.map +0 -1
  281. package/dist/src/web/plugin/transform-data-llm.js.map +0 -1
  282. package/dist/src/web/plugin/transform-data-llm.test.js.map +0 -1
  283. package/dist/src/web/proxy.js.map +0 -1
  284. package/dist/src/web/types.js.map +0 -1
  285. package/dist/vitest.config.d.ts +0 -2
  286. package/dist/vitest.config.js +0 -8
  287. package/dist/vitest.config.js.map +0 -1
  288. /package/dist/{src/test/widget.test.d.ts → cli/server-entry.d.ts} +0 -0
  289. /package/dist/{src/web/bridges/hooks/use-mcp-app-bridge.test.d.ts → server/asset-base-url-transform-plugin.test.d.ts} +0 -0
  290. /package/dist/{src/server → server}/inferUtilityTypes.d.ts +0 -0
  291. /package/dist/{src/server → server}/inferUtilityTypes.js +0 -0
  292. /package/dist/{src/server → server}/templateHelper.d.ts +0 -0
  293. /package/dist/{src/server → server}/templateHelper.js +0 -0
  294. /package/dist/{src/test → test}/utils.d.ts +0 -0
  295. /package/dist/{src/test → test}/utils.js +0 -0
  296. /package/dist/{src/web/create-store.test.d.ts → test/widget.test.d.ts} +0 -0
  297. /package/dist/{src/web/bridges → web/bridges/mcp-app}/types.js +0 -0
  298. /package/dist/{src/web/data-llm.test.d.ts → web/bridges/mcp-app/use-mcp-app-context.test.d.ts} +0 -0
  299. /package/dist/{src/web → web}/create-store.d.ts +0 -0
  300. /package/dist/{src/web/generate-helpers.test-d.d.ts → web/create-store.test.d.ts} +0 -0
  301. /package/dist/{src/web → web}/data-llm.d.ts +0 -0
  302. /package/dist/{src/web/plugin → web}/data-llm.test.d.ts +0 -0
  303. /package/dist/{src/web/generate-helpers.test.d.ts → web/generate-helpers.test-d.d.ts} +0 -0
  304. /package/dist/{src/web → web}/generate-helpers.test-d.js +0 -0
  305. /package/dist/{src/web/helpers/state.test.d.ts → web/generate-helpers.test.d.ts} +0 -0
  306. /package/dist/{src/web → web}/generate-helpers.test.js +0 -0
  307. /package/dist/{src/web → web}/helpers/state.d.ts +0 -0
  308. /package/dist/{src/web/hooks/use-call-tool.test-d.d.ts → web/helpers/state.test.d.ts} +0 -0
  309. /package/dist/{src/web → web}/helpers/state.test.js +0 -0
  310. /package/dist/{src/web/hooks/use-call-tool.test.d.ts → web/hooks/use-call-tool.test-d.d.ts} +0 -0
  311. /package/dist/{src/web → web}/hooks/use-call-tool.test-d.js +0 -0
  312. /package/dist/{src/web/hooks/use-display-mode.test.d.ts → web/hooks/use-call-tool.test.d.ts} +0 -0
  313. /package/dist/{src/web → web}/hooks/use-display-mode.d.ts +0 -0
  314. /package/dist/{src/web/hooks/use-files.test.d.ts → web/hooks/use-display-mode.test.d.ts} +0 -0
  315. /package/dist/{src/web → web}/hooks/use-display-mode.test.js +0 -0
  316. /package/dist/{src/web/hooks/use-layout.test.d.ts → web/hooks/use-files.test.d.ts} +0 -0
  317. /package/dist/{src/web/hooks/use-open-external.test.d.ts → web/hooks/use-layout.test.d.ts} +0 -0
  318. /package/dist/{src/web → web}/hooks/use-open-external.d.ts +0 -0
  319. /package/dist/{src/web/hooks/use-request-modal.test.d.ts → web/hooks/use-open-external.test.d.ts} +0 -0
  320. /package/dist/{src/web/hooks/use-tool-info.test-d.d.ts → web/hooks/use-request-modal.test.d.ts} +0 -0
  321. /package/dist/{src/web → web}/hooks/use-request-modal.test.js +0 -0
  322. /package/dist/{src/web → web}/hooks/use-send-follow-up-message.d.ts +0 -0
  323. /package/dist/{src/web/hooks/use-tool-info.test.d.ts → web/hooks/use-set-open-in-app-url.test.d.ts} +0 -0
  324. /package/dist/{src/web → web}/hooks/use-tool-info.d.ts +0 -0
  325. /package/dist/{src/web/hooks/use-user.test.d.ts → web/hooks/use-tool-info.test-d.d.ts} +0 -0
  326. /package/dist/{src/web → web}/hooks/use-tool-info.test-d.js +0 -0
  327. /package/dist/{src/web/hooks/use-widget-state.test.d.ts → web/hooks/use-tool-info.test.d.ts} +0 -0
  328. /package/dist/{src/web/plugin/transform-data-llm.test.d.ts → web/hooks/use-user.test.d.ts} +0 -0
  329. /package/dist/{src/web → web}/hooks/use-widget-state.d.ts +0 -0
  330. /package/dist/{src/web → web}/hooks/use-widget-state.test.js +0 -0
  331. /package/dist/{src/web → web}/index.d.ts +0 -0
  332. /package/dist/{src/web → web}/index.js +0 -0
  333. /package/dist/{src/web → web}/mount-widget.d.ts +0 -0
  334. /package/dist/{src/web → web}/plugin/data-llm.test.js +0 -0
  335. /package/dist/{src/web → web}/plugin/plugin.d.ts +0 -0
  336. /package/dist/{src/web → web}/plugin/transform-data-llm.d.ts +0 -0
  337. /package/dist/{src/web → web}/plugin/transform-data-llm.js +0 -0
  338. /package/dist/{src/web → web}/plugin/transform-data-llm.test.js +0 -0
  339. /package/dist/{src/web → web}/proxy.d.ts +0 -0
  340. /package/dist/{src/web → web}/proxy.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-typescript-check.js","sourceRoot":"","sources":["../../src/cli/use-typescript-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASpD,MAAM,UAAU,kBAAkB;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type CommandStep } from "../cli/use-execute-steps.js";
3
+ export declare const commandSteps: CommandStep[];
4
+ export default class Build extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static flags: {};
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,76 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cpSync, existsSync, readFileSync, rmSync, writeFileSync, } from "node:fs";
3
+ import { join, resolve } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { Command } from "@oclif/core";
6
+ import { Box, render, Text } from "ink";
7
+ import { useEffect } from "react";
8
+ import { Header } from "../cli/header.js";
9
+ import { useExecuteSteps } from "../cli/use-execute-steps.js";
10
+ let indexTsWasCreated = false;
11
+ export const commandSteps = [
12
+ {
13
+ label: "Preparing build environment",
14
+ run: () => {
15
+ const projectRoot = process.cwd();
16
+ const serverSrcDir = resolve(projectRoot, "server/src");
17
+ const serverTsPath = join(serverSrcDir, "server.ts");
18
+ if (!existsSync(serverTsPath)) {
19
+ throw new Error(`server.ts not found at ${serverTsPath}. Please ensure your server.ts file exists in server/src/`);
20
+ }
21
+ const indexTsPath = join(serverSrcDir, "index.ts");
22
+ if (!existsSync(indexTsPath)) {
23
+ const serverEntryPath = resolve(fileURLToPath(import.meta.url), "../../cli/server-entry.js");
24
+ const buildEntryContent = readFileSync(serverEntryPath, "utf-8");
25
+ writeFileSync(join(serverSrcDir, "index.ts"), buildEntryContent, "utf-8");
26
+ indexTsWasCreated = true;
27
+ }
28
+ },
29
+ },
30
+ {
31
+ label: "Building widgets",
32
+ command: "vite build -c web/vite.config.ts",
33
+ },
34
+ {
35
+ label: "Compiling server",
36
+ run: () => rmSync("dist", { recursive: true, force: true }),
37
+ command: "tsc -p tsconfig.server.json",
38
+ },
39
+ {
40
+ label: "Copying static assets",
41
+ run: () => cpSync("web/dist", "dist/assets", { recursive: true }),
42
+ },
43
+ ];
44
+ const cleanup = () => {
45
+ if (indexTsWasCreated) {
46
+ const projectRoot = process.cwd();
47
+ const serverIndex = resolve(projectRoot, "server/src/index.ts");
48
+ if (existsSync(serverIndex)) {
49
+ rmSync(serverIndex);
50
+ }
51
+ }
52
+ };
53
+ export default class Build extends Command {
54
+ static description = "Build the widgets and MCP server";
55
+ static examples = ["skybridge build"];
56
+ static flags = {};
57
+ async run() {
58
+ const App = () => {
59
+ const { currentStep, status, error, execute } = useExecuteSteps(commandSteps, cleanup);
60
+ useEffect(() => {
61
+ execute();
62
+ }, [execute]);
63
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Header, { version: this.config.version, children: _jsx(Text, { color: "green", children: " \u2192 building for production\u2026" }) }), commandSteps.map((step, index) => {
64
+ const isCurrent = index === currentStep && status === "running";
65
+ const isCompleted = index < currentStep || status === "success";
66
+ const isError = status === "error" && index === currentStep;
67
+ return (_jsx(Box, { marginBottom: 0, children: _jsxs(Text, { color: isError ? "red" : isCompleted ? "green" : "grey", children: [isError ? "✗" : isCompleted ? "✓" : isCurrent ? "⟳" : "○", " ", step.label] }) }, step.label));
68
+ }), status === "success" && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "green", bold: true, children: "\u2713 Build completed successfully!" }) })), status === "error" && error && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "red", bold: true, children: "\u2717 Build failed" }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: error.split("\n").map((line) => (_jsx(Text, { color: "red", children: line }, line))) })] }))] }));
69
+ };
70
+ render(_jsx(App, {}), {
71
+ exitOnCtrlC: true,
72
+ patchConsole: false,
73
+ });
74
+ }
75
+ }
76
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,YAAY,EACZ,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,OAAO,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AAI,0CAEf,EACP,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,YACtC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC/B,KAAC,IAAI,IAAY,KAAK,EAAC,KAAK,YACzB,IAAI,IADI,IAAI,CAER,CACR,CAAC,GACE,IACF,CACP,IACG,CACP,CAAC;QACJ,CAAC,CAAC;QAEF,MAAM,CAAC,KAAC,GAAG,KAAG,EAAE;YACd,WAAW,EAAE,IAAI;YACjB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;IACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Command } from "@oclif/core";
2
+ export default class Dev extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ "use-forwarded-host": import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Command, Flags } from "@oclif/core";
3
+ import { Box, render, Text } from "ink";
4
+ import { Header } from "../cli/header.js";
5
+ import { useNodemon } from "../cli/use-nodemon.js";
6
+ import { useTypeScriptCheck } from "../cli/use-typescript-check.js";
7
+ export default class Dev extends Command {
8
+ static description = "Start development server";
9
+ static examples = ["skybridge"];
10
+ static flags = {
11
+ "use-forwarded-host": Flags.boolean({
12
+ description: "Uses the forwarded host header to construct widget URLs instead of localhost, useful when accessing the dev server through a tunnel (e.g., ngrok)",
13
+ }),
14
+ };
15
+ async run() {
16
+ const { flags } = await this.parse(Dev);
17
+ const env = {
18
+ ...process.env,
19
+ ...(flags["use-forwarded-host"]
20
+ ? { SKYBRIDGE_USE_FORWARDED_HOST: "true" }
21
+ : {}),
22
+ };
23
+ const App = () => {
24
+ const tsErrors = useTypeScriptCheck();
25
+ const messages = useNodemon(env);
26
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, marginLeft: 1, children: [_jsx(Header, { version: this.config.version }), _jsxs(Box, { children: [_jsxs(Text, { color: "green", children: ["\u2192", " "] }), _jsxs(Text, { color: "white", bold: true, children: ["Open DevTools to test your app locally:", " "] }), _jsx(Text, { color: "green", children: "http://localhost:3000/" })] }), _jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsxs(Text, { children: ["MCP server running at:", " "] }), _jsx(Text, { color: "white", bold: true, children: "http://localhost:3000/mcp" })] }), _jsx(Text, { color: "white", underline: true, children: "To test on ChatGPT:" }), _jsxs(Box, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { color: "grey", children: "Make your local server accessible with " }), _jsx(Text, { color: "white", bold: true, children: "ngrok http 3000" })] }), _jsx(Box, { marginBottom: 1, children: _jsxs(Text, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { color: "grey", children: "Connect to ChatGPT with URL " }), _jsx(Text, { color: "white", bold: true, children: "https://xxxxxx.ngrok-free.app/mcp" })] }) }), _jsx(Box, { children: _jsxs(Text, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { children: "Documentation: " }), _jsx(Text, { color: "white", bold: true, children: "https://docs.skybridge.tech/" })] }) }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { children: "If you like Skybridge, please " }), _jsxs(Text, { color: "white", bold: true, children: ["give it a star", " "] }), _jsx(Text, { children: "on GitHub: " }), _jsx(Text, { color: "white", underline: true, children: "https://github.com/alpic-ai/skybridge" }), _jsx(Text, { color: "grey", children: " \uD83D\uDE4F" })] }) }), tsErrors.length > 0 && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "red", bold: true, children: "\u26A0\uFE0F TypeScript errors found:" }), tsErrors.map((error) => (_jsxs(Box, { marginLeft: 2, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: "white", children: error.file }), _jsxs(Text, { color: "grey", children: ["(", error.line, ",", error.col, "):", " "] })] }), _jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "red", children: error.message }) })] }, `${error.file}:${error.line}:${error.col}`)))] })), messages.length > 0 && (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "white", bold: true, children: "Logs:" }), messages.map((message, index) => (_jsx(Box, { marginLeft: 2, children: message.type === "restart" ? (_jsxs(_Fragment, { children: [_jsxs(Text, { color: "green", children: ["\u2713", " "] }), _jsx(Text, { color: "white", children: message.text })] })) : message.type === "error" ? (_jsx(Text, { color: "red", children: message.text })) : (_jsx(Text, { children: message.text })) }, `${message.type}-${index}-${message.text.slice(0, 20)}`)))] }))] }));
27
+ };
28
+ render(_jsx(App, {}), { exitOnCtrlC: true, patchConsole: true });
29
+ }
30
+ }
31
+ //# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IACtC,MAAM,CAAU,WAAW,GAAG,0BAA0B,CAAC;IACzD,MAAM,CAAU,QAAQ,GAAG,CAAC,WAAW,CAAC,CAAC;IACzC,MAAM,CAAU,KAAK,GAAG;QACtB,oBAAoB,EAAE,KAAK,CAAC,OAAO,CAAC;YAClC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,EAAE,CAaxD,CACP,CAAC,IACE,CACP,IACG,CACP,CAAC;QACJ,CAAC,CAAC;QAEF,MAAM,CAAC,KAAC,GAAG,KAAG,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Command } from "@oclif/core";
2
+ export default class Start extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {};
6
+ run(): Promise<void>;
7
+ }
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { existsSync } from "node:fs";
3
+ import { resolve } from "node:path";
4
+ import { Command } from "@oclif/core";
5
+ import { Box, render, Text } from "ink";
6
+ import { Header } from "../cli/header.js";
7
+ import { runCommand } from "../cli/run-command.js";
8
+ export default class Start extends Command {
9
+ static description = "Start production server";
10
+ static examples = ["skybridge start"];
11
+ static flags = {};
12
+ async run() {
13
+ console.clear();
14
+ const distPath = resolve(process.cwd(), "dist/index.js");
15
+ if (!existsSync(distPath)) {
16
+ console.error("❌ Error: dist/index.js not found");
17
+ console.error("");
18
+ console.error("Please build your project first:");
19
+ console.error(" skybridge build");
20
+ console.error("");
21
+ process.exit(1);
22
+ }
23
+ runCommand("node dist/index.js", {
24
+ stdio: ["ignore", "ignore", "inherit"],
25
+ env: { ...process.env, NODE_ENV: "production" },
26
+ });
27
+ const App = () => {
28
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, marginLeft: 1, children: [_jsx(Header, { version: this.config.version }), _jsxs(Box, { children: [_jsx(Text, { children: "Server running at: " }), _jsx(Text, { color: "green", bold: true, children: "http://localhost:3000/mcp" })] })] }));
29
+ };
30
+ render(_jsx(App, {}), { exitOnCtrlC: true, patchConsole: false });
31
+ }
32
+ }
33
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.tsx"],"names":[],"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AAM,GAAG,GAAG,GAAG,EAAE;YACf,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,aACnD,KAAC,MAAM,IAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,GAAI,EACxC,MAAC,GAAG,eACF,KAAC,IAAI,sCAA2B,EAChC,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,gDAEjB,IACH,IACF,CACP,CAAC;QACJ,CAAC,CAAC;QAEF,MAAM,CAAC,KAAC,GAAG,KAAG,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9D,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Command } from "@oclif/core";
2
+ export default class TelemetryDisable extends Command {
3
+ static description: string;
4
+ run(): Promise<void>;
5
+ }
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Command } from "@oclif/core";
3
+ import { Box, render, Text } from "ink";
4
+ import { setEnabled } from "../../cli/telemetry.js";
5
+ export default class TelemetryDisable extends Command {
6
+ static description = "Disable Skybridge telemetry on this machine";
7
+ async run() {
8
+ await this.parse(TelemetryDisable);
9
+ setEnabled(false);
10
+ const App = () => (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: "yellow", children: "\u2713" }), _jsx(Text, { children: " Telemetry has been " }), _jsx(Text, { color: "yellow", bold: true, children: "disabled" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Config saved to ~/.skybridge/config.json" }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Skybridge never collects Personally Identifiable Information (PII). If you'd like to help us improve Skybridge by allowing anonymous CLI usage data, please reenable telemetry with: skybridge telemetry enable" }) })] }));
11
+ render(_jsx(App, {}));
12
+ }
13
+ }
14
+ //# sourceMappingURL=disable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disable.js","sourceRoot":"","sources":["../../../src/commands/telemetry/disable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,OAAO;IACnD,MAAM,CAAU,WAAW,GAAG,6CAA6C,CAAC;IAErE,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACnC,UAAU,CAAC,KAAK,CAAC,CAAC;QAElB,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,CAChB,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aACpC,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,uBAAS,EAC7B,KAAC,IAAI,uCAA4B,EACjC,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,+BAElB,IACH,EACN,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,yDAAgD,GAC9D,EACN,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,gOAKX,GACH,IACF,CACP,CAAC;QAEF,MAAM,CAAC,KAAC,GAAG,KAAG,CAAC,CAAC;IAClB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Command } from "@oclif/core";
2
+ export default class TelemetryEnable extends Command {
3
+ static description: string;
4
+ run(): Promise<void>;
5
+ }
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Command } from "@oclif/core";
3
+ import { Box, render, Text } from "ink";
4
+ import { setEnabled } from "../../cli/telemetry.js";
5
+ export default class TelemetryEnable extends Command {
6
+ static description = "Enable Skybridge telemetry on this machine";
7
+ async run() {
8
+ await this.parse(TelemetryEnable);
9
+ setEnabled(true);
10
+ const App = () => (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: "green", children: "\u2713" }), _jsx(Text, { children: " Telemetry has been " }), _jsx(Text, { color: "green", bold: true, children: "enabled" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Config saved to ~/.skybridge/config.json" }) })] }));
11
+ render(_jsx(App, {}));
12
+ }
13
+ }
14
+ //# sourceMappingURL=enable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enable.js","sourceRoot":"","sources":["../../../src/commands/telemetry/enable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAClD,MAAM,CAAU,WAAW,GAAG,4CAA4C,CAAC;IAEpE,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAClC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEjB,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,CAChB,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aACpC,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,uBAAS,EAC5B,KAAC,IAAI,uCAA4B,EACjC,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,8BAEjB,IACH,EACN,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,yDAAgD,GAC9D,IACF,CACP,CAAC;QAEF,MAAM,CAAC,KAAC,GAAG,KAAG,CAAC,CAAC;IAClB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Command } from "@oclif/core";
2
+ export default class TelemetryStatus extends Command {
3
+ static description: string;
4
+ run(): Promise<void>;
5
+ }
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Command } from "@oclif/core";
3
+ import { Box, render, Text } from "ink";
4
+ import { getMachineId, isEnabled } from "../../cli/telemetry.js";
5
+ export default class TelemetryStatus extends Command {
6
+ static description = "Get Skybridge current telemetry settings for this machine";
7
+ async run() {
8
+ await this.parse(TelemetryStatus);
9
+ const enabled = isEnabled();
10
+ const App = () => (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, underline: true, children: "Skybridge Telemetry" }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { children: "Status: " }), enabled ? (_jsx(Text, { color: "green", bold: true, children: "Enabled" })) : (_jsx(Text, { color: "yellow", bold: true, children: "Disabled" }))] }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "gray", children: "Machine ID: " }), _jsx(Text, { children: getMachineId() })] })] }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "gray", children: "To opt out, run: skybridge telemetry disable" }), _jsx(Text, { color: "gray", children: "Or set: SKYBRIDGE_TELEMETRY_DISABLED=1" }), _jsx(Text, { color: "gray", children: "Debug mode: SKYBRIDGE_TELEMETRY_DEBUG=1" })] })] }));
11
+ render(_jsx(App, {}));
12
+ }
13
+ }
14
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/telemetry/status.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE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MAAM,CAAC,KAAC,GAAG,KAAG,CAAC,CAAC;IAClB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Plugin } from "vite";
2
+ /**
3
+ * Transforms asset import paths to use the development server base URL.
4
+ */
5
+ export declare function assetBaseUrlTransform(code: string, devServerOrigin: string): string;
6
+ /**
7
+ * Vite plugin that transforms asset import paths to use the development server base URL.
8
+ */
9
+ export declare function assetBaseUrlTransformPlugin(options: {
10
+ devServerOrigin: string;
11
+ }): Plugin;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Transforms asset import paths to use the development server base URL.
3
+ */
4
+ export function assetBaseUrlTransform(code, devServerOrigin) {
5
+ const assetStringPattern = /(?<!https?:\/\/)(["'`])(\/[^"'`]+\.(svg|png|jpeg|jpg|gif|webp|mp3|mp4|woff|woff2|ttf|eot))\1/g;
6
+ code = code.replace(assetStringPattern, (_match, quote, assetPath) => {
7
+ return `${quote}${devServerOrigin}${assetPath}${quote}`;
8
+ });
9
+ return code;
10
+ }
11
+ /**
12
+ * Vite plugin that transforms asset import paths to use the development server base URL.
13
+ */
14
+ export function assetBaseUrlTransformPlugin(options) {
15
+ const { devServerOrigin } = options;
16
+ return {
17
+ name: "asset-base-url-transform",
18
+ enforce: "pre",
19
+ transform(code) {
20
+ if (!code) {
21
+ return null;
22
+ }
23
+ const transformedCode = assetBaseUrlTransform(code, devServerOrigin);
24
+ if (transformedCode === code) {
25
+ return null;
26
+ }
27
+ return {
28
+ code: transformedCode,
29
+ map: null,
30
+ };
31
+ },
32
+ };
33
+ }
34
+ //# sourceMappingURL=asset-base-url-transform-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-base-url-transform-plugin.js","sourceRoot":"","sources":["../../src/server/asset-base-url-transform-plugin.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAY,EACZ,eAAuB;IAEvB,MAAM,kBAAkB,GACtB,+FAA+F,CAAC;IAElG,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;QACnE,OAAO,GAAG,KAAK,GAAG,eAAe,GAAG,SAAS,GAAG,KAAK,EAAE,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAE3C;IACC,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAEpC,OAAO;QACL,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,KAAK;QACd,SAAS,CAAC,IAAI;YACZ,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,IAAI,CAAC;YACd,CAAC;YAED,MAAM,eAAe,GAAG,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;YAErE,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;gBAC7B,OAAO,IAAI,CAAC;YACd,CAAC;YAED,OAAO;gBACL,IAAI,EAAE,eAAe;gBACrB,GAAG,EAAE,IAAI;aACV,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { assetBaseUrlTransform } from "./asset-base-url-transform-plugin.js";
3
+ describe("assetBaseUrlTransform", () => {
4
+ const devServerOrigin = "http://localhost:3000";
5
+ it("should transform asset paths in single, double, and backtick quotes", () => {
6
+ const cases = [
7
+ {
8
+ desc: "single-quoted",
9
+ code: `const image = '/assets/logo.png';`,
10
+ expected: `const image = '${devServerOrigin}/assets/logo.png';`,
11
+ },
12
+ {
13
+ desc: "double-quoted",
14
+ code: `const image = "/assets/logo.png";`,
15
+ expected: `const image = "${devServerOrigin}/assets/logo.png";`,
16
+ },
17
+ {
18
+ desc: "backtick-quoted",
19
+ code: "const image = `/assets/logo.png`;",
20
+ expected: `const image = \`${devServerOrigin}/assets/logo.png\`;`,
21
+ },
22
+ ];
23
+ for (const { code, expected } of cases) {
24
+ const result = assetBaseUrlTransform(code, devServerOrigin);
25
+ expect(result).toBe(expected);
26
+ }
27
+ });
28
+ it("should transform multiple asset paths", () => {
29
+ const code = `
30
+ const logo = '/assets/logo.png';
31
+ const icon = '/assets/icon.svg';
32
+ const font = '/assets/font.woff2';
33
+ `;
34
+ const result = assetBaseUrlTransform(code, devServerOrigin);
35
+ expect(result).toContain(`${devServerOrigin}/assets/logo.png`);
36
+ expect(result).toContain(`${devServerOrigin}/assets/icon.svg`);
37
+ expect(result).toContain(`${devServerOrigin}/assets/font.woff2`);
38
+ });
39
+ it("should not transform already absolute URLs", () => {
40
+ const code = `
41
+ const local = '/assets/logo.png';
42
+ const http = 'http://example.com/image.png';
43
+ const https = 'https://example.com/image.png';
44
+ `;
45
+ const result = assetBaseUrlTransform(code, devServerOrigin);
46
+ expect(result).toContain(`${devServerOrigin}/assets/logo.png`);
47
+ expect(result).toContain("http://example.com/image.png");
48
+ expect(result).toContain("https://example.com/image.png");
49
+ });
50
+ it("should not transform code without asset paths", () => {
51
+ const code = `const text = "Hello World";`;
52
+ const result = assetBaseUrlTransform(code, devServerOrigin);
53
+ expect(result).toBe(code);
54
+ });
55
+ });
56
+ //# sourceMappingURL=asset-base-url-transform-plugin.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-base-url-transform-plugin.test.js","sourceRoot":"","sources":["../../src/server/asset-base-url-transform-plugin.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,MAAM,eAAe,GAAG,uBAAuB,CAAC;IAEhD,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,MAAM,KAAK,GAAG;YACZ;gBACE,IAAI,EAAE,eAAe;gBACrB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AAC,SAAS,CAAC,8BAA8B,CAAC,CAAC;QACzD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,IAAI,GAAG,6BAA6B,CAAC;QAC3C,MAAM,MAAM,GAAG,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAE5D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
- export { devtoolsStaticServer } from "./devtoolsStaticServer.js";
2
1
  export type { AnyToolRegistry, InferTools, ToolInput, ToolNames, ToolOutput, ToolResponseMetadata, } from "./inferUtilityTypes.js";
2
+ export { createMcpMiddleware } from "./mcpMiddleware.js";
3
3
  export type { McpServerTypes, ToolDef, WidgetHostType } from "./server.js";
4
4
  export { McpServer } from "./server.js";
5
5
  export { widgetsDevServer } from "./widgetsDevServer.js";
@@ -1,4 +1,4 @@
1
- export { devtoolsStaticServer } from "./devtoolsStaticServer.js";
1
+ export { createMcpMiddleware } from "./mcpMiddleware.js";
2
2
  export { McpServer } from "./server.js";
3
3
  export { widgetsDevServer } from "./widgetsDevServer.js";
4
4
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inferUtilityTypes.js","sourceRoot":"","sources":["../../src/server/inferUtilityTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { RequestHandler } from "express";
2
+ import type { McpServer } from "../server/server.js";
3
+ export declare function createMcpMiddleware(server: McpServer): RequestHandler;
@@ -0,0 +1,48 @@
1
+ import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
2
+ export function createMcpMiddleware(server) {
3
+ return async (req, res, next) => {
4
+ // Only handle requests to the /mcp path
5
+ if (req.path !== "/mcp") {
6
+ return next();
7
+ }
8
+ if (req.method === "POST") {
9
+ try {
10
+ const transport = new StreamableHTTPServerTransport({
11
+ sessionIdGenerator: undefined,
12
+ });
13
+ res.on("close", () => {
14
+ transport.close();
15
+ });
16
+ await server.connect(transport);
17
+ await transport.handleRequest(req, res, req.body);
18
+ }
19
+ catch (error) {
20
+ console.error("Error handling MCP request:", error);
21
+ if (!res.headersSent) {
22
+ res.status(500).json({
23
+ jsonrpc: "2.0",
24
+ error: {
25
+ code: -32603,
26
+ message: "Internal server error",
27
+ },
28
+ id: null,
29
+ });
30
+ }
31
+ }
32
+ }
33
+ else if (req.method === "GET" || req.method === "DELETE") {
34
+ res.writeHead(405).end(JSON.stringify({
35
+ jsonrpc: "2.0",
36
+ error: {
37
+ code: -32000,
38
+ message: "Method not allowed.",
39
+ },
40
+ id: null,
41
+ }));
42
+ }
43
+ else {
44
+ next();
45
+ }
46
+ };
47
+ }
48
+ //# sourceMappingURL=mcpMiddleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcpMiddleware.js","sourceRoot":"","sources":["../../src/server/mcpMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAInG,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACnD,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC9B,wCAAwC;QACxC,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACxB,OAAO,IAAI,EAAE,CAAC;QAChB,CAAC;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AC;AACJ,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { McpUiResourceMeta } from "@modelcontextprotocol/ext-apps";
1
2
  import { McpServer as McpServerBase, type RegisteredTool } from "@modelcontextprotocol/sdk/server/mcp.js";
2
3
  import type { AnySchema, SchemaOutput, ZodRawShapeCompat } from "@modelcontextprotocol/sdk/server/zod-compat.js";
3
4
  import type { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
@@ -7,8 +8,32 @@ export type ToolDef<TInput = unknown, TOutput = unknown, TResponseMetadata = unk
7
8
  output: TOutput;
8
9
  responseMetadata: TResponseMetadata;
9
10
  };
11
+ /**
12
+ * Extended MCP Apps CSP with upcoming fields from ext-apps PR #158
13
+ * and Skybridge-specific fields for OpenAI compatibility
14
+ * @see https://github.com/modelcontextprotocol/ext-apps/pull/158
15
+ */
16
+ type ExtendedMcpUiResourceCsp = McpUiResourceMeta["csp"] & {
17
+ /**
18
+ * Origins that can receive openExternal redirects without safe-link modal (OpenAI-specific)
19
+ * @see https://developers.openai.com/apps-sdk/reference#component-resource-_meta-fields
20
+ */
21
+ redirectDomains?: string[];
22
+ };
23
+ /** Extended MCP Apps resource metadata with upcoming CSP fields */
24
+ type ExtendedMcpUiResourceMeta = Omit<McpUiResourceMeta, "csp"> & {
25
+ csp?: ExtendedMcpUiResourceCsp;
26
+ };
27
+ /** User-provided resource configuration with optional CSP override */
28
+ export type WidgetResourceMeta = {
29
+ ui?: ExtendedMcpUiResourceMeta;
30
+ } & Resource["_meta"];
10
31
  export type WidgetHostType = "apps-sdk" | "mcp-app";
11
- type McpServerOriginalResourceConfig = Omit<Resource, "uri" | "name" | "mimeType">;
32
+ type McpServerOriginalResourceConfig = Omit<Resource, "uri" | "name" | "mimeType" | "_meta"> & {
33
+ _meta?: WidgetResourceMeta;
34
+ /** Restrict host types to a specific subset */
35
+ hosts?: WidgetHostType[];
36
+ };
12
37
  type McpServerOriginalToolConfig = Omit<Parameters<typeof McpServerBase.prototype.registerTool<ZodRawShapeCompat, ZodRawShapeCompat>>[1], "inputSchema" | "outputSchema">;
13
38
  type Simplify<T> = {
14
39
  [K in keyof T]: T[K];