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