@buoy-gg/core 7.0.40 → 7.0.42

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 (269) hide show
  1. package/README.md +14 -85
  2. package/bin/buoy.js +20 -347
  3. package/lib/commonjs/Buoy.js +1 -107
  4. package/lib/commonjs/browserRegister.js +1 -0
  5. package/lib/commonjs/browserRegister.server.js +1 -0
  6. package/lib/commonjs/earlyHookScript.js +1 -0
  7. package/lib/commonjs/earlyNetwork.js +1 -0
  8. package/lib/commonjs/floatingMenu/AppHost.js +1 -460
  9. package/lib/commonjs/floatingMenu/AppHost.web.js +1 -364
  10. package/lib/commonjs/floatingMenu/AppHostLogic.js +1 -50
  11. package/lib/commonjs/floatingMenu/AppIcon.js +1 -91
  12. package/lib/commonjs/floatingMenu/AppIcon.web.js +1 -53
  13. package/lib/commonjs/floatingMenu/BrowserToolRuntime.js +1 -0
  14. package/lib/commonjs/floatingMenu/DefaultConfigContext.js +1 -45
  15. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +1 -1119
  16. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -0
  17. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +1 -1048
  18. package/lib/commonjs/floatingMenu/DevToolsVisibilityContext.js +1 -49
  19. package/lib/commonjs/floatingMenu/FloatingDevTools.js +1 -554
  20. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -401
  21. package/lib/commonjs/floatingMenu/FloatingMenu.js +1 -371
  22. package/lib/commonjs/floatingMenu/MinimizedToolsContext.js +1 -274
  23. package/lib/commonjs/floatingMenu/MinimizedToolsStack.js +1 -288
  24. package/lib/commonjs/floatingMenu/MinimizedToolsStack.web.js +1 -371
  25. package/lib/commonjs/floatingMenu/ToggleStateManager.js +1 -36
  26. package/lib/commonjs/floatingMenu/ToolHost.js +1 -281
  27. package/lib/commonjs/floatingMenu/ToolOpenerBridge.js +1 -41
  28. package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +1 -461
  29. package/lib/commonjs/floatingMenu/autoExternalSync.js +1 -434
  30. package/lib/commonjs/floatingMenu/defaultConfig.js +1 -167
  31. package/lib/commonjs/floatingMenu/deviceIdentity.js +1 -173
  32. package/lib/commonjs/floatingMenu/dial/DialDevTools.js +1 -904
  33. package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +1 -821
  34. package/lib/commonjs/floatingMenu/dial/DialHyperspace.js +1 -177
  35. package/lib/commonjs/floatingMenu/dial/DialIcon.js +1 -302
  36. package/lib/commonjs/floatingMenu/dial/DialPagination.js +1 -165
  37. package/lib/commonjs/floatingMenu/dial/DialSnow.js +1 -92
  38. package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.js +1 -246
  39. package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.web.js +2 -147
  40. package/lib/commonjs/floatingMenu/dial/dialUsageStore.js +1 -93
  41. package/lib/commonjs/floatingMenu/dial/onboardingConstants.js +1 -42
  42. package/lib/commonjs/floatingMenu/dial/onboardingConstants.web.js +1 -42
  43. package/lib/commonjs/floatingMenu/externalSyncGate.js +1 -49
  44. package/lib/commonjs/floatingMenu/floatingTools.js +1 -42
  45. package/lib/commonjs/floatingMenu/floatingTools.web.js +1 -30
  46. package/lib/commonjs/floatingMenu/optionalRequire.js +1 -37
  47. package/lib/commonjs/floatingMenu/settingsBus.js +1 -23
  48. package/lib/commonjs/floatingMenu/sync/appSyncAdapter.js +1 -115
  49. package/lib/commonjs/floatingMenu/types.js +1 -5
  50. package/lib/commonjs/floatingMenu/useDesktopSyncStatus.js +1 -28
  51. package/lib/commonjs/floatingMenu/useDesktopSyncStatus.web.js +1 -0
  52. package/lib/commonjs/index.js +1 -291
  53. package/lib/commonjs/index.web.js +1 -150
  54. package/lib/commonjs/reactDevtoolsTypes.js +1 -0
  55. package/lib/commonjs/releaseOptIn.js +1 -0
  56. package/lib/commonjs/telemetry/installPing.js +1 -131
  57. package/lib/commonjs/toolkit.js +1 -584
  58. package/lib/commonjs/toolkitComponents.js +1 -241
  59. package/lib/commonjs/utils/autoDiscoverPresets.web.js +1 -219
  60. package/lib/commonjs/utils/createWebTool.js +1 -0
  61. package/lib/commonjs/utils/createWebTools.js +1 -0
  62. package/lib/commonjs/version.js +1 -18
  63. package/lib/module/Buoy.js +1 -102
  64. package/lib/module/browserRegister.js +1 -0
  65. package/lib/module/browserRegister.server.js +1 -0
  66. package/lib/module/earlyHookScript.js +1 -0
  67. package/lib/module/earlyNetwork.js +1 -0
  68. package/lib/module/floatingMenu/AppHost.js +1 -452
  69. package/lib/module/floatingMenu/AppHost.web.js +1 -356
  70. package/lib/module/floatingMenu/AppHostLogic.js +1 -45
  71. package/lib/module/floatingMenu/AppIcon.js +1 -84
  72. package/lib/module/floatingMenu/AppIcon.web.js +1 -47
  73. package/lib/module/floatingMenu/BrowserToolRuntime.js +1 -0
  74. package/lib/module/floatingMenu/DefaultConfigContext.js +1 -39
  75. package/lib/module/floatingMenu/DevToolsSettingsModal.js +1 -1115
  76. package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -0
  77. package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +1 -1055
  78. package/lib/module/floatingMenu/DevToolsVisibilityContext.js +1 -44
  79. package/lib/module/floatingMenu/FloatingDevTools.js +1 -551
  80. package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -399
  81. package/lib/module/floatingMenu/FloatingMenu.js +1 -366
  82. package/lib/module/floatingMenu/MinimizedToolsContext.js +1 -266
  83. package/lib/module/floatingMenu/MinimizedToolsStack.js +1 -285
  84. package/lib/module/floatingMenu/MinimizedToolsStack.web.js +1 -368
  85. package/lib/module/floatingMenu/ToggleStateManager.js +1 -32
  86. package/lib/module/floatingMenu/ToolHost.js +1 -273
  87. package/lib/module/floatingMenu/ToolOpenerBridge.js +1 -37
  88. package/lib/module/floatingMenu/autoDiscoverPresets.js +1 -457
  89. package/lib/module/floatingMenu/autoExternalSync.js +1 -427
  90. package/lib/module/floatingMenu/defaultConfig.js +1 -158
  91. package/lib/module/floatingMenu/deviceIdentity.js +1 -163
  92. package/lib/module/floatingMenu/dial/DialDevTools.js +1 -900
  93. package/lib/module/floatingMenu/dial/DialDevTools.web.js +1 -818
  94. package/lib/module/floatingMenu/dial/DialHyperspace.js +1 -173
  95. package/lib/module/floatingMenu/dial/DialIcon.js +1 -299
  96. package/lib/module/floatingMenu/dial/DialPagination.js +1 -160
  97. package/lib/module/floatingMenu/dial/DialSnow.js +1 -90
  98. package/lib/module/floatingMenu/dial/OnboardingTooltip.js +1 -240
  99. package/lib/module/floatingMenu/dial/OnboardingTooltip.web.js +2 -142
  100. package/lib/module/floatingMenu/dial/dialUsageStore.js +1 -85
  101. package/lib/module/floatingMenu/dial/onboardingConstants.js +1 -3
  102. package/lib/module/floatingMenu/dial/onboardingConstants.web.js +1 -3
  103. package/lib/module/floatingMenu/externalSyncGate.js +1 -44
  104. package/lib/module/floatingMenu/floatingTools.js +1 -27
  105. package/lib/module/floatingMenu/floatingTools.web.js +1 -3
  106. package/lib/module/floatingMenu/optionalRequire.js +1 -33
  107. package/lib/module/floatingMenu/settingsBus.js +1 -19
  108. package/lib/module/floatingMenu/sync/appSyncAdapter.js +1 -112
  109. package/lib/module/floatingMenu/types.js +1 -3
  110. package/lib/module/floatingMenu/useDesktopSyncStatus.js +1 -25
  111. package/lib/module/floatingMenu/useDesktopSyncStatus.web.js +1 -0
  112. package/lib/module/index.js +1 -41
  113. package/lib/module/index.web.js +1 -29
  114. package/lib/module/reactDevtoolsTypes.js +1 -0
  115. package/lib/module/releaseOptIn.js +1 -0
  116. package/lib/module/telemetry/installPing.js +1 -127
  117. package/lib/module/toolkit.js +1 -62
  118. package/lib/module/toolkitComponents.js +1 -230
  119. package/lib/module/utils/autoDiscoverPresets.web.js +1 -213
  120. package/lib/module/utils/createWebTool.js +1 -0
  121. package/lib/module/utils/createWebTools.js +1 -0
  122. package/lib/module/version.js +1 -14
  123. package/lib/typescript/commonjs/browserRegister.d.ts +13 -0
  124. package/lib/typescript/commonjs/browserRegister.server.d.ts +6 -0
  125. package/lib/typescript/commonjs/earlyHookScript.d.ts +12 -0
  126. package/lib/typescript/commonjs/earlyNetwork.d.ts +52 -0
  127. package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts +3 -3
  128. package/lib/typescript/commonjs/floatingMenu/BrowserToolRuntime.d.ts +14 -0
  129. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
  130. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
  131. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
  132. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +12 -6
  133. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +1 -1
  134. package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts +1 -9
  135. package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
  136. package/lib/typescript/commonjs/index.web.d.ts +7 -0
  137. package/lib/typescript/commonjs/reactDevtoolsTypes.d.ts +8 -0
  138. package/lib/typescript/commonjs/releaseOptIn.d.ts +4 -0
  139. package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts +3 -40
  140. package/lib/typescript/commonjs/utils/createWebTool.d.ts +6 -0
  141. package/lib/typescript/commonjs/utils/createWebTools.d.ts +4 -0
  142. package/lib/typescript/commonjs/version.d.ts +1 -1
  143. package/lib/typescript/module/browserRegister.d.ts +13 -0
  144. package/lib/typescript/module/browserRegister.server.d.ts +6 -0
  145. package/lib/typescript/module/earlyHookScript.d.ts +12 -0
  146. package/lib/typescript/module/earlyNetwork.d.ts +52 -0
  147. package/lib/typescript/module/floatingMenu/AppHost.web.d.ts +3 -3
  148. package/lib/typescript/module/floatingMenu/BrowserToolRuntime.d.ts +14 -0
  149. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
  150. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
  151. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
  152. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +12 -6
  153. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +1 -1
  154. package/lib/typescript/module/floatingMenu/settingsBus.d.ts +1 -9
  155. package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
  156. package/lib/typescript/module/index.web.d.ts +7 -0
  157. package/lib/typescript/module/reactDevtoolsTypes.d.ts +8 -0
  158. package/lib/typescript/module/releaseOptIn.d.ts +4 -0
  159. package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts +3 -40
  160. package/lib/typescript/module/utils/createWebTool.d.ts +6 -0
  161. package/lib/typescript/module/utils/createWebTools.d.ts +4 -0
  162. package/lib/typescript/module/version.d.ts +1 -1
  163. package/lib/web/chunks/chunk-5SGL6QL4.mjs +1 -0
  164. package/lib/web/chunks/chunk-FROELTJH.mjs +1 -0
  165. package/lib/web/chunks/chunk-QZDVCMCT.mjs +1 -0
  166. package/lib/web/chunks/chunk-R7RGRTY5.mjs +1 -0
  167. package/lib/web/index.mjs +10 -0
  168. package/lib/web/register-server.mjs +1 -0
  169. package/lib/web/register.mjs +1 -0
  170. package/lib/web/toolkit.mjs +1 -0
  171. package/package.json +50 -12
  172. package/lib/typescript/commonjs/Buoy.d.ts.map +0 -1
  173. package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts.map +0 -1
  174. package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts.map +0 -1
  175. package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts.map +0 -1
  176. package/lib/typescript/commonjs/floatingMenu/AppIcon.d.ts.map +0 -1
  177. package/lib/typescript/commonjs/floatingMenu/AppIcon.web.d.ts.map +0 -1
  178. package/lib/typescript/commonjs/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
  179. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
  180. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
  181. package/lib/typescript/commonjs/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
  182. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +0 -1
  183. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
  184. package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +0 -1
  185. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
  186. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
  187. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
  188. package/lib/typescript/commonjs/floatingMenu/ToggleStateManager.d.ts.map +0 -1
  189. package/lib/typescript/commonjs/floatingMenu/ToolHost.d.ts.map +0 -1
  190. package/lib/typescript/commonjs/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
  191. package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
  192. package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts.map +0 -1
  193. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +0 -1
  194. package/lib/typescript/commonjs/floatingMenu/deviceIdentity.d.ts.map +0 -1
  195. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
  196. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
  197. package/lib/typescript/commonjs/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
  198. package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts.map +0 -1
  199. package/lib/typescript/commonjs/floatingMenu/dial/DialPagination.d.ts.map +0 -1
  200. package/lib/typescript/commonjs/floatingMenu/dial/DialSnow.d.ts.map +0 -1
  201. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
  202. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
  203. package/lib/typescript/commonjs/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
  204. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
  205. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
  206. package/lib/typescript/commonjs/floatingMenu/externalSyncGate.d.ts.map +0 -1
  207. package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts.map +0 -1
  208. package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts.map +0 -1
  209. package/lib/typescript/commonjs/floatingMenu/optionalRequire.d.ts.map +0 -1
  210. package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts.map +0 -1
  211. package/lib/typescript/commonjs/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
  212. package/lib/typescript/commonjs/floatingMenu/types.d.ts.map +0 -1
  213. package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
  214. package/lib/typescript/commonjs/index.d.ts.map +0 -1
  215. package/lib/typescript/commonjs/index.web.d.ts.map +0 -1
  216. package/lib/typescript/commonjs/telemetry/installPing.d.ts.map +0 -1
  217. package/lib/typescript/commonjs/toolkit.d.ts.map +0 -1
  218. package/lib/typescript/commonjs/toolkitComponents.d.ts.map +0 -1
  219. package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts.map +0 -1
  220. package/lib/typescript/commonjs/version.d.ts.map +0 -1
  221. package/lib/typescript/module/Buoy.d.ts.map +0 -1
  222. package/lib/typescript/module/floatingMenu/AppHost.d.ts.map +0 -1
  223. package/lib/typescript/module/floatingMenu/AppHost.web.d.ts.map +0 -1
  224. package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts.map +0 -1
  225. package/lib/typescript/module/floatingMenu/AppIcon.d.ts.map +0 -1
  226. package/lib/typescript/module/floatingMenu/AppIcon.web.d.ts.map +0 -1
  227. package/lib/typescript/module/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
  228. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
  229. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
  230. package/lib/typescript/module/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
  231. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +0 -1
  232. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
  233. package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +0 -1
  234. package/lib/typescript/module/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
  235. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
  236. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
  237. package/lib/typescript/module/floatingMenu/ToggleStateManager.d.ts.map +0 -1
  238. package/lib/typescript/module/floatingMenu/ToolHost.d.ts.map +0 -1
  239. package/lib/typescript/module/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
  240. package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
  241. package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts.map +0 -1
  242. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +0 -1
  243. package/lib/typescript/module/floatingMenu/deviceIdentity.d.ts.map +0 -1
  244. package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
  245. package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
  246. package/lib/typescript/module/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
  247. package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts.map +0 -1
  248. package/lib/typescript/module/floatingMenu/dial/DialPagination.d.ts.map +0 -1
  249. package/lib/typescript/module/floatingMenu/dial/DialSnow.d.ts.map +0 -1
  250. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
  251. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
  252. package/lib/typescript/module/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
  253. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
  254. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
  255. package/lib/typescript/module/floatingMenu/externalSyncGate.d.ts.map +0 -1
  256. package/lib/typescript/module/floatingMenu/floatingTools.d.ts.map +0 -1
  257. package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts.map +0 -1
  258. package/lib/typescript/module/floatingMenu/optionalRequire.d.ts.map +0 -1
  259. package/lib/typescript/module/floatingMenu/settingsBus.d.ts.map +0 -1
  260. package/lib/typescript/module/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
  261. package/lib/typescript/module/floatingMenu/types.d.ts.map +0 -1
  262. package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
  263. package/lib/typescript/module/index.d.ts.map +0 -1
  264. package/lib/typescript/module/index.web.d.ts.map +0 -1
  265. package/lib/typescript/module/telemetry/installPing.d.ts.map +0 -1
  266. package/lib/typescript/module/toolkit.d.ts.map +0 -1
  267. package/lib/typescript/module/toolkitComponents.d.ts.map +0 -1
  268. package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts.map +0 -1
  269. package/lib/typescript/module/version.d.ts.map +0 -1
