skybridge 0.0.0-dev.f76ccdc → 0.0.0-dev.f792261

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 (419) hide show
  1. package/LICENSE +21 -674
  2. package/README.md +97 -142
  3. package/bin/run.js +5 -0
  4. package/dist/cli/detect-port.d.ts +18 -0
  5. package/dist/cli/detect-port.js +61 -0
  6. package/dist/cli/detect-port.js.map +1 -0
  7. package/dist/cli/header.d.ts +4 -0
  8. package/dist/cli/header.js +6 -0
  9. package/dist/cli/header.js.map +1 -0
  10. package/dist/cli/run-command.d.ts +2 -0
  11. package/dist/cli/run-command.js +43 -0
  12. package/dist/cli/run-command.js.map +1 -0
  13. package/dist/cli/telemetry.d.ts +7 -0
  14. package/dist/cli/telemetry.js +123 -0
  15. package/dist/cli/telemetry.js.map +1 -0
  16. package/dist/cli/tunnel-control-server.d.ts +9 -0
  17. package/dist/cli/tunnel-control-server.js +31 -0
  18. package/dist/cli/tunnel-control-server.js.map +1 -0
  19. package/dist/cli/tunnel-control-server.test.js +39 -0
  20. package/dist/cli/tunnel-control-server.test.js.map +1 -0
  21. package/dist/cli/tunnel-handler.d.ts +3 -0
  22. package/dist/cli/tunnel-handler.js +48 -0
  23. package/dist/cli/tunnel-handler.js.map +1 -0
  24. package/dist/cli/tunnel-handler.test.js +105 -0
  25. package/dist/cli/tunnel-handler.test.js.map +1 -0
  26. package/dist/cli/tunnel.d.ts +57 -0
  27. package/dist/cli/tunnel.js +154 -0
  28. package/dist/cli/tunnel.js.map +1 -0
  29. package/dist/cli/tunnel.test.js +190 -0
  30. package/dist/cli/tunnel.test.js.map +1 -0
  31. package/dist/cli/types.d.ts +5 -0
  32. package/dist/cli/types.js +2 -0
  33. package/dist/cli/types.js.map +1 -0
  34. package/dist/cli/use-execute-steps.d.ts +11 -0
  35. package/dist/cli/use-execute-steps.js +36 -0
  36. package/dist/cli/use-execute-steps.js.map +1 -0
  37. package/dist/cli/use-messages.d.ts +3 -0
  38. package/dist/cli/use-messages.js +11 -0
  39. package/dist/cli/use-messages.js.map +1 -0
  40. package/dist/cli/use-nodemon.d.ts +2 -0
  41. package/dist/cli/use-nodemon.js +73 -0
  42. package/dist/cli/use-nodemon.js.map +1 -0
  43. package/dist/cli/use-open-browser.d.ts +1 -0
  44. package/dist/cli/use-open-browser.js +44 -0
  45. package/dist/cli/use-open-browser.js.map +1 -0
  46. package/dist/cli/use-tunnel.d.ts +14 -0
  47. package/dist/cli/use-tunnel.js +131 -0
  48. package/dist/cli/use-tunnel.js.map +1 -0
  49. package/dist/cli/use-typescript-check.d.ts +9 -0
  50. package/dist/cli/use-typescript-check.js +94 -0
  51. package/dist/cli/use-typescript-check.js.map +1 -0
  52. package/dist/commands/build.d.ts +9 -0
  53. package/dist/commands/build.js +102 -0
  54. package/dist/commands/build.js.map +1 -0
  55. package/dist/commands/dev.d.ts +12 -0
  56. package/dist/commands/dev.js +80 -0
  57. package/dist/commands/dev.js.map +1 -0
  58. package/dist/commands/start.d.ts +9 -0
  59. package/dist/commands/start.js +49 -0
  60. package/dist/commands/start.js.map +1 -0
  61. package/dist/commands/telemetry/disable.d.ts +5 -0
  62. package/dist/commands/telemetry/disable.js +14 -0
  63. package/dist/commands/telemetry/disable.js.map +1 -0
  64. package/dist/commands/telemetry/enable.d.ts +5 -0
  65. package/dist/commands/telemetry/enable.js +14 -0
  66. package/dist/commands/telemetry/enable.js.map +1 -0
  67. package/dist/commands/telemetry/status.d.ts +5 -0
  68. package/dist/commands/telemetry/status.js +14 -0
  69. package/dist/commands/telemetry/status.js.map +1 -0
  70. package/dist/server/asset-base-url-transform-plugin.d.ts +10 -0
  71. package/dist/server/asset-base-url-transform-plugin.js +33 -0
  72. package/dist/server/asset-base-url-transform-plugin.js.map +1 -0
  73. package/dist/server/asset-base-url-transform-plugin.test.js +84 -0
  74. package/dist/server/asset-base-url-transform-plugin.test.js.map +1 -0
  75. package/dist/server/content-helpers.d.ts +27 -0
  76. package/dist/server/content-helpers.js +46 -0
  77. package/dist/server/content-helpers.js.map +1 -0
  78. package/dist/server/content-helpers.test.js +70 -0
  79. package/dist/server/content-helpers.test.js.map +1 -0
  80. package/dist/server/express.d.ts +11 -0
  81. package/dist/server/express.js +101 -0
  82. package/dist/server/express.js.map +1 -0
  83. package/dist/server/express.test.js +430 -0
  84. package/dist/server/express.test.js.map +1 -0
  85. package/dist/server/index.d.ts +6 -0
  86. package/dist/server/index.js +4 -0
  87. package/dist/server/index.js.map +1 -0
  88. package/dist/server/inferUtilityTypes.d.ts +64 -0
  89. package/dist/server/inferUtilityTypes.js +2 -0
  90. package/dist/server/inferUtilityTypes.js.map +1 -0
  91. package/dist/server/metric.d.ts +14 -0
  92. package/dist/server/metric.js +62 -0
  93. package/dist/server/metric.js.map +1 -0
  94. package/dist/server/middleware.d.ts +124 -0
  95. package/dist/server/middleware.js +93 -0
  96. package/dist/server/middleware.js.map +1 -0
  97. package/dist/server/middleware.test-d.js +75 -0
  98. package/dist/server/middleware.test-d.js.map +1 -0
  99. package/dist/server/middleware.test.js +493 -0
  100. package/dist/server/middleware.test.js.map +1 -0
  101. package/dist/server/server.d.ts +196 -0
  102. package/dist/server/server.js +468 -0
  103. package/dist/server/server.js.map +1 -0
  104. package/dist/{src/server → server}/templateHelper.d.ts +5 -4
  105. package/dist/server/templateHelper.js +11 -0
  106. package/dist/server/templateHelper.js.map +1 -0
  107. package/dist/server/templates.generated.d.ts +4 -0
  108. package/dist/server/templates.generated.js +47 -0
  109. package/dist/server/templates.generated.js.map +1 -0
  110. package/dist/server/tunnel-proxy-router.d.ts +7 -0
  111. package/dist/server/tunnel-proxy-router.js +110 -0
  112. package/dist/server/tunnel-proxy-router.js.map +1 -0
  113. package/dist/server/tunnel-proxy-router.test.js +229 -0
  114. package/dist/server/tunnel-proxy-router.test.js.map +1 -0
  115. package/dist/server/viewsDevServer.d.ts +14 -0
  116. package/dist/server/viewsDevServer.js +45 -0
  117. package/dist/server/viewsDevServer.js.map +1 -0
  118. package/dist/test/utils.d.ts +127 -0
  119. package/dist/test/utils.js +247 -0
  120. package/dist/test/utils.js.map +1 -0
  121. package/dist/test/view.test.js +523 -0
  122. package/dist/test/view.test.js.map +1 -0
  123. package/dist/version.d.ts +1 -0
  124. package/dist/version.js +3 -0
  125. package/dist/version.js.map +1 -0
  126. package/dist/web/bridges/apps-sdk/adaptor.d.ts +24 -0
  127. package/dist/web/bridges/apps-sdk/adaptor.js +96 -0
  128. package/dist/web/bridges/apps-sdk/adaptor.js.map +1 -0
  129. package/dist/web/bridges/apps-sdk/bridge.d.ts +10 -0
  130. package/dist/web/bridges/apps-sdk/bridge.js +46 -0
  131. package/dist/web/bridges/apps-sdk/bridge.js.map +1 -0
  132. package/dist/web/bridges/apps-sdk/index.d.ts +5 -0
  133. package/dist/web/bridges/apps-sdk/index.js +5 -0
  134. package/dist/web/bridges/apps-sdk/index.js.map +1 -0
  135. package/dist/web/bridges/apps-sdk/types.d.ts +131 -0
  136. package/dist/web/bridges/apps-sdk/types.js.map +1 -0
  137. package/dist/web/bridges/apps-sdk/use-apps-sdk-context.d.ts +2 -0
  138. package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js +7 -0
  139. package/dist/web/bridges/apps-sdk/use-apps-sdk-context.js.map +1 -0
  140. package/dist/web/bridges/get-adaptor.d.ts +2 -0
  141. package/dist/web/bridges/get-adaptor.js +8 -0
  142. package/dist/web/bridges/get-adaptor.js.map +1 -0
  143. package/dist/web/bridges/index.d.ts +5 -0
  144. package/dist/web/bridges/index.js +6 -0
  145. package/dist/web/bridges/index.js.map +1 -0
  146. package/dist/web/bridges/mcp-app/adaptor.d.ts +48 -0
  147. package/dist/web/bridges/mcp-app/adaptor.js +263 -0
  148. package/dist/web/bridges/mcp-app/adaptor.js.map +1 -0
  149. package/dist/web/bridges/mcp-app/bridge.d.ts +26 -0
  150. package/dist/web/bridges/mcp-app/bridge.js +102 -0
  151. package/dist/web/bridges/mcp-app/bridge.js.map +1 -0
  152. package/dist/web/bridges/mcp-app/index.d.ts +4 -0
  153. package/dist/web/bridges/mcp-app/index.js +4 -0
  154. package/dist/web/bridges/mcp-app/index.js.map +1 -0
  155. package/dist/web/bridges/mcp-app/types.d.ts +8 -0
  156. package/dist/web/bridges/mcp-app/types.js +2 -0
  157. package/dist/web/bridges/mcp-app/types.js.map +1 -0
  158. package/dist/web/bridges/mcp-app/use-mcp-app-context.d.ts +7 -0
  159. package/dist/web/bridges/mcp-app/use-mcp-app-context.js +7 -0
  160. package/dist/web/bridges/mcp-app/use-mcp-app-context.js.map +1 -0
  161. package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js +26 -0
  162. package/dist/web/bridges/mcp-app/use-mcp-app-context.test.js.map +1 -0
  163. package/dist/web/bridges/types.d.ts +111 -0
  164. package/dist/web/bridges/types.js +2 -0
  165. package/dist/web/bridges/types.js.map +1 -0
  166. package/dist/web/bridges/use-host-context.d.ts +2 -0
  167. package/dist/web/bridges/use-host-context.js +8 -0
  168. package/dist/web/bridges/use-host-context.js.map +1 -0
  169. package/dist/web/components/modal-provider.d.ts +4 -0
  170. package/dist/web/components/modal-provider.js +45 -0
  171. package/dist/web/components/modal-provider.js.map +1 -0
  172. package/dist/web/create-store.d.ts +3 -0
  173. package/dist/web/create-store.js +38 -0
  174. package/dist/web/create-store.js.map +1 -0
  175. package/dist/web/create-store.test.d.ts +1 -0
  176. package/dist/web/create-store.test.js +129 -0
  177. package/dist/web/create-store.test.js.map +1 -0
  178. package/dist/web/data-llm.d.ts +14 -0
  179. package/dist/web/data-llm.js +72 -0
  180. package/dist/web/data-llm.js.map +1 -0
  181. package/dist/web/data-llm.test.d.ts +1 -0
  182. package/dist/web/data-llm.test.js +142 -0
  183. package/dist/web/data-llm.test.js.map +1 -0
  184. package/dist/web/generate-helpers.d.ts +118 -0
  185. package/dist/web/generate-helpers.js +113 -0
  186. package/dist/web/generate-helpers.js.map +1 -0
  187. package/dist/web/generate-helpers.test-d.d.ts +1 -0
  188. package/dist/web/generate-helpers.test-d.js +209 -0
  189. package/dist/web/generate-helpers.test-d.js.map +1 -0
  190. package/dist/web/generate-helpers.test.d.ts +1 -0
  191. package/dist/web/generate-helpers.test.js +17 -0
  192. package/dist/web/generate-helpers.test.js.map +1 -0
  193. package/dist/web/helpers/state.d.ts +7 -0
  194. package/dist/web/helpers/state.js +45 -0
  195. package/dist/web/helpers/state.js.map +1 -0
  196. package/dist/web/helpers/state.test.d.ts +1 -0
  197. package/dist/web/helpers/state.test.js +53 -0
  198. package/dist/web/helpers/state.test.js.map +1 -0
  199. package/dist/web/hooks/index.d.ts +11 -0
  200. package/dist/web/hooks/index.js +12 -0
  201. package/dist/web/hooks/index.js.map +1 -0
  202. package/dist/web/hooks/test/utils.d.ts +16 -0
  203. package/dist/web/hooks/test/utils.js +64 -0
  204. package/dist/web/hooks/test/utils.js.map +1 -0
  205. package/dist/web/hooks/use-call-tool.d.ts +101 -0
  206. package/dist/web/hooks/use-call-tool.js +68 -0
  207. package/dist/web/hooks/use-call-tool.js.map +1 -0
  208. package/dist/web/hooks/use-call-tool.test-d.d.ts +1 -0
  209. package/dist/web/hooks/use-call-tool.test-d.js +104 -0
  210. package/dist/web/hooks/use-call-tool.test-d.js.map +1 -0
  211. package/dist/web/hooks/use-call-tool.test.d.ts +1 -0
  212. package/dist/web/hooks/use-call-tool.test.js +186 -0
  213. package/dist/web/hooks/use-call-tool.test.js.map +1 -0
  214. package/dist/web/hooks/use-display-mode.d.ts +4 -0
  215. package/dist/web/hooks/use-display-mode.js +9 -0
  216. package/dist/web/hooks/use-display-mode.js.map +1 -0
  217. package/dist/web/hooks/use-display-mode.test-d.d.ts +1 -0
  218. package/dist/web/hooks/use-display-mode.test-d.js +8 -0
  219. package/dist/web/hooks/use-display-mode.test-d.js.map +1 -0
  220. package/dist/web/hooks/use-display-mode.test.d.ts +1 -0
  221. package/dist/{src/web → web}/hooks/use-display-mode.test.js +3 -2
  222. package/dist/web/hooks/use-display-mode.test.js.map +1 -0
  223. package/dist/web/hooks/use-files.d.ts +7 -0
  224. package/dist/web/hooks/use-files.js +10 -0
  225. package/dist/web/hooks/use-files.js.map +1 -0
  226. package/dist/web/hooks/use-files.test.d.ts +1 -0
  227. package/dist/web/hooks/use-files.test.js +54 -0
  228. package/dist/web/hooks/use-files.test.js.map +1 -0
  229. package/dist/web/hooks/use-layout.d.ts +22 -0
  230. package/dist/web/hooks/use-layout.js +23 -0
  231. package/dist/web/hooks/use-layout.js.map +1 -0
  232. package/dist/web/hooks/use-layout.test.d.ts +1 -0
  233. package/dist/web/hooks/use-layout.test.js +96 -0
  234. package/dist/web/hooks/use-layout.test.js.map +1 -0
  235. package/dist/web/hooks/use-open-external.d.ts +3 -0
  236. package/dist/web/hooks/use-open-external.js +8 -0
  237. package/dist/web/hooks/use-open-external.js.map +1 -0
  238. package/dist/web/hooks/use-open-external.test.d.ts +1 -0
  239. package/dist/web/hooks/use-open-external.test.js +65 -0
  240. package/dist/web/hooks/use-open-external.test.js.map +1 -0
  241. package/dist/web/hooks/use-request-modal.d.ts +9 -0
  242. package/dist/web/hooks/use-request-modal.js +16 -0
  243. package/dist/web/hooks/use-request-modal.js.map +1 -0
  244. package/dist/web/hooks/use-request-modal.test.d.ts +1 -0
  245. package/dist/web/hooks/use-request-modal.test.js +61 -0
  246. package/dist/web/hooks/use-request-modal.test.js.map +1 -0
  247. package/dist/web/hooks/use-send-follow-up-message.d.ts +2 -0
  248. package/dist/web/hooks/use-send-follow-up-message.js +8 -0
  249. package/dist/web/hooks/use-send-follow-up-message.js.map +1 -0
  250. package/dist/web/hooks/use-set-open-in-app-url.d.ts +1 -0
  251. package/dist/web/hooks/use-set-open-in-app-url.js +8 -0
  252. package/dist/web/hooks/use-set-open-in-app-url.js.map +1 -0
  253. package/dist/web/hooks/use-set-open-in-app-url.test.d.ts +1 -0
  254. package/dist/web/hooks/use-set-open-in-app-url.test.js +43 -0
  255. package/dist/web/hooks/use-set-open-in-app-url.test.js.map +1 -0
  256. package/dist/web/hooks/use-tool-info.d.ts +36 -0
  257. package/dist/web/hooks/use-tool-info.js +26 -0
  258. package/dist/web/hooks/use-tool-info.js.map +1 -0
  259. package/dist/web/hooks/use-tool-info.test-d.d.ts +1 -0
  260. package/dist/web/hooks/use-tool-info.test-d.js +109 -0
  261. package/dist/web/hooks/use-tool-info.test-d.js.map +1 -0
  262. package/dist/web/hooks/use-tool-info.test.d.ts +1 -0
  263. package/dist/web/hooks/use-tool-info.test.js +130 -0
  264. package/dist/web/hooks/use-tool-info.test.js.map +1 -0
  265. package/dist/web/hooks/use-user.d.ts +18 -0
  266. package/dist/web/hooks/use-user.js +35 -0
  267. package/dist/web/hooks/use-user.js.map +1 -0
  268. package/dist/web/hooks/use-user.test.d.ts +1 -0
  269. package/dist/web/hooks/use-user.test.js +122 -0
  270. package/dist/web/hooks/use-user.test.js.map +1 -0
  271. package/dist/web/hooks/use-view-state.d.ts +4 -0
  272. package/dist/web/hooks/use-view-state.js +32 -0
  273. package/dist/web/hooks/use-view-state.js.map +1 -0
  274. package/dist/web/hooks/use-view-state.test.d.ts +1 -0
  275. package/dist/web/hooks/use-view-state.test.js +177 -0
  276. package/dist/web/hooks/use-view-state.test.js.map +1 -0
  277. package/dist/web/index.d.ts +7 -0
  278. package/dist/web/index.js +8 -0
  279. package/dist/web/index.js.map +1 -0
  280. package/dist/web/mount-view.d.ts +1 -0
  281. package/dist/web/mount-view.js +27 -0
  282. package/dist/web/mount-view.js.map +1 -0
  283. package/dist/web/plugin/data-llm.test.d.ts +1 -0
  284. package/dist/web/plugin/data-llm.test.js +81 -0
  285. package/dist/web/plugin/data-llm.test.js.map +1 -0
  286. package/dist/web/plugin/plugin.d.ts +5 -0
  287. package/dist/web/plugin/plugin.js +156 -0
  288. package/dist/web/plugin/plugin.js.map +1 -0
  289. package/dist/web/plugin/scan-views.d.ts +16 -0
  290. package/dist/web/plugin/scan-views.js +88 -0
  291. package/dist/web/plugin/scan-views.js.map +1 -0
  292. package/dist/web/plugin/scan-views.test.d.ts +1 -0
  293. package/dist/web/plugin/scan-views.test.js +99 -0
  294. package/dist/web/plugin/scan-views.test.js.map +1 -0
  295. package/dist/web/plugin/transform-data-llm.d.ts +12 -0
  296. package/dist/web/plugin/transform-data-llm.js +96 -0
  297. package/dist/web/plugin/transform-data-llm.js.map +1 -0
  298. package/dist/web/plugin/transform-data-llm.test.d.ts +1 -0
  299. package/dist/web/plugin/transform-data-llm.test.js +81 -0
  300. package/dist/web/plugin/transform-data-llm.test.js.map +1 -0
  301. package/dist/web/plugin/validate-view.d.ts +1 -0
  302. package/dist/web/plugin/validate-view.js +9 -0
  303. package/dist/web/plugin/validate-view.js.map +1 -0
  304. package/dist/web/plugin/validate-view.test.d.ts +1 -0
  305. package/dist/web/plugin/validate-view.test.js +24 -0
  306. package/dist/web/plugin/validate-view.test.js.map +1 -0
  307. package/dist/web/proxy.d.ts +1 -0
  308. package/dist/web/proxy.js +52 -0
  309. package/dist/web/proxy.js.map +1 -0
  310. package/dist/web/types.d.ts +16 -0
  311. package/dist/web/types.js +2 -0
  312. package/dist/web/types.js.map +1 -0
  313. package/package.json +82 -35
  314. package/tsconfig.base.json +33 -0
  315. package/dist/src/server/index.d.ts +0 -2
  316. package/dist/src/server/index.js +0 -3
  317. package/dist/src/server/index.js.map +0 -1
  318. package/dist/src/server/server.d.ts +0 -13
  319. package/dist/src/server/server.js +0 -54
  320. package/dist/src/server/server.js.map +0 -1
  321. package/dist/src/server/templateHelper.js +0 -29
  322. package/dist/src/server/templateHelper.js.map +0 -1
  323. package/dist/src/server/templates/development.hbs +0 -12
  324. package/dist/src/server/templates/production.hbs +0 -6
  325. package/dist/src/server/widgetsDevServer.d.ts +0 -12
  326. package/dist/src/server/widgetsDevServer.js +0 -39
  327. package/dist/src/server/widgetsDevServer.js.map +0 -1
  328. package/dist/src/test/setup.js +0 -9
  329. package/dist/src/test/setup.js.map +0 -1
  330. package/dist/src/test/utils.d.ts +0 -28
  331. package/dist/src/test/utils.js +0 -43
  332. package/dist/src/test/utils.js.map +0 -1
  333. package/dist/src/test/widget.test.js +0 -90
  334. package/dist/src/test/widget.test.js.map +0 -1
  335. package/dist/src/web/hooks/index.d.ts +0 -13
  336. package/dist/src/web/hooks/index.js +0 -14
  337. package/dist/src/web/hooks/index.js.map +0 -1
  338. package/dist/src/web/hooks/use-call-tool.d.ts +0 -54
  339. package/dist/src/web/hooks/use-call-tool.js +0 -44
  340. package/dist/src/web/hooks/use-call-tool.js.map +0 -1
  341. package/dist/src/web/hooks/use-call-tool.test.js +0 -66
  342. package/dist/src/web/hooks/use-call-tool.test.js.map +0 -1
  343. package/dist/src/web/hooks/use-display-mode.d.ts +0 -4
  344. package/dist/src/web/hooks/use-display-mode.js +0 -7
  345. package/dist/src/web/hooks/use-display-mode.js.map +0 -1
  346. package/dist/src/web/hooks/use-display-mode.test.js.map +0 -1
  347. package/dist/src/web/hooks/use-locale.d.ts +0 -1
  348. package/dist/src/web/hooks/use-locale.js +0 -5
  349. package/dist/src/web/hooks/use-locale.js.map +0 -1
  350. package/dist/src/web/hooks/use-locale.test.js +0 -21
  351. package/dist/src/web/hooks/use-locale.test.js.map +0 -1
  352. package/dist/src/web/hooks/use-open-external.d.ts +0 -1
  353. package/dist/src/web/hooks/use-open-external.js +0 -6
  354. package/dist/src/web/hooks/use-open-external.js.map +0 -1
  355. package/dist/src/web/hooks/use-open-external.test.js +0 -24
  356. package/dist/src/web/hooks/use-open-external.test.js.map +0 -1
  357. package/dist/src/web/hooks/use-openai-global.d.ts +0 -2
  358. package/dist/src/web/hooks/use-openai-global.js +0 -21
  359. package/dist/src/web/hooks/use-openai-global.js.map +0 -1
  360. package/dist/src/web/hooks/use-request-modal.d.ts +0 -5
  361. package/dist/src/web/hooks/use-request-modal.js +0 -9
  362. package/dist/src/web/hooks/use-request-modal.js.map +0 -1
  363. package/dist/src/web/hooks/use-request-modal.test.js +0 -24
  364. package/dist/src/web/hooks/use-request-modal.test.js.map +0 -1
  365. package/dist/src/web/hooks/use-send-follow-up-message.d.ts +0 -1
  366. package/dist/src/web/hooks/use-send-follow-up-message.js +0 -11
  367. package/dist/src/web/hooks/use-send-follow-up-message.js.map +0 -1
  368. package/dist/src/web/hooks/use-theme.d.ts +0 -1
  369. package/dist/src/web/hooks/use-theme.js +0 -5
  370. package/dist/src/web/hooks/use-theme.js.map +0 -1
  371. package/dist/src/web/hooks/use-theme.test.js +0 -26
  372. package/dist/src/web/hooks/use-theme.test.js.map +0 -1
  373. package/dist/src/web/hooks/use-tool-info.d.ts +0 -5
  374. package/dist/src/web/hooks/use-tool-info.js +0 -9
  375. package/dist/src/web/hooks/use-tool-info.js.map +0 -1
  376. package/dist/src/web/hooks/use-tool-info.test.js +0 -38
  377. package/dist/src/web/hooks/use-tool-info.test.js.map +0 -1
  378. package/dist/src/web/hooks/use-tool-output.d.ts +0 -4
  379. package/dist/src/web/hooks/use-tool-output.js +0 -9
  380. package/dist/src/web/hooks/use-tool-output.js.map +0 -1
  381. package/dist/src/web/hooks/use-tool-response-metadata.d.ts +0 -4
  382. package/dist/src/web/hooks/use-tool-response-metadata.js +0 -8
  383. package/dist/src/web/hooks/use-tool-response-metadata.js.map +0 -1
  384. package/dist/src/web/hooks/use-user-agent.d.ts +0 -1
  385. package/dist/src/web/hooks/use-user-agent.js +0 -5
  386. package/dist/src/web/hooks/use-user-agent.js.map +0 -1
  387. package/dist/src/web/hooks/use-user-agent.test.js +0 -31
  388. package/dist/src/web/hooks/use-user-agent.test.js.map +0 -1
  389. package/dist/src/web/hooks/use-widget-state.d.ts +0 -4
  390. package/dist/src/web/hooks/use-widget-state.js +0 -30
  391. package/dist/src/web/hooks/use-widget-state.js.map +0 -1
  392. package/dist/src/web/hooks/use-widget-state.test.js +0 -61
  393. package/dist/src/web/hooks/use-widget-state.test.js.map +0 -1
  394. package/dist/src/web/index.d.ts +0 -4
  395. package/dist/src/web/index.js +0 -5
  396. package/dist/src/web/index.js.map +0 -1
  397. package/dist/src/web/mount-widget.d.ts +0 -1
  398. package/dist/src/web/mount-widget.js +0 -14
  399. package/dist/src/web/mount-widget.js.map +0 -1
  400. package/dist/src/web/plugin.d.ts +0 -2
  401. package/dist/src/web/plugin.js +0 -28
  402. package/dist/src/web/plugin.js.map +0 -1
  403. package/dist/src/web/types.d.ts +0 -109
  404. package/dist/src/web/types.js.map +0 -1
  405. package/dist/vitest.config.d.ts +0 -2
  406. package/dist/vitest.config.js +0 -9
  407. package/dist/vitest.config.js.map +0 -1
  408. /package/dist/{src/test/setup.d.ts → cli/tunnel-control-server.test.d.ts} +0 -0
  409. /package/dist/{src/test/widget.test.d.ts → cli/tunnel-handler.test.d.ts} +0 -0
  410. /package/dist/{src/web/hooks/use-call-tool.test.d.ts → cli/tunnel.test.d.ts} +0 -0
  411. /package/dist/{src/web/hooks/use-display-mode.test.d.ts → server/asset-base-url-transform-plugin.test.d.ts} +0 -0
  412. /package/dist/{src/web/hooks/use-locale.test.d.ts → server/content-helpers.test.d.ts} +0 -0
  413. /package/dist/{src/web/hooks/use-open-external.test.d.ts → server/express.test.d.ts} +0 -0
  414. /package/dist/{src/web/hooks/use-request-modal.test.d.ts → server/middleware.test-d.d.ts} +0 -0
  415. /package/dist/{src/web/hooks/use-theme.test.d.ts → server/middleware.test.d.ts} +0 -0
  416. /package/dist/{src/web/hooks/use-tool-info.test.d.ts → server/tunnel-proxy-router.test.d.ts} +0 -0
  417. /package/dist/{src/web/hooks/use-user-agent.test.d.ts → test/view.test.d.ts} +0 -0
  418. /package/dist/{src/web → web/bridges/apps-sdk}/types.js +0 -0
  419. /package/dist/{src/web/hooks/use-widget-state.test.d.ts → web/bridges/mcp-app/use-mcp-app-context.test.d.ts} +0 -0
@@ -0,0 +1,9 @@
1
+ type TsError = {
2
+ file: string;
3
+ line: number;
4
+ col: number;
5
+ code: string;
6
+ message: string;
7
+ };
8
+ export declare function useTypeScriptCheck(): Array<TsError>;
9
+ export {};
@@ -0,0 +1,94 @@
1
+ import { spawn } from "node:child_process";
2
+ import { isAbsolute, relative } from "node:path";
3
+ import { useEffect, useRef, useState } from "react";
4
+ // TypeScript nests from general to specific — the deepest line is the root cause.
5
+ function extractBestMessage(message, continuationLines) {
6
+ if (!continuationLines.length) {
7
+ return message;
8
+ }
9
+ let maxIndent = 0;
10
+ for (const line of continuationLines) {
11
+ const indent = line.length - line.trimStart().length;
12
+ if (indent > maxIndent) {
13
+ maxIndent = indent;
14
+ }
15
+ }
16
+ const deepest = continuationLines
17
+ .filter((l) => l.length - l.trimStart().length === maxIndent)
18
+ .map((l) => l.trim())
19
+ .filter(Boolean)[0];
20
+ return deepest ?? message;
21
+ }
22
+ export function useTypeScriptCheck() {
23
+ const tsProcessRef = useRef(null);
24
+ const [tsErrors, setTsErrors] = useState([]);
25
+ useEffect(() => {
26
+ const tsProcess = spawn("npx", ["tsc", "--noEmit", "--watch", "--pretty", "false"], {
27
+ stdio: ["ignore", "pipe", "pipe"],
28
+ shell: true,
29
+ });
30
+ tsProcessRef.current = tsProcess;
31
+ let outputBuffer = "";
32
+ let currentErrors = [];
33
+ let pendingError = null;
34
+ let continuationLines = [];
35
+ const flushPending = () => {
36
+ if (!pendingError) {
37
+ return;
38
+ }
39
+ pendingError.message = extractBestMessage(pendingError.message, continuationLines);
40
+ currentErrors.push(pendingError);
41
+ pendingError = null;
42
+ continuationLines = [];
43
+ };
44
+ const processOutput = (data) => {
45
+ outputBuffer += data.toString();
46
+ const lines = outputBuffer.split("\n");
47
+ outputBuffer = lines.pop() || "";
48
+ for (const line of lines) {
49
+ const trimmed = line.trim();
50
+ const errorMatch = trimmed.match(/^(.+?)\((\d+),(\d+)\):\s+error\s+(TS\d+)?\s*:?\s*(.+)$/);
51
+ if (errorMatch) {
52
+ flushPending();
53
+ const [, file, lineStr, colStr, code, message] = errorMatch;
54
+ if (file && lineStr && colStr && message) {
55
+ let cleanFile = file.trim();
56
+ if (isAbsolute(cleanFile)) {
57
+ cleanFile = relative(process.cwd(), cleanFile);
58
+ }
59
+ pendingError = {
60
+ file: cleanFile,
61
+ line: Number.parseInt(lineStr, 10),
62
+ col: Number.parseInt(colStr, 10),
63
+ code: code ?? "",
64
+ message: message.trim(),
65
+ };
66
+ }
67
+ continue;
68
+ }
69
+ if (pendingError && line.startsWith(" ")) {
70
+ continuationLines.push(line);
71
+ continue;
72
+ }
73
+ if (trimmed.includes("Found") && trimmed.includes("error")) {
74
+ flushPending();
75
+ setTsErrors(trimmed.match(/Found 0 error/) ? [] : [...currentErrors]);
76
+ currentErrors = [];
77
+ }
78
+ }
79
+ };
80
+ if (tsProcess.stdout) {
81
+ tsProcess.stdout.on("data", processOutput);
82
+ }
83
+ if (tsProcess.stderr) {
84
+ tsProcess.stderr.on("data", processOutput);
85
+ }
86
+ return () => {
87
+ if (tsProcessRef.current) {
88
+ tsProcessRef.current.kill();
89
+ }
90
+ };
91
+ }, []);
92
+ return tsErrors;
93
+ }
94
+ //# sourceMappingURL=use-typescript-check.js.map
@@ -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;AAUpD,kFAAkF;AAClF,SAAS,kBAAkB,CACzB,OAAe,EACf,iBAAgC;IAEhC,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;QACrD,IAAI,MAAM,GAAG,SAAS,EAAE,CAAC;YACvB,SAAS,GAAG,MAAM,CAAC;Q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C,GAAG,CAAC,EAAE,CAAC;oBACzC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC7B,SAAS;gBACX,CAAC;gBAED,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC3D,YAAY,EAAE,CAAC;oBACf,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;oBACtE,aAAa,GAAG,EAAE,CAAC;gBACrB,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;gBACzB,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { spawn } from \"node:child_process\";\nimport { isAbsolute, relative } from \"node:path\";\nimport { useEffect, useRef, useState } from \"react\";\n\ntype TsError = {\n file: string;\n line: number;\n col: number;\n code: string;\n message: string;\n};\n\n// TypeScript nests from general to specific — the deepest line is the root cause.\nfunction extractBestMessage(\n message: string,\n continuationLines: Array<string>,\n): string {\n if (!continuationLines.length) {\n return message;\n }\n let maxIndent = 0;\n for (const line of continuationLines) {\n const indent = line.length - line.trimStart().length;\n if (indent > maxIndent) {\n maxIndent = indent;\n }\n }\n const deepest = continuationLines\n .filter((l) => l.length - l.trimStart().length === maxIndent)\n .map((l) => l.trim())\n .filter(Boolean)[0];\n return deepest ?? message;\n}\n\nexport function useTypeScriptCheck(): Array<TsError> {\n const tsProcessRef = useRef<ReturnType<typeof spawn> | null>(null);\n const [tsErrors, setTsErrors] = useState<Array<TsError>>([]);\n\n useEffect(() => {\n const tsProcess = spawn(\n \"npx\",\n [\"tsc\", \"--noEmit\", \"--watch\", \"--pretty\", \"false\"],\n {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n shell: true,\n },\n );\n\n tsProcessRef.current = tsProcess;\n\n let outputBuffer = \"\";\n let currentErrors: Array<TsError> = [];\n let pendingError: TsError | null = null;\n let continuationLines: Array<string> = [];\n\n const flushPending = () => {\n if (!pendingError) {\n return;\n }\n pendingError.message = extractBestMessage(\n pendingError.message,\n continuationLines,\n );\n currentErrors.push(pendingError);\n pendingError = null;\n continuationLines = [];\n };\n\n const processOutput = (data: Buffer) => {\n outputBuffer += data.toString();\n const lines = outputBuffer.split(\"\\n\");\n outputBuffer = lines.pop() || \"\";\n\n for (const line of lines) {\n const trimmed = line.trim();\n\n const errorMatch = trimmed.match(\n /^(.+?)\\((\\d+),(\\d+)\\):\\s+error\\s+(TS\\d+)?\\s*:?\\s*(.+)$/,\n );\n if (errorMatch) {\n flushPending();\n const [, file, lineStr, colStr, code, message] = errorMatch;\n if (file && lineStr && colStr && message) {\n let cleanFile = file.trim();\n if (isAbsolute(cleanFile)) {\n cleanFile = relative(process.cwd(), cleanFile);\n }\n pendingError = {\n file: cleanFile,\n line: Number.parseInt(lineStr, 10),\n col: Number.parseInt(colStr, 10),\n code: code ?? \"\",\n message: message.trim(),\n };\n }\n continue;\n }\n\n if (pendingError && line.startsWith(\" \")) {\n continuationLines.push(line);\n continue;\n }\n\n if (trimmed.includes(\"Found\") && trimmed.includes(\"error\")) {\n flushPending();\n setTsErrors(trimmed.match(/Found 0 error/) ? [] : [...currentErrors]);\n currentErrors = [];\n }\n }\n };\n\n if (tsProcess.stdout) {\n tsProcess.stdout.on(\"data\", processOutput);\n }\n if (tsProcess.stderr) {\n tsProcess.stderr.on(\"data\", processOutput);\n }\n\n return () => {\n if (tsProcessRef.current) {\n tsProcessRef.current.kill();\n }\n };\n }, []);\n\n return tsErrors;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { Command } from "@oclif/core";
2
+ import { 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,102 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { readFileSync, rmSync, writeFileSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { Command } from "@oclif/core";
5
+ import { Box, render, Text } from "ink";
6
+ import { useEffect } from "react";
7
+ import { Header } from "../cli/header.js";
8
+ import { useExecuteSteps } from "../cli/use-execute-steps.js";
9
+ import { scanAndWriteViewsDts } from "../web/plugin/scan-views.js";
10
+ async function resolveViewsDir(root) {
11
+ const { loadConfigFromFile } = await import("vite");
12
+ const loaded = await loadConfigFromFile({ command: "build", mode: "production" }, undefined, root);
13
+ const isPluginCandidate = (value) => typeof value === "object" && value !== null;
14
+ const plugins = [];
15
+ const walk = (value) => {
16
+ if (Array.isArray(value)) {
17
+ value.forEach(walk);
18
+ }
19
+ else if (isPluginCandidate(value)) {
20
+ plugins.push(value);
21
+ }
22
+ };
23
+ walk(loaded?.config.plugins ?? []);
24
+ return plugins.find((p) => p.name === "skybridge")?.api?.viewsDir;
25
+ }
26
+ export const commandSteps = [
27
+ {
28
+ label: "Scanning views",
29
+ run: async () => {
30
+ const root = process.cwd();
31
+ const viewsDir = await resolveViewsDir(root);
32
+ scanAndWriteViewsDts(root, viewsDir);
33
+ },
34
+ },
35
+ {
36
+ label: "Compiling server",
37
+ run: () => rmSync("dist", { recursive: true, force: true }),
38
+ command: "tsc -b --force",
39
+ },
40
+ {
41
+ label: "Building views",
42
+ command: "vite build",
43
+ },
44
+ {
45
+ label: "Emitting manifest module",
46
+ // Inline the Vite manifest as a JS module so the server can `import` it
47
+ // instead of `readFileSync(process.cwd() + ...)` at runtime — required for
48
+ // workerd, where neither cwd nor the assets directory is readable.
49
+ // The path mirrors `skybridge start`'s entry convention (dist/server.js)
50
+ // so the import in the user's entry resolves to a sibling file.
51
+ run: () => {
52
+ const root = process.cwd();
53
+ const manifest = readFileSync(path.join(root, "dist", "assets", ".vite", "manifest.json"), "utf-8");
54
+ writeFileSync(path.join(root, "dist", "vite-manifest.js"), `export default ${manifest};\n`);
55
+ },
56
+ },
57
+ {
58
+ label: "Emitting Cloudflare redirects",
59
+ // Cloudflare's `assets.directory` maps URL → file literally — no
60
+ // mount-strip like `app.use("/assets", express.static(...))`. Rewrite
61
+ // `/assets/assets/*` to `/assets/*` before lookup; status 200 =
62
+ // server-side rewrite, not HTTP redirect.
63
+ run: () => {
64
+ const root = process.cwd();
65
+ writeFileSync(path.join(root, "dist", "assets", "_redirects"), "/assets/assets/* /assets/:splat 200\n");
66
+ },
67
+ },
68
+ {
69
+ label: "Emitting Cloudflare headers",
70
+ // Cloudflare's static asset handler bypasses the worker entirely, so
71
+ // `app.use("/assets", cors())` never fires for asset requests. Attach
72
+ // CORS at the edge so cross-origin view iframes can load JS/CSS.
73
+ run: () => {
74
+ const root = process.cwd();
75
+ writeFileSync(path.join(root, "dist", "assets", "_headers"), "/assets/*\n Access-Control-Allow-Origin: *\n");
76
+ },
77
+ },
78
+ ];
79
+ export default class Build extends Command {
80
+ static description = "Build the views and MCP server";
81
+ static examples = ["skybridge build"];
82
+ static flags = {};
83
+ async run() {
84
+ const App = () => {
85
+ const { currentStep, status, error, execute } = useExecuteSteps(commandSteps);
86
+ useEffect(() => {
87
+ execute();
88
+ }, [execute]);
89
+ 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) => {
90
+ const isCurrent = index === currentStep && status === "running";
91
+ const isCompleted = index < currentStep || status === "success";
92
+ const isError = status === "error" && index === currentStep;
93
+ return (_jsx(Box, { marginBottom: 0, children: _jsxs(Text, { color: isError ? "red" : isCompleted ? "green" : "grey", children: [isError ? "✗" : isCompleted ? "✓" : isCurrent ? "⟳" : "○", " ", step.label] }) }, step.label));
94
+ }), 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))) })] }))] }));
95
+ };
96
+ render(_jsx(App, {}), {
97
+ exitOnCtrlC: true,
98
+ patchConsole: false,
99
+ });
100
+ }
101
+ }
102
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,KAAK,UAAU,eAAe,CAAC,IAAY;IACzC,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,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAC9D,IAAI,CAAC,KAAK,IACN,IAJC,IAAI,CAAC,KAAK,CAKd,CACP,CAAC;oBACJ,CAAC,CAAC,EAED,MAAM,KAAK,SAAS,IAAI,CACvB,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,2DAEjB,GACH,CACP,EAEA,MAAM,KAAK,OAAO,IAAI,KAAK,IAAI,CAC9B,MAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,aACvC,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,EAAC,IAAI,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","sourcesContent":["import { readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { Command } from \"@oclif/core\";\nimport { Box, render, Text } from \"ink\";\nimport { useEffect } from \"react\";\nimport { Header } from \"../cli/header.js\";\nimport { type CommandStep, useExecuteSteps } from \"../cli/use-execute-steps.js\";\nimport { scanAndWriteViewsDts } from \"../web/plugin/scan-views.js\";\n\nasync function resolveViewsDir(root: string): Promise<string | undefined> {\n const { loadConfigFromFile } = await import(\"vite\");\n const loaded = await loadConfigFromFile(\n { command: \"build\", mode: \"production\" },\n undefined,\n root,\n );\n\n const isPluginCandidate = (\n value: unknown,\n ): value is { name?: string; api?: { viewsDir?: string } } =>\n typeof value === \"object\" && value !== null;\n\n const plugins: Array<{ name?: string; api?: { viewsDir?: string } }> = [];\n const walk = (value: unknown) => {\n if (Array.isArray(value)) {\n value.forEach(walk);\n } else if (isPluginCandidate(value)) {\n plugins.push(value);\n }\n };\n walk(loaded?.config.plugins ?? []);\n return plugins.find((p) => p.name === \"skybridge\")?.api?.viewsDir;\n}\n\nexport const commandSteps: CommandStep[] = [\n {\n label: \"Scanning views\",\n run: async () => {\n const root = process.cwd();\n const viewsDir = await resolveViewsDir(root);\n scanAndWriteViewsDts(root, viewsDir);\n },\n },\n {\n label: \"Compiling server\",\n run: () => rmSync(\"dist\", { recursive: true, force: true }),\n command: \"tsc -b --force\",\n },\n {\n label: \"Building views\",\n command: \"vite build\",\n },\n {\n label: \"Emitting manifest module\",\n // Inline the Vite manifest as a JS module so the server can `import` it\n // instead of `readFileSync(process.cwd() + ...)` at runtime — required for\n // workerd, where neither cwd nor the assets directory is readable.\n // The path mirrors `skybridge start`'s entry convention (dist/server.js)\n // so the import in the user's entry resolves to a sibling file.\n run: () => {\n const root = process.cwd();\n const manifest = readFileSync(\n path.join(root, \"dist\", \"assets\", \".vite\", \"manifest.json\"),\n \"utf-8\",\n );\n writeFileSync(\n path.join(root, \"dist\", \"vite-manifest.js\"),\n `export default ${manifest};\\n`,\n );\n },\n },\n\n {\n label: \"Emitting Cloudflare redirects\",\n // Cloudflare's `assets.directory` maps URL → file literally — no\n // mount-strip like `app.use(\"/assets\", express.static(...))`. Rewrite\n // `/assets/assets/*` to `/assets/*` before lookup; status 200 =\n // server-side rewrite, not HTTP redirect.\n run: () => {\n const root = process.cwd();\n writeFileSync(\n path.join(root, \"dist\", \"assets\", \"_redirects\"),\n \"/assets/assets/* /assets/:splat 200\\n\",\n );\n },\n },\n {\n label: \"Emitting Cloudflare headers\",\n // Cloudflare's static asset handler bypasses the worker entirely, so\n // `app.use(\"/assets\", cors())` never fires for asset requests. Attach\n // CORS at the edge so cross-origin view iframes can load JS/CSS.\n run: () => {\n const root = process.cwd();\n writeFileSync(\n path.join(root, \"dist\", \"assets\", \"_headers\"),\n \"/assets/*\\n Access-Control-Allow-Origin: *\\n\",\n );\n },\n },\n];\n\nexport default class Build extends Command {\n static override description = \"Build the views and MCP server\";\n static override examples = [\"skybridge build\"];\n static override flags = {};\n\n public async run(): Promise<void> {\n const App = () => {\n const { currentStep, status, error, execute } =\n useExecuteSteps(commandSteps);\n\n useEffect(() => {\n execute();\n }, [execute]);\n\n return (\n <Box flexDirection=\"column\" padding={1}>\n <Header version={this.config.version}>\n <Text color=\"green\"> → building for production…</Text>\n </Header>\n\n {commandSteps.map((step, index) => {\n const isCurrent = index === currentStep && status === \"running\";\n const isCompleted = index < currentStep || status === \"success\";\n const isError = status === \"error\" && index === currentStep;\n\n return (\n <Box key={step.label} marginBottom={0}>\n <Text color={isError ? \"red\" : isCompleted ? \"green\" : \"grey\"}>\n {isError ? \"✗\" : isCompleted ? \"✓\" : isCurrent ? \"⟳\" : \"○\"}{\" \"}\n {step.label}\n </Text>\n </Box>\n );\n })}\n\n {status === \"success\" && (\n <Box marginTop={1}>\n <Text color=\"green\" bold>\n ✓ Build completed successfully!\n </Text>\n </Box>\n )}\n\n {status === \"error\" && error && (\n <Box marginTop={1} flexDirection=\"column\">\n <Text color=\"red\" bold>\n ✗ Build failed\n </Text>\n <Box marginTop={1} flexDirection=\"column\">\n {error.split(\"\\n\").map((line) => (\n <Text key={line} color=\"red\">\n {line}\n </Text>\n ))}\n </Box>\n </Box>\n )}\n </Box>\n );\n };\n\n render(<App />, {\n exitOnCtrlC: true,\n patchConsole: false,\n });\n }\n}\n"]}
@@ -0,0 +1,12 @@
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
+ port: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ tunnel: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ open: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,80 @@
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 { resolvePort } from "../cli/detect-port.js";
5
+ import { Header } from "../cli/header.js";
6
+ import { startTunnelControlServer } from "../cli/tunnel-control-server.js";
7
+ import { useMessages } from "../cli/use-messages.js";
8
+ import { useNodemon } from "../cli/use-nodemon.js";
9
+ import { useOpenBrowser } from "../cli/use-open-browser.js";
10
+ import { useTunnel } from "../cli/use-tunnel.js";
11
+ import { useTypeScriptCheck } from "../cli/use-typescript-check.js";
12
+ export default class Dev extends Command {
13
+ static description = "Start development server";
14
+ static examples = ["skybridge"];
15
+ static flags = {
16
+ port: Flags.integer({
17
+ char: "p",
18
+ description: "Port to run the server on",
19
+ min: 1,
20
+ }),
21
+ tunnel: Flags.boolean({
22
+ description: "Open an Alpic tunnel for remote testing",
23
+ default: false,
24
+ }),
25
+ open: Flags.boolean({
26
+ description: "Open DevTools in the browser when the server is ready",
27
+ default: process.env.SKYBRIDGE_OPEN !== "false",
28
+ allowNo: true,
29
+ }),
30
+ verbose: Flags.boolean({
31
+ char: "v",
32
+ description: "Show tunnel logs",
33
+ default: false,
34
+ }),
35
+ };
36
+ async run() {
37
+ const { flags } = await this.parse(Dev);
38
+ const { port, fallback, envWarning } = await resolvePort(flags.port);
39
+ if (envWarning) {
40
+ this.warn(envWarning);
41
+ }
42
+ const { port: controlPort, manager: tunnelManager, close: closeTunnelControl, } = await startTunnelControlServer(() => port);
43
+ const env = {
44
+ ...process.env,
45
+ __PORT: String(port),
46
+ __TUNNEL_CONTROL_PORT: String(controlPort),
47
+ };
48
+ const App = () => {
49
+ const tsErrors = useTypeScriptCheck();
50
+ const [messages, pushMessage] = useMessages();
51
+ useNodemon(env, pushMessage);
52
+ useOpenBrowser(port, flags.open);
53
+ const tunnelState = useTunnel(port, pushMessage, flags.verbose, flags.tunnel);
54
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, marginLeft: 1, children: [_jsx(Header, { version: this.config.version }), _jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDFE0", " "] }), fallback ? (_jsx(Text, { color: "yellow", children: "3000 in use, running on " })) : (_jsx(Text, { children: "Running on " })), _jsx(Text, { color: "green", children: `http://localhost:${port}/mcp` })] }), _jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsxs(Text, { color: "white", bold: true, children: ["Test locally with DevTools:", " "] }), _jsx(Text, { color: "green", children: `http://localhost:${port}/` })] }), tunnelState.status === "idle" && (_jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDF0D", " "] }), _jsx(Text, { children: "Get a public URL and LLM Playground access with " }), _jsx(Text, { color: "cyan", bold: true, children: "--tunnel" }), _jsx(Text, { children: "." })] })), tunnelState.status === "starting" && (_jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDF0D", " "] }), _jsx(Text, { color: "yellow", children: tunnelState.message })] })), tunnelState.status === "connected" && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDF0D", " "] }), _jsx(Text, { children: "Exposed on " }), _jsx(Text, { color: "green", children: `${tunnelState.url}/mcp` })] }), _jsxs(Box, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsxs(Text, { color: "white", bold: true, children: ["Test with an LLM on Playground:", " "] }), _jsx(Text, { color: "green", children: `${tunnelState.url}/try` })] })] })), tunnelState.status === "error" && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83C\uDF0D", " "] }), _jsxs(Text, { color: "red", children: ["Cannot open tunnel: ", tunnelState.message] })] }), _jsxs(Box, { children: [_jsxs(Text, { color: "#20a832", children: ["\u2192", " "] }), _jsx(Text, { color: "red", children: `Try manually: npx alpic tunnel --port ${port}` })] })] })), _jsxs(Box, { children: [_jsxs(Text, { children: ["\uD83D\uDEDF", " "] }), _jsx(Text, { children: "Need help? Reach us on " }), _jsx(Text, { color: "white", underline: true, children: "https://discord.alpic.ai" })] }), 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) => (_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.id)))] }))] }));
55
+ };
56
+ // Note: `exitOnCtrlC: false` because we own SIGINT below to guarantee
57
+ // alpic gets killed before we exit. If anything ever calls `useInput` or
58
+ // puts stdin into raw mode, also wire an explicit `\x03` keypress to the
59
+ // shutdown function — Ink will otherwise swallow Ctrl-C without ever
60
+ // delivering SIGINT.
61
+ const ink = render(_jsx(App, {}), { exitOnCtrlC: false, patchConsole: true });
62
+ // Synchronous-first shutdown: kill the alpic subprocess up front so we
63
+ // can't leave it orphaned even if another SIGINT listener (e.g. nodemon's)
64
+ // exits the process before our async cleanup completes.
65
+ const shutdown = (code) => () => {
66
+ tunnelManager.stop();
67
+ void closeTunnelControl()
68
+ .catch((err) => {
69
+ console.error("Failed to close tunnel control server", err);
70
+ })
71
+ .finally(() => {
72
+ ink.unmount();
73
+ process.exit(code);
74
+ });
75
+ };
76
+ process.once("SIGINT", shutdown(130));
77
+ process.once("SIGTERM", shutdown(143));
78
+ }
79
+ }
80
+ //# 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,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,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,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC;YAClB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,2B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,IAAI,IAAC,KAAK,EAAC,KAAK,YAAE,OAAO,CAAC,IAAI,GAAQ,CACxC,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,cAAE,OAAO,CAAC,IAAI,GAAQ,CAC5B,IAVO,OAAO,CAAC,EAAE,CAWd,CACP,CAAC,IACE,CACP,IACG,CACP,CAAC;QACJ,CAAC,CAAC;QAEF,sEAAsE;QACtE,yEAAyE;QACzE,yEAAyE;QACzE,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAC,GAAG,KAAG,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QAExE,uEAAuE;QACvE,2EAA2E;QAC3E,wDAAwD;QACxD,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,GAAG,EAAE;YACtC,aAAa,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,kBAAkB,EAAE;iBACtB,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,GAAG,CAAC,CAAC;YAC9D,CAAC,CAAC;iBACD,OAAO,CAAC,GAAG,EAAE;gBACZ,GAAG,CAAC,OAAO,EAAE,CAAC;gBACd,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC","sourcesContent":["import { Command, Flags } from \"@oclif/core\";\nimport { Box, render, Text } from \"ink\";\nimport { resolvePort } from \"../cli/detect-port.js\";\nimport { Header } from \"../cli/header.js\";\nimport { startTunnelControlServer } from \"../cli/tunnel-control-server.js\";\nimport { useMessages } from \"../cli/use-messages.js\";\nimport { useNodemon } from \"../cli/use-nodemon.js\";\nimport { useOpenBrowser } from \"../cli/use-open-browser.js\";\nimport { useTunnel } from \"../cli/use-tunnel.js\";\nimport { useTypeScriptCheck } from \"../cli/use-typescript-check.js\";\n\nexport default class Dev extends Command {\n static override description = \"Start development server\";\n static override examples = [\"skybridge\"];\n static override flags = {\n port: Flags.integer({\n char: \"p\",\n description: \"Port to run the server on\",\n min: 1,\n }),\n tunnel: Flags.boolean({\n description: \"Open an Alpic tunnel for remote testing\",\n default: false,\n }),\n open: Flags.boolean({\n description: \"Open DevTools in the browser when the server is ready\",\n default: process.env.SKYBRIDGE_OPEN !== \"false\",\n allowNo: true,\n }),\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Show tunnel logs\",\n default: false,\n }),\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(Dev);\n\n const { port, fallback, envWarning } = await resolvePort(flags.port);\n if (envWarning) {\n this.warn(envWarning);\n }\n\n const {\n port: controlPort,\n manager: tunnelManager,\n close: closeTunnelControl,\n } = await startTunnelControlServer(() => port);\n\n const env = {\n ...process.env,\n __PORT: String(port),\n __TUNNEL_CONTROL_PORT: String(controlPort),\n };\n\n const App = () => {\n const tsErrors = useTypeScriptCheck();\n const [messages, pushMessage] = useMessages();\n useNodemon(env, pushMessage);\n useOpenBrowser(port, flags.open);\n const tunnelState = useTunnel(\n port,\n pushMessage,\n flags.verbose,\n flags.tunnel,\n );\n\n return (\n <Box flexDirection=\"column\" padding={1} marginLeft={1}>\n <Header version={this.config.version} />\n\n <Box>\n <Text>🏠{\" \"}</Text>\n {fallback ? (\n <Text color=\"yellow\">3000 in use, running on </Text>\n ) : (\n <Text>Running on </Text>\n )}\n <Text color=\"green\">{`http://localhost:${port}/mcp`}</Text>\n </Box>\n <Box marginBottom={1}>\n <Text color=\"#20a832\">→{\" \"}</Text>\n <Text color=\"white\" bold>\n Test locally with DevTools:{\" \"}\n </Text>\n <Text color=\"green\">{`http://localhost:${port}/`}</Text>\n </Box>\n\n {tunnelState.status === \"idle\" && (\n <Box>\n <Text>🌍{\" \"}</Text>\n <Text>Get a public URL and LLM Playground access with </Text>\n <Text color=\"cyan\" bold>\n --tunnel\n </Text>\n <Text>.</Text>\n </Box>\n )}\n {tunnelState.status === \"starting\" && (\n <Box>\n <Text>🌍{\" \"}</Text>\n <Text color=\"yellow\">{tunnelState.message}</Text>\n </Box>\n )}\n {tunnelState.status === \"connected\" && (\n <Box flexDirection=\"column\" marginBottom={1}>\n <Box>\n <Text>🌍{\" \"}</Text>\n <Text>Exposed on </Text>\n <Text color=\"green\">{`${tunnelState.url}/mcp`}</Text>\n </Box>\n <Box>\n <Text color=\"#20a832\">→{\" \"}</Text>\n <Text color=\"white\" bold>\n Test with an LLM on Playground:{\" \"}\n </Text>\n <Text color=\"green\">{`${tunnelState.url}/try`}</Text>\n </Box>\n </Box>\n )}\n {tunnelState.status === \"error\" && (\n <Box flexDirection=\"column\" marginBottom={1}>\n <Box>\n <Text>🌍{\" \"}</Text>\n <Text color=\"red\">\n Cannot open tunnel: {tunnelState.message}\n </Text>\n </Box>\n <Box>\n <Text color=\"#20a832\">→{\" \"}</Text>\n <Text color=\"red\">{`Try manually: npx alpic tunnel --port ${port}`}</Text>\n </Box>\n </Box>\n )}\n\n <Box>\n <Text>🛟{\" \"}</Text>\n <Text>Need help? Reach us on </Text>\n <Text color=\"white\" underline>\n https://discord.alpic.ai\n </Text>\n </Box>\n\n {tsErrors.length > 0 && (\n <Box marginTop={1} flexDirection=\"column\">\n <Text color=\"red\" bold>\n ⚠️ TypeScript errors found:\n </Text>\n {tsErrors.map((error) => (\n <Box\n key={`${error.file}:${error.line}:${error.col}`}\n marginLeft={2}\n flexDirection=\"column\"\n >\n <Box>\n <Text color=\"white\">{error.file}</Text>\n <Text color=\"grey\">\n ({error.line},{error.col}):{\" \"}\n </Text>\n </Box>\n <Box marginLeft={2}>\n <Text color=\"red\">{error.message}</Text>\n </Box>\n </Box>\n ))}\n </Box>\n )}\n {messages.length > 0 && (\n <Box marginTop={1} flexDirection=\"column\">\n <Text color=\"white\" bold>\n Logs:\n </Text>\n {messages.map((message) => (\n <Box key={message.id} marginLeft={2}>\n {message.type === \"restart\" ? (\n <>\n <Text color=\"green\">✓{\" \"}</Text>\n <Text color=\"white\">{message.text}</Text>\n </>\n ) : message.type === \"error\" ? (\n <Text color=\"red\">{message.text}</Text>\n ) : (\n <Text>{message.text}</Text>\n )}\n </Box>\n ))}\n </Box>\n )}\n </Box>\n );\n };\n\n // Note: `exitOnCtrlC: false` because we own SIGINT below to guarantee\n // alpic gets killed before we exit. If anything ever calls `useInput` or\n // puts stdin into raw mode, also wire an explicit `\\x03` keypress to the\n // shutdown function — Ink will otherwise swallow Ctrl-C without ever\n // delivering SIGINT.\n const ink = render(<App />, { exitOnCtrlC: false, patchConsole: true });\n\n // Synchronous-first shutdown: kill the alpic subprocess up front so we\n // can't leave it orphaned even if another SIGINT listener (e.g. nodemon's)\n // exits the process before our async cleanup completes.\n const shutdown = (code: number) => () => {\n tunnelManager.stop();\n void closeTunnelControl()\n .catch((err) => {\n console.error(\"Failed to close tunnel control server\", err);\n })\n .finally(() => {\n ink.unmount();\n process.exit(code);\n });\n };\n process.once(\"SIGINT\", shutdown(130));\n process.once(\"SIGTERM\", shutdown(143));\n }\n}\n"]}
@@ -0,0 +1,9 @@
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
+ port: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,49 @@
1
+ import { existsSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { Command, Flags } from "@oclif/core";
4
+ import { resolvePort } from "../cli/detect-port.js";
5
+ import { runCommand } from "../cli/run-command.js";
6
+ export default class Start extends Command {
7
+ static description = "Start production server";
8
+ static examples = ["skybridge start"];
9
+ static flags = {
10
+ port: Flags.integer({
11
+ char: "p",
12
+ description: "Port to run the server on",
13
+ min: 1,
14
+ }),
15
+ };
16
+ async run() {
17
+ const { flags } = await this.parse(Start);
18
+ const { port, fallback, envWarning } = await resolvePort(flags.port);
19
+ if (envWarning) {
20
+ this.warn(envWarning);
21
+ }
22
+ console.clear();
23
+ const indexPath = resolve(process.cwd(), "dist/server.js");
24
+ if (!existsSync(indexPath)) {
25
+ console.error("❌ Error: No build output found");
26
+ console.error("");
27
+ console.error("Please build your project first:");
28
+ console.error(" skybridge build");
29
+ console.error("");
30
+ process.exit(1);
31
+ }
32
+ console.log(`\x1b[36m\x1b[1m⛰ Skybridge\x1b[0m \x1b[36mv${this.config.version}\x1b[0m`);
33
+ if (fallback) {
34
+ console.log(`\x1b[33m3000 in use, running on\x1b[0m \x1b[32mhttp://localhost:${port}/mcp\x1b[0m`);
35
+ }
36
+ else {
37
+ console.log(`Running on \x1b[32mhttp://localhost:${port}/mcp\x1b[0m`);
38
+ }
39
+ await runCommand(`node ${indexPath}`, {
40
+ stdio: ["ignore", "inherit", "inherit"],
41
+ env: {
42
+ ...process.env,
43
+ NODE_ENV: "production",
44
+ __PORT: String(port),
45
+ },
46
+ });
47
+ }
48
+ }
49
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,OAAO;IACxC,MAAM,CAAU,WAAW,GAAG,yBAAyB,CAAC;IACxD,MAAM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CAAC,uCAAuC,IAAI,aAAa,CAAC,CAAC;QACxE,CAAC;QAED,MAAM,UAAU,CAAC,QAAQ,SAAS,EAAE,EAAE;YACpC,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;YACvC,GAAG,EAAE;gBACH,GAAG,OAAO,CAAC,GAAG;gBACd,QAAQ,EAAE,YAAY;gBACtB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC;aACrB;SACF,CAAC,CAAC;IACL,CAAC","sourcesContent":["import { existsSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { Command, Flags } from \"@oclif/core\";\nimport { resolvePort } from \"../cli/detect-port.js\";\nimport { runCommand } from \"../cli/run-command.js\";\n\nexport default class Start extends Command {\n static override description = \"Start production server\";\n static override examples = [\"skybridge start\"];\n static override flags = {\n port: Flags.integer({\n char: \"p\",\n description: \"Port to run the server on\",\n min: 1,\n }),\n };\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(Start);\n const { port, fallback, envWarning } = await resolvePort(flags.port);\n if (envWarning) {\n this.warn(envWarning);\n }\n\n console.clear();\n\n const indexPath = resolve(process.cwd(), \"dist/server.js\");\n\n if (!existsSync(indexPath)) {\n console.error(\"❌ Error: No build output found\");\n console.error(\"\");\n console.error(\"Please build your project first:\");\n console.error(\" skybridge build\");\n console.error(\"\");\n process.exit(1);\n }\n\n console.log(\n `\\x1b[36m\\x1b[1m⛰ Skybridge\\x1b[0m \\x1b[36mv${this.config.version}\\x1b[0m`,\n );\n if (fallback) {\n console.log(\n `\\x1b[33m3000 in use, running on\\x1b[0m \\x1b[32mhttp://localhost:${port}/mcp\\x1b[0m`,\n );\n } else {\n console.log(`Running on \\x1b[32mhttp://localhost:${port}/mcp\\x1b[0m`);\n }\n\n await runCommand(`node ${indexPath}`, {\n stdio: [\"ignore\", \"inherit\", \"inherit\"],\n env: {\n ...process.env,\n NODE_ENV: \"production\",\n __PORT: String(port),\n },\n });\n }\n}\n"]}
@@ -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","sourcesContent":["import { Command } from \"@oclif/core\";\nimport { Box, render, Text } from \"ink\";\nimport { setEnabled } from \"../../cli/telemetry.js\";\n\nexport default class TelemetryDisable extends Command {\n static override description = \"Disable Skybridge telemetry on this machine\";\n\n public async run(): Promise<void> {\n await this.parse(TelemetryDisable);\n setEnabled(false);\n\n const App = () => (\n <Box flexDirection=\"column\" padding={1}>\n <Box>\n <Text color=\"yellow\">✓</Text>\n <Text> Telemetry has been </Text>\n <Text color=\"yellow\" bold>\n disabled\n </Text>\n </Box>\n <Box marginTop={1}>\n <Text color=\"gray\">Config saved to ~/.skybridge/config.json</Text>\n </Box>\n <Box marginTop={1}>\n <Text color=\"gray\">\n Skybridge never collects Personally Identifiable Information (PII).\n If you'd like to help us improve Skybridge by allowing anonymous CLI\n usage data, please reenable telemetry with: skybridge telemetry\n enable\n </Text>\n </Box>\n </Box>\n );\n\n render(<App />);\n }\n}\n"]}
@@ -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","sourcesContent":["import { Command } from \"@oclif/core\";\nimport { Box, render, Text } from \"ink\";\nimport { setEnabled } from \"../../cli/telemetry.js\";\n\nexport default class TelemetryEnable extends Command {\n static override description = \"Enable Skybridge telemetry on this machine\";\n\n public async run(): Promise<void> {\n await this.parse(TelemetryEnable);\n setEnabled(true);\n\n const App = () => (\n <Box flexDirection=\"column\" padding={1}>\n <Box>\n <Text color=\"green\">✓</Text>\n <Text> Telemetry has been </Text>\n <Text color=\"green\" bold>\n enabled\n </Text>\n </Box>\n <Box marginTop={1}>\n <Text color=\"gray\">Config saved to ~/.skybridge/config.json</Text>\n </Box>\n </Box>\n );\n\n render(<App />);\n }\n}\n"]}
@@ -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,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAClD,MAAM,CAAU,WAAW,GACzB,2DAA2D,CAAC;IAEvD,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;QAE5B,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,CAChB,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aACpC,KAAC,IAAI,IAAC,IAAI,QAAC,SAAS,0CAEb,EAEP,MAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,aACvC,MAAC,GAAG,eACF,KAAC,IAAI,2BAAgB,EACpB,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,8BAEjB,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,+BAElB,CACR,IACG,EAEN,MAAC,GAAG,IAAC,SAAS,EAAE,CAAC,aACf,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,6BAAoB,EACtC,KAAC,IAAI,cAAE,YAAY,EAAE,GAAQ,IACzB,IACF,EAEN,MAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,aACvC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,6DAAoD,EACtE,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,uDAA8C,EAChE,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,wDAA+C,IAC7D,IACF,CACP,CAAC;QAEF,MAAM,CAAC,KAAC,GAAG,KAAG,CAAC,CAAC;IAClB,CAAC","sourcesContent":["import { Command } from \"@oclif/core\";\nimport { Box, render, Text } from \"ink\";\nimport { getMachineId, isEnabled } from \"../../cli/telemetry.js\";\n\nexport default class TelemetryStatus extends Command {\n static override description =\n \"Get Skybridge current telemetry settings for this machine\";\n\n public async run(): Promise<void> {\n await this.parse(TelemetryStatus);\n const enabled = isEnabled();\n\n const App = () => (\n <Box flexDirection=\"column\" padding={1}>\n <Text bold underline>\n Skybridge Telemetry\n </Text>\n\n <Box marginTop={1} flexDirection=\"column\">\n <Box>\n <Text>Status: </Text>\n {enabled ? (\n <Text color=\"green\" bold>\n Enabled\n </Text>\n ) : (\n <Text color=\"yellow\" bold>\n Disabled\n </Text>\n )}\n </Box>\n\n <Box marginTop={1}>\n <Text color=\"gray\">Machine ID: </Text>\n <Text>{getMachineId()}</Text>\n </Box>\n </Box>\n\n <Box marginTop={1} flexDirection=\"column\">\n <Text color=\"gray\">To opt out, run: skybridge telemetry disable</Text>\n <Text color=\"gray\">Or set: SKYBRIDGE_TELEMETRY_DISABLED=1</Text>\n <Text color=\"gray\">Debug mode: SKYBRIDGE_TELEMETRY_DEBUG=1</Text>\n </Box>\n </Box>\n );\n\n render(<App />);\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { Plugin } from "vite";
2
+ /**
3
+ * Transforms asset import paths to resolve at runtime via `window.skybridge.serverUrl`,
4
+ * so they work both locally and behind tunnels.
5
+ */
6
+ export declare function assetBaseUrlTransform(code: string): string;
7
+ /**
8
+ * Vite plugin that transforms asset import paths to resolve at runtime via `window.skybridge.serverUrl`.
9
+ */
10
+ export declare function assetBaseUrlTransformPlugin(): Plugin;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Transforms asset import paths to resolve at runtime via `window.skybridge.serverUrl`,
3
+ * so they work both locally and behind tunnels.
4
+ */
5
+ export function assetBaseUrlTransform(code) {
6
+ const assetStringPattern = /(?<!\bfrom\s)(?<!https?:\/\/)(["'`])(\/[^"'`]+\.(svg|png|jpeg|jpg|gif|webp|mp3|mp4|woff|woff2|ttf|eot))\1/g;
7
+ code = code.replace(assetStringPattern, (_match, _quote, assetPath) => {
8
+ return `(window.skybridge?.serverUrl ?? "") + "${assetPath}"`;
9
+ });
10
+ return code;
11
+ }
12
+ /**
13
+ * Vite plugin that transforms asset import paths to resolve at runtime via `window.skybridge.serverUrl`.
14
+ */
15
+ export function assetBaseUrlTransformPlugin() {
16
+ return {
17
+ name: "asset-base-url-transform",
18
+ transform(code) {
19
+ if (!code) {
20
+ return null;
21
+ }
22
+ const transformedCode = assetBaseUrlTransform(code);
23
+ if (transformedCode === code) {
24
+ return null;
25
+ }
26
+ return {
27
+ code: transformedCode,
28
+ map: null,
29
+ };
30
+ },
31
+ };
32
+ }
33
+ //# 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;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,MAAM,kBAAkB,GACtB,4GAA4G,CAAC;IAE/G,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;QACpE,OAAO,0CAA0C,SAAS,GAAG,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,IAAI,EAAE,0BAA0B;QAChC,SAAS,CAAC,IAAI;YACZ,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,IAAI,CAAC;YACd,CAAC;YAED,MAAM,eAAe,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;YAEpD,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","sourcesContent":["import type { Plugin } from \"vite\";\n\n/**\n * Transforms asset import paths to resolve at runtime via `window.skybridge.serverUrl`,\n * so they work both locally and behind tunnels.\n */\nexport function assetBaseUrlTransform(code: string): string {\n const assetStringPattern =\n /(?<!\\bfrom\\s)(?<!https?:\\/\\/)([\"'`])(\\/[^\"'`]+\\.(svg|png|jpeg|jpg|gif|webp|mp3|mp4|woff|woff2|ttf|eot))\\1/g;\n\n code = code.replace(assetStringPattern, (_match, _quote, assetPath) => {\n return `(window.skybridge?.serverUrl ?? \"\") + \"${assetPath}\"`;\n });\n\n return code;\n}\n\n/**\n * Vite plugin that transforms asset import paths to resolve at runtime via `window.skybridge.serverUrl`.\n */\nexport function assetBaseUrlTransformPlugin(): Plugin {\n return {\n name: \"asset-base-url-transform\",\n transform(code) {\n if (!code) {\n return null;\n }\n\n const transformedCode = assetBaseUrlTransform(code);\n\n if (transformedCode === code) {\n return null;\n }\n\n return {\n code: transformedCode,\n map: null,\n };\n },\n };\n}\n"]}