@@ -1,434 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.AutoExternalSync = AutoExternalSync;
7
- exports.ToolRegistryPublisher = ToolRegistryPublisher;
8
- exports.isExternalSyncAvailable = isExternalSyncAvailable;
9
- exports.useToolAdapterMap = useToolAdapterMap;
10
- var _react = require("react");
11
- var _reactNative = require("react-native");
12
- var _license = require("@buoy-gg/license");
13
- var _optionalRequire = require("./optionalRequire.js");
14
- var _appSyncAdapter = require("./sync/appSyncAdapter.js");
15
- var _deviceIdentity = require("./deviceIdentity.js");
16
- var _sharedUi = require("@buoy-gg/shared-ui");
17
- /**
18
- * Zero-config device→desktop sync for FloatingDevTools.
19
- *
20
- * When @buoy-gg/external-sync is installed, FloatingDevTools renders
21
- * <AutoExternalSync /> in dev builds (and in release builds that opted in via
22
- * externalSync.enableInRelease — see externalSyncGate.ts): it connects to the
23
- * Buoy Desktop broker (port 42831 on the Metro host, so physical devices reach
24
- * the dev machine automatically — a background retry when the desktop app
25
- * isn't running) and registers a sync adapter for every installed tool
26
- * package, discovered with the same guarded-require pattern as
27
- * autoDiscoverPresets. No <DevToolsSync> wiring needed in the app.
28
- *
29
- * Identity defaults come from deviceIdentity.ts: the app name (expo-constants)
30
- * plus a persisted per-install tail, so two devices on one build register as
31
- * two devices — "MyApp (iPhone 17 Pro · 2c1d)" / "myapp-ios-3f9a2c1d".
32
- * Overridable via the `externalSync` prop.
33
- */
34
-
35
- /* eslint-disable @typescript-eslint/no-var-requires */
36
-
37
- // Module-level guarded requires: presence is constant for the app lifetime,
38
- // so hooks pulled from these modules keep a stable call order.
39
- //
40
- // IMPORTANT: each require() must sit LEXICALLY inside its own try block
41
- // (same pattern as autoDiscoverPresets) — Metro only marks a dependency as
42
- // optional when the require is directly inside a try statement. Wrapping it
43
- // in a helper/arrow makes Metro hard-fail the bundle for apps that don't
44
- // install that package.
45
- let externalSyncModule = null;
46
- let storageModule = null;
47
- let networkModule = null;
48
- let reactQueryModule = null;
49
- let routeEventsModule = null;
50
- let reduxModule = null;
51
- let zustandModule = null;
52
- let jotaiModule = null;
53
- let eventsModule = null;
54
- let consoleModule = null;
55
- let sentryModule = null;
56
- let envModule = null;
57
- let highlightUpdatesModule = null;
58
- let debugBordersModule = null;
59
- let impersonateModule = null;
60
- let perfMonitorModule = null;
61
- let jsTopModule = null;
62
- let imagesModule = null;
63
- let assetsModule = null;
64
- let tvRemoteModule = null;
65
- let focusInspectorModule = null;
66
- let expoConstantsModule = null;
67
-
68
- // Catch bodies report through reportOptionalRequireError: silent for a
69
- // genuinely absent package, one dev warning when an installed package fails
70
- // to load (broken transitive resolve, top-level crash).
71
- try {
72
- externalSyncModule = require("@buoy-gg/external-sync");
73
- } catch (e) {
74
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/external-sync", e);
75
- }
76
- try {
77
- storageModule = require("@buoy-gg/storage");
78
- } catch (e) {
79
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/storage", e);
80
- }
81
- try {
82
- networkModule = require("@buoy-gg/network");
83
- } catch (e) {
84
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/network", e);
85
- }
86
- try {
87
- reactQueryModule = require("@buoy-gg/react-query");
88
- } catch (e) {
89
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/react-query", e);
90
- }
91
- try {
92
- routeEventsModule = require("@buoy-gg/route-events");
93
- } catch (e) {
94
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/route-events", e);
95
- }
96
- try {
97
- reduxModule = require("@buoy-gg/redux");
98
- } catch (e) {
99
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/redux", e);
100
- }
101
- try {
102
- zustandModule = require("@buoy-gg/zustand");
103
- } catch (e) {
104
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/zustand", e);
105
- }
106
- try {
107
- jotaiModule = require("@buoy-gg/jotai");
108
- } catch (e) {
109
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/jotai", e);
110
- }
111
- try {
112
- eventsModule = require("@buoy-gg/events");
113
- } catch (e) {
114
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/events", e);
115
- }
116
- try {
117
- consoleModule = require("@buoy-gg/console");
118
- } catch (e) {
119
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/console", e);
120
- }
121
- try {
122
- sentryModule = require("@buoy-gg/sentry");
123
- } catch (e) {
124
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/sentry", e);
125
- }
126
- try {
127
- envModule = require("@buoy-gg/env");
128
- } catch (e) {
129
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/env", e);
130
- }
131
- try {
132
- highlightUpdatesModule = require("@buoy-gg/highlight-updates");
133
- } catch (e) {
134
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/highlight-updates", e);
135
- }
136
- try {
137
- debugBordersModule = require("@buoy-gg/debug-borders");
138
- } catch (e) {
139
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/debug-borders", e);
140
- }
141
- try {
142
- impersonateModule = require("@buoy-gg/impersonate");
143
- } catch (e) {
144
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/impersonate", e);
145
- }
146
- try {
147
- perfMonitorModule = require("@buoy-gg/perf-monitor");
148
- } catch (e) {
149
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/perf-monitor", e);
150
- }
151
- try {
152
- jsTopModule = require("@buoy-gg/js-top");
153
- } catch (e) {
154
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/js-top", e);
155
- }
156
- try {
157
- imagesModule = require("@buoy-gg/images");
158
- } catch (e) {
159
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/images", e);
160
- }
161
- try {
162
- assetsModule = require("@buoy-gg/assets");
163
- } catch (e) {
164
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/assets", e);
165
- }
166
- try {
167
- tvRemoteModule = require("@buoy-gg/tv-remote");
168
- } catch (e) {
169
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/tv-remote", e);
170
- }
171
- try {
172
- focusInspectorModule = require("@buoy-gg/focus-inspector");
173
- } catch (e) {
174
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/focus-inspector", e);
175
- }
176
- try {
177
- expoConstantsModule = require("expo-constants");
178
- } catch (e) {
179
- // not installed (RN CLI apps) — still report real load failures
180
- (0, _optionalRequire.reportOptionalRequireError)("expo-constants", e);
181
- }
182
-
183
- /** Whether zero-config sync can run (the external-sync package is installed). */
184
- function isExternalSyncAvailable() {
185
- return !!externalSyncModule?.useExternalSyncSocket;
186
- }
187
- function getAppName() {
188
- const constants = expoConstantsModule?.default ?? expoConstantsModule;
189
- return constants?.expoConfig?.name ?? constants?.manifest2?.extra?.expoClient?.name ?? null;
190
- }
191
-
192
- /** expo-constants' `deviceName`: the simulator's name on a sim, the model on Android. */
193
- function getHardwareName() {
194
- const constants = expoConstantsModule?.default ?? expoConstantsModule;
195
- const name = constants?.deviceName;
196
- return typeof name === "string" && name.length > 0 ? name : null;
197
- }
198
- /**
199
- * Build the `toolId -> sync adapter` map from whatever tool packages the app
200
- * installed.
201
- *
202
- * Extracted out of AutoExternalSync so the map can be published on-device
203
- * WITHOUT opening a broker socket. It used to be inline, which quietly welded
204
- * the two together: `registerToolAdapters` had exactly one caller, inside a
205
- * component that only mounts when the sync gate passes, so in any build where
206
- * the broker path was closed the on-device registry was empty too and every
207
- * `dispatchToolAction` threw `Unknown tool`. Anything that drives tools from
208
- * inside the app — the Scenarios runner, Ask Buoy — needs the map without the
209
- * socket.
210
- */
211
- function useToolAdapterMap({
212
- requiredEnvVars,
213
- customApps
214
- }) {
215
- // Context-based query adapter; null when there is no QueryClientProvider
216
- // above FloatingDevTools (or the installed @buoy-gg/react-query predates
217
- // the hook).
218
- const queryAdapter = reactQueryModule?.useReactQuerySyncAdapter ? reactQueryModule.useReactQuerySyncAdapter() : null;
219
- return useToolAdapterMapInner(queryAdapter, requiredEnvVars, customApps);
220
- }
221
-
222
- /**
223
- * Publish the adapter map on-device, with no socket and no external-sync
224
- * dependency.
225
- *
226
- * Mounted unconditionally by FloatingDevTools. A getter is registered rather
227
- * than a snapshot for the same reason `attachDeviceSync` does it: the memo is
228
- * rebuilt whenever its inputs change, and a captured copy would keep
229
- * dispatching into adapters the tree has already replaced.
230
- */
231
- function ToolRegistryPublisher({
232
- requiredEnvVars,
233
- customApps
234
- }) {
235
- const tools = useToolAdapterMap({
236
- requiredEnvVars,
237
- customApps
238
- });
239
- const toolsRef = (0, _react.useRef)(tools);
240
- toolsRef.current = tools;
241
- (0, _react.useEffect)(() => (0, _sharedUi.registerToolAdapters)(() => toolsRef.current), []);
242
- return null;
243
- }
244
- function AutoExternalSync({
245
- options,
246
- requiredEnvVars,
247
- isPro,
248
- tier,
249
- licenseKey,
250
- customApps
251
- }) {
252
- const {
253
- useExternalSyncSocket,
254
- useExternalSync
255
- } = externalSyncModule;
256
- const tools = useToolAdapterMap({
257
- requiredEnvVars,
258
- customApps
259
- });
260
- const identity = (0, _deviceIdentity.useDeviceIdentity)(options, {
261
- appName: getAppName(),
262
- hardwareName: getHardwareName(),
263
- platform: _reactNative.Platform.OS
264
- });
265
- const deviceId = identity?.deviceId ?? null;
266
- const {
267
- socket
268
- } = useExternalSyncSocket({
269
- deviceName: identity?.deviceName ?? "Buoy Device",
270
- // Older external-sync versions predate getDefaultSocketURL and require
271
- // an explicit URL — keep the literal fallback for them.
272
- socketURL: options?.socketURL ?? externalSyncModule.getDefaultSocketURL?.() ?? "http://localhost:42831",
273
- persistentDeviceId: deviceId,
274
- platform: _reactNative.Platform.OS,
275
- enableLogs: options?.enableLogs
276
- });
277
-
278
- // The license validates asynchronously (Keygen call on mount), usually AFTER
279
- // the socket handshake is already sent — so the one-shot handshake query
280
- // can't carry Pro status reliably. Emit it as an event whenever it resolves
281
- // or changes, and on every (re)connect. The broker stores it on the device
282
- // record and rebroadcasts, so the desktop dashboard can auto-adopt the key.
283
- const licenseRef = (0, _react.useRef)({
284
- isPro,
285
- tier,
286
- licenseKey
287
- });
288
- licenseRef.current = {
289
- isPro,
290
- tier,
291
- licenseKey
292
- };
293
- (0, _react.useEffect)(() => {
294
- if (!socket) return;
295
- const emitLicense = () => {
296
- if (!_license.LicenseManager.hasAccountAccess() || !socket.connected) return;
297
- socket.emit("device-license", {
298
- isPro: licenseRef.current.isPro ? "1" : "0",
299
- // Brokers older than the tier split ignore this; newer ones prefer it.
300
- tier: licenseRef.current.tier ?? (licenseRef.current.isPro ? "pro" : "free")
301
- });
302
- };
303
- if (socket.connected) emitLicense();
304
- socket.on("connect", emitLicense);
305
- return () => {
306
- socket.off("connect", emitLicense);
307
- };
308
- }, [socket, isPro, tier, licenseKey]);
309
- useExternalSync({
310
- tools,
311
- socket,
312
- deviceId,
313
- enableLogs: options?.enableLogs
314
- });
315
- return null;
316
- }
317
-
318
- /**
319
- * The map itself. Split from `useToolAdapterMap` only so the react-query hook
320
- * is called at a stable position while the memo takes its result as a plain
321
- * dependency.
322
- */
323
- function useToolAdapterMapInner(queryAdapter, requiredEnvVars, customApps) {
324
- return (0, _react.useMemo)(() => {
325
- // Core's own adapter — device-level capabilities (JS-bundle reload) that
326
- // don't belong to any tool package. Registered unconditionally so remote
327
- // drivers can rely on it for every app, whatever tools are installed.
328
- const map = {
329
- app: _appSyncAdapter.appSyncAdapter
330
- };
331
- if (storageModule?.storageSyncAdapter) {
332
- map.storage = storageModule.storageSyncAdapter;
333
- }
334
- if (networkModule?.networkSyncAdapter) {
335
- map.network = networkModule.networkSyncAdapter;
336
- }
337
- if (queryAdapter) {
338
- map.query = queryAdapter;
339
- }
340
- if (routeEventsModule?.routeEventsSyncAdapter) {
341
- map["route-events"] = routeEventsModule.routeEventsSyncAdapter;
342
- }
343
- if (reduxModule?.reduxSyncAdapter) {
344
- map.redux = reduxModule.reduxSyncAdapter;
345
- }
346
- if (zustandModule?.zustandSyncAdapter) {
347
- map.zustand = zustandModule.zustandSyncAdapter;
348
- }
349
- if (jotaiModule?.jotaiSyncAdapter) {
350
- map.jotai = jotaiModule.jotaiSyncAdapter;
351
- }
352
- if (eventsModule?.eventsSyncAdapter) {
353
- map.events = eventsModule.eventsSyncAdapter;
354
- }
355
- if (consoleModule?.consoleSyncAdapter) {
356
- map.console = consoleModule.consoleSyncAdapter;
357
- }
358
- if (sentryModule?.sentrySyncAdapter) {
359
- map.sentry = sentryModule.sentrySyncAdapter;
360
- }
361
- // Lazy: time-machine imports `@buoy-gg/core` (useToolHost), and this file
362
- // is loaded from core's index. Requiring it at module top-level is a
363
- // require cycle (LogBox on every reload). Waiting until first render
364
- // lets core finish evaluating first.
365
- try {
366
- const timeMachineModule = require("@buoy-gg/time-machine");
367
- if (timeMachineModule?.timeMachineSyncAdapter) {
368
- map["time-machine"] = timeMachineModule.timeMachineSyncAdapter;
369
- }
370
- } catch (e) {
371
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/time-machine", e);
372
- }
373
- // Lazy for the same reason as time-machine: scenarios imports
374
- // `@buoy-gg/core` for useToolHost/useToolHeader.
375
- try {
376
- const scenariosModule = require("@buoy-gg/scenarios");
377
- if (scenariosModule?.scenariosSyncAdapter) {
378
- map.scenarios = scenariosModule.scenariosSyncAdapter;
379
- }
380
- } catch (e) {
381
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/scenarios", e);
382
- }
383
- // Lazy, same require-cycle reason as time-machine and scenarios: the
384
- // ask-buoy package imports `@buoy-gg/core` for the tool-host hooks.
385
- try {
386
- const askBuoyModule = require("@buoy-gg/ask-buoy");
387
- if (askBuoyModule?.askBuoySyncAdapter) {
388
- map["ask-buoy"] = askBuoyModule.askBuoySyncAdapter;
389
- }
390
- } catch (e) {
391
- (0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/ask-buoy", e);
392
- }
393
- if (envModule?.createEnvSyncAdapter) {
394
- map.env = envModule.createEnvSyncAdapter(requiredEnvVars ?? []);
395
- }
396
- if (highlightUpdatesModule?.highlightUpdatesSyncAdapter) {
397
- map["highlight-updates"] = highlightUpdatesModule.highlightUpdatesSyncAdapter;
398
- }
399
- if (debugBordersModule?.debugBordersSyncAdapter) {
400
- map["debug-borders"] = debugBordersModule.debugBordersSyncAdapter;
401
- }
402
- if (impersonateModule?.impersonateSyncAdapter) {
403
- map.impersonate = impersonateModule.impersonateSyncAdapter;
404
- }
405
- if (perfMonitorModule?.perfMonitorSyncAdapter) {
406
- map["perf-monitor"] = perfMonitorModule.perfMonitorSyncAdapter;
407
- }
408
- if (jsTopModule?.jsTopSyncAdapter) {
409
- map["js-top"] = jsTopModule.jsTopSyncAdapter;
410
- }
411
- if (imagesModule?.imagesSyncAdapter) {
412
- map.images = imagesModule.imagesSyncAdapter;
413
- }
414
- if (assetsModule?.assetsSyncAdapter) {
415
- map.assets = assetsModule.assetsSyncAdapter;
416
- }
417
- if (tvRemoteModule?.tvRemoteSyncAdapter) {
418
- map["tv-remote"] = tvRemoteModule.tvRemoteSyncAdapter;
419
- }
420
- if (focusInspectorModule?.focusInspectorSyncAdapter) {
421
- map["focus-inspector"] = focusInspectorModule.focusInspectorSyncAdapter;
422
- }
423
-
424
- // Third-party custom tools that declared InstalledApp.sync. Namespaced so
425
- // a custom tool named "network" can't shadow the first-party adapter on
426
- // the broker, in MCP call_action, or in desktop watch state.
427
- for (const app of customApps ?? []) {
428
- if (app?.sync) {
429
- map[`custom:${app.id}`] = app.sync;
430
- }
431
- }
432
- return map;
433
- }, [queryAdapter, requiredEnvVars, customApps]);
434
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.AutoExternalSync=AutoExternalSync;exports.ToolRegistryPublisher=ToolRegistryPublisher;exports.isExternalSyncAvailable=isExternalSyncAvailable;exports.useToolAdapterMap=useToolAdapterMap;var _react=require("react");var _reactNative=require("react-native");var _license=require("@buoy-gg/license");var _optionalRequire=require("./optionalRequire.js");var _appSyncAdapter=require("./sync/appSyncAdapter.js");var _deviceIdentity=require("./deviceIdentity.js");var _sharedUi=require("@buoy-gg/shared-ui");let externalSyncModule=null;let storageModule=null;let networkModule=null;let reactQueryModule=null;let routeEventsModule=null;let reduxModule=null;let zustandModule=null;let jotaiModule=null;let eventsModule=null;let consoleModule=null;let clockModule=null;let sentryModule=null;let notificationsModule=null;try{notificationsModule=require("@buoy-gg/notifications")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/notifications",e)}let envModule=null;let highlightUpdatesModule=null;let debugBordersModule=null;let impersonateModule=null;let perfMonitorModule=null;let jsTopModule=null;let imagesModule=null;let assetsModule=null;let tvRemoteModule=null;let focusInspectorModule=null;let expoConstantsModule=null;try{externalSyncModule=require("@buoy-gg/external-sync")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/external-sync",e)}try{storageModule=require("@buoy-gg/storage")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/storage",e)}try{networkModule=require("@buoy-gg/network")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/network",e)}try{reactQueryModule=require("@buoy-gg/react-query")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/react-query",e)}try{routeEventsModule=require("@buoy-gg/route-events")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/route-events",e)}try{reduxModule=require("@buoy-gg/redux")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/redux",e)}try{zustandModule=require("@buoy-gg/zustand")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/zustand",e)}try{jotaiModule=require("@buoy-gg/jotai")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/jotai",e)}try{eventsModule=require("@buoy-gg/events")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/events",e)}try{consoleModule=require("@buoy-gg/console")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/console",e)}try{clockModule=require("@buoy-gg/clock")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/clock",e)}try{sentryModule=require("@buoy-gg/sentry")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/sentry",e)}try{envModule=require("@buoy-gg/env")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/env",e)}try{highlightUpdatesModule=require("@buoy-gg/highlight-updates")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/highlight-updates",e)}try{debugBordersModule=require("@buoy-gg/debug-borders")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/debug-borders",e)}try{impersonateModule=require("@buoy-gg/impersonate")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/impersonate",e)}try{perfMonitorModule=require("@buoy-gg/perf-monitor")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/perf-monitor",e)}try{jsTopModule=require("@buoy-gg/js-top")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/js-top",e)}try{imagesModule=require("@buoy-gg/images")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/images",e)}try{assetsModule=require("@buoy-gg/assets")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/assets",e)}try{tvRemoteModule=require("@buoy-gg/tv-remote")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/tv-remote",e)}try{focusInspectorModule=require("@buoy-gg/focus-inspector")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/focus-inspector",e)}try{expoConstantsModule=require("expo-constants")}catch(e){(0,_optionalRequire.reportOptionalRequireError)("expo-constants",e)}function isExternalSyncAvailable(){return!!externalSyncModule?.useExternalSyncSocket}function getAppName(){const e=expoConstantsModule?.default??expoConstantsModule;return e?.expoConfig?.name??e?.manifest2?.extra?.expoClient?.name??null}function getHardwareName(){const e=expoConstantsModule?.default??expoConstantsModule;const o=e?.deviceName;return typeof o==="string"&&o.length>0?o:null}function useToolAdapterMap({requiredEnvVars:e,customApps:o}){const n=reactQueryModule?.useReactQuerySyncAdapter?reactQueryModule.useReactQuerySyncAdapter():null;return useToolAdapterMapInner(n,e,o)}function ToolRegistryPublisher({requiredEnvVars:e,customApps:o}){const n=useToolAdapterMap({requiredEnvVars:e,customApps:o});const r=(0,_react.useRef)(n);r.current=n;(0,_react.useEffect)(()=>(0,_sharedUi.registerToolAdapters)(()=>r.current),[]);return null}function AutoExternalSync({options:e,requiredEnvVars:o,isPro:n,tier:r,licenseKey:t,customApps:l}){const{useExternalSyncSocket:p,useExternalSync:y}=externalSyncModule;const g=useToolAdapterMap({requiredEnvVars:o,customApps:l});const i=(0,_deviceIdentity.useDeviceIdentity)(e,{appName:getAppName(),hardwareName:getHardwareName(),platform:_reactNative.Platform.OS});const s=i?.deviceId??null;const{socket:u}=p({deviceName:i?.deviceName??"Buoy Device",socketURL:e?.socketURL??externalSyncModule.getDefaultSocketURL?.()??"http://localhost:42831",persistentDeviceId:s,platform:_reactNative.Platform.OS,enableLogs:e?.enableLogs});const a=(0,_react.useRef)({isPro:n,tier:r,licenseKey:t});a.current={isPro:n,tier:r,licenseKey:t};(0,_react.useEffect)(()=>{if(!u)return;const c=()=>{if(!_license.LicenseManager.hasAccountAccess()||!u.connected)return;u.emit("device-license",{isPro:a.current.isPro?"1":"0",tier:a.current.tier??(a.current.isPro?"pro":"free")})};if(u.connected)c();u.on("connect",c);return()=>{u.off("connect",c)}},[u,n,r,t]);y({tools:g,socket:u,deviceId:s,enableLogs:e?.enableLogs});return null}function useToolAdapterMapInner(e,o,n){return(0,_react.useMemo)(()=>{const r={app:_appSyncAdapter.appSyncAdapter};if(storageModule?.storageSyncAdapter){r.storage=storageModule.storageSyncAdapter}if(networkModule?.networkSyncAdapter){r.network=networkModule.networkSyncAdapter}if(e){r.query=e}if(routeEventsModule?.routeEventsSyncAdapter){r["route-events"]=routeEventsModule.routeEventsSyncAdapter}if(reduxModule?.reduxSyncAdapter){r.redux=reduxModule.reduxSyncAdapter}if(zustandModule?.zustandSyncAdapter){r.zustand=zustandModule.zustandSyncAdapter}if(jotaiModule?.jotaiSyncAdapter){r.jotai=jotaiModule.jotaiSyncAdapter}if(eventsModule?.eventsSyncAdapter){r.events=eventsModule.eventsSyncAdapter}if(consoleModule?.consoleSyncAdapter){r.console=consoleModule.consoleSyncAdapter}if(clockModule?.clockSyncAdapter){r.clock=clockModule.clockSyncAdapter}if(notificationsModule?.notificationSyncAdapter){r["push-notifications"]=notificationsModule.notificationSyncAdapter}if(sentryModule?.sentrySyncAdapter){r.sentry=sentryModule.sentrySyncAdapter}try{const t=require("@buoy-gg/time-machine");if(t?.timeMachineSyncAdapter){r["time-machine"]=t.timeMachineSyncAdapter}}catch(t){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/time-machine",t)}try{const t=require("@buoy-gg/scenarios");if(t?.scenariosSyncAdapter){r.scenarios=t.scenariosSyncAdapter}}catch(t){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/scenarios",t)}try{const t=require("@buoy-gg/ask-buoy");if(t?.askBuoySyncAdapter){r["ask-buoy"]=t.askBuoySyncAdapter}}catch(t){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/ask-buoy",t)}if(envModule?.createEnvSyncAdapter){r.env=envModule.createEnvSyncAdapter(o??[])}if(highlightUpdatesModule?.highlightUpdatesSyncAdapter){r["highlight-updates"]=highlightUpdatesModule.highlightUpdatesSyncAdapter}if(debugBordersModule?.debugBordersSyncAdapter){r["debug-borders"]=debugBordersModule.debugBordersSyncAdapter}if(impersonateModule?.impersonateSyncAdapter){r.impersonate=impersonateModule.impersonateSyncAdapter}if(perfMonitorModule?.perfMonitorSyncAdapter){r["perf-monitor"]=perfMonitorModule.perfMonitorSyncAdapter}if(jsTopModule?.jsTopSyncAdapter){r["js-top"]=jsTopModule.jsTopSyncAdapter}if(imagesModule?.imagesSyncAdapter){r.images=imagesModule.imagesSyncAdapter}if(assetsModule?.assetsSyncAdapter){r.assets=assetsModule.assetsSyncAdapter}if(tvRemoteModule?.tvRemoteSyncAdapter){r["tv-remote"]=tvRemoteModule.tvRemoteSyncAdapter}if(focusInspectorModule?.focusInspectorSyncAdapter){r["focus-inspector"]=focusInspectorModule.focusInspectorSyncAdapter}for(const t of n??[]){if(t?.sync){r[`custom:${t.id}`]=t.sync}}return r},[e,o,n])}
@@ -1,167 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.MAX_DIAL_TOOLS = void 0;
7
- exports.createDefaultConfig = createDefaultConfig;
8
- exports.isDialToolId = isDialToolId;
9
- exports.isFloatingToolId = isFloatingToolId;
10
- exports.toolIdsToRecord = toolIdsToRecord;
11
- exports.validateDialConfig = validateDialConfig;
12
- /**
13
- * Type-safe default configuration for React Buoy DevTools.
14
- *
15
- * This module provides a simple, type-safe way for teams to configure
16
- * which tools are enabled by default in the floating menu and dial menu.
17
- *
18
- * @example
19
- * ```tsx
20
- * import { FloatingDevTools } from '@buoy-gg/core';
21
- *
22
- * // Simple: Enable specific tools by default
23
- * <FloatingDevTools
24
- * defaultFloatingTools={['env', 'environment', 'network']}
25
- * defaultDialTools={['env', 'network', 'storage', 'query']}
26
- * />
27
- * ```
28
- */
29
-
30
- /**
31
- * All known tool IDs that can appear in the floating menu or dial menu.
32
- * This is a union type of all auto-discovered tool IDs.
33
- */
34
-
35
- // Benchmark recording modal (@buoy-gg/perf-monitor)
36
-
37
- /**
38
- * Special floating-only tool IDs that only appear in the floating bubble row.
39
- */
40
- // Environment badge indicator
41
-
42
- /**
43
- * All tool IDs that can appear in the floating menu (bubble row).
44
- * Includes all built-in tools plus floating-only tools.
45
- */
46
-
47
- /**
48
- * Tool IDs that can appear in the dial menu.
49
- * Same as BuiltInToolId (environment badge is floating-only).
50
- */
51
-
52
- /**
53
- * Maximum number of tools allowed in the dial menu.
54
- */
55
- const MAX_DIAL_TOOLS = exports.MAX_DIAL_TOOLS = 6;
56
-
57
- /**
58
- * Configuration for default floating menu tools.
59
- * Pass an array of tool IDs to enable by default.
60
- *
61
- * @example
62
- * ```tsx
63
- * const floatingDefaults: DefaultFloatingConfig = ['env', 'environment', 'network'];
64
- * ```
65
- */
66
-
67
- /**
68
- * Configuration for default dial menu tools.
69
- * Pass an array of 1-6 tool IDs to enable by default.
70
- *
71
- * @example
72
- * ```tsx
73
- * const dialDefaults: DefaultDialConfig = ['env', 'network', 'storage', 'query'];
74
- * ```
75
- */
76
-
77
- /**
78
- * Validates and normalizes a dial configuration to not exceed the maximum allowed tools.
79
- * If more than MAX_DIAL_TOOLS are provided, logs a warning and truncates to first 6 tools.
80
- *
81
- * @param tools - Array of dial tool IDs to validate
82
- * @returns The original array if valid, or truncated array if too many tools
83
- *
84
- * @example
85
- * ```tsx
86
- * // This returns as-is
87
- * validateDialConfig(['env', 'network', 'storage']);
88
- * // Returns: ['env', 'network', 'storage']
89
- *
90
- * // This truncates and warns
91
- * validateDialConfig(['env', 'network', 'storage', 'query', 'route-events', 'debug-borders', 'highlight-updates']);
92
- * // Console warning, returns: ['env', 'network', 'storage', 'query', 'route-events', 'debug-borders']
93
- * ```
94
- */
95
- function validateDialConfig(tools) {
96
- if (tools.length > MAX_DIAL_TOOLS) {
97
- const toolList = tools.map(t => `"${t}"`).join(', ');
98
- // console.warn(
99
- // `[React Buoy] Dial menu configuration has ${tools.length} tools, but maximum is ${MAX_DIAL_TOOLS}. ` +
100
- // `Tools provided: [${toolList}]. ` +
101
- // `Only the first ${MAX_DIAL_TOOLS} tools will be shown.`
102
- // );
103
- return tools.slice(0, MAX_DIAL_TOOLS);
104
- }
105
- return tools;
106
- }
107
-
108
- /**
109
- * Helper to create a type-safe default configuration.
110
- * Provides autocomplete and validation at compile time.
111
- *
112
- * @example
113
- * ```tsx
114
- * import { createDefaultConfig } from '@buoy-gg/core';
115
- *
116
- * const config = createDefaultConfig({
117
- * floating: ['env', 'environment', 'network', 'query-wifi-toggle'],
118
- * dial: ['env', 'network', 'storage', 'query', 'route-events', 'debug-borders'],
119
- * });
120
- *
121
- * <FloatingDevTools
122
- * defaultFloatingTools={config.floating}
123
- * defaultDialTools={config.dial}
124
- * />
125
- * ```
126
- */
127
- function createDefaultConfig(config) {
128
- // Runtime validation for dial tools
129
- if (config.dial) {
130
- validateDialConfig(config.dial);
131
- }
132
- return {
133
- floating: config.floating,
134
- dial: config.dial
135
- };
136
- }
137
-
138
- /**
139
- * Type guard to check if a string is a valid FloatingToolId.
140
- */
141
- function isFloatingToolId(id) {
142
- const validIds = ['env', 'network', 'storage', 'query', 'query-wifi-toggle', 'route-events', 'debug-borders', 'highlight-updates', 'highlight-updates-modal', 'environment'];
143
- return validIds.includes(id);
144
- }
145
-
146
- /**
147
- * Type guard to check if a string is a valid DialToolId.
148
- */
149
- function isDialToolId(id) {
150
- const validIds = ['env', 'network', 'storage', 'query', 'query-wifi-toggle', 'route-events', 'debug-borders', 'highlight-updates', 'highlight-updates-modal'];
151
- return validIds.includes(id);
152
- }
153
-
154
- /**
155
- * Converts an array of tool IDs into a settings record.
156
- * Used internally to convert default config to DevToolsSettings format.
157
- *
158
- * @internal
159
- */
160
- function toolIdsToRecord(ids, allPossibleIds) {
161
- const record = {};
162
- const enabledSet = new Set(ids);
163
- for (const id of allPossibleIds) {
164
- record[id] = enabledSet.has(id);
165
- }
166
- return record;
167
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.MAX_DIAL_TOOLS=void 0;exports.createDefaultConfig=createDefaultConfig;exports.isDialToolId=isDialToolId;exports.isFloatingToolId=isFloatingToolId;exports.toolIdsToRecord=toolIdsToRecord;exports.validateDialConfig=validateDialConfig;const MAX_DIAL_TOOLS=exports.MAX_DIAL_TOOLS=6;function validateDialConfig(e){if(e.length>MAX_DIAL_TOOLS){const t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,MAX_DIAL_TOOLS)}return e}function createDefaultConfig(e){if(e.dial){validateDialConfig(e.dial)}return{floating:e.floating,dial:e.dial}}function isFloatingToolId(e){const t=["env","network","storage","query","query-wifi-toggle","route-events","debug-borders","highlight-updates","highlight-updates-modal","environment"];return t.includes(e)}function isDialToolId(e){const t=["env","network","storage","query","query-wifi-toggle","route-events","debug-borders","highlight-updates","highlight-updates-modal"];return t.includes(e)}function toolIdsToRecord(e,t){const o={};const r=new Set(e);for(const i of t){o[i]=r.has(i)}return o}