@buoy-gg/core 7.0.41 → 7.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -95
- package/bin/buoy.js +19 -340
- package/lib/commonjs/Buoy.js +1 -107
- package/lib/commonjs/browserRegister.js +1 -48
- package/lib/commonjs/browserRegister.server.js +1 -10
- package/lib/commonjs/earlyHookScript.js +1 -0
- package/lib/commonjs/earlyNetwork.js +1 -0
- package/lib/commonjs/floatingMenu/AppHost.js +1 -460
- package/lib/commonjs/floatingMenu/AppHost.web.js +1 -376
- package/lib/commonjs/floatingMenu/AppHostLogic.js +1 -50
- package/lib/commonjs/floatingMenu/AppIcon.js +1 -91
- package/lib/commonjs/floatingMenu/AppIcon.web.js +1 -53
- package/lib/commonjs/floatingMenu/BrowserToolRuntime.js +1 -150
- package/lib/commonjs/floatingMenu/DefaultConfigContext.js +1 -45
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +1 -18
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -1114
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +1 -48
- package/lib/commonjs/floatingMenu/DevToolsVisibilityContext.js +1 -49
- package/lib/commonjs/floatingMenu/FloatingDevTools.js +1 -559
- package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -415
- package/lib/commonjs/floatingMenu/FloatingMenu.js +1 -371
- package/lib/commonjs/floatingMenu/MinimizedToolsContext.js +1 -274
- package/lib/commonjs/floatingMenu/MinimizedToolsStack.js +1 -288
- package/lib/commonjs/floatingMenu/MinimizedToolsStack.web.js +1 -377
- package/lib/commonjs/floatingMenu/ToggleStateManager.js +1 -36
- package/lib/commonjs/floatingMenu/ToolHost.js +1 -281
- package/lib/commonjs/floatingMenu/ToolOpenerBridge.js +1 -41
- package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +1 -471
- package/lib/commonjs/floatingMenu/autoExternalSync.js +1 -443
- package/lib/commonjs/floatingMenu/defaultConfig.js +1 -167
- package/lib/commonjs/floatingMenu/deviceIdentity.js +1 -173
- package/lib/commonjs/floatingMenu/dial/DialDevTools.js +1 -904
- package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +1 -895
- package/lib/commonjs/floatingMenu/dial/DialHyperspace.js +1 -177
- package/lib/commonjs/floatingMenu/dial/DialIcon.js +1 -304
- package/lib/commonjs/floatingMenu/dial/DialPagination.js +1 -165
- package/lib/commonjs/floatingMenu/dial/DialSnow.js +1 -92
- package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.js +1 -246
- package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.web.js +2 -147
- package/lib/commonjs/floatingMenu/dial/dialUsageStore.js +1 -93
- package/lib/commonjs/floatingMenu/dial/onboardingConstants.js +1 -42
- package/lib/commonjs/floatingMenu/dial/onboardingConstants.web.js +1 -42
- package/lib/commonjs/floatingMenu/externalSyncGate.js +1 -49
- package/lib/commonjs/floatingMenu/floatingTools.js +1 -42
- package/lib/commonjs/floatingMenu/floatingTools.web.js +1 -30
- package/lib/commonjs/floatingMenu/optionalRequire.js +1 -37
- package/lib/commonjs/floatingMenu/settingsBus.js +1 -12
- package/lib/commonjs/floatingMenu/sync/appSyncAdapter.js +1 -115
- package/lib/commonjs/floatingMenu/types.js +1 -5
- package/lib/commonjs/floatingMenu/useDesktopSyncStatus.js +1 -28
- package/lib/commonjs/floatingMenu/useDesktopSyncStatus.web.js +1 -14
- package/lib/commonjs/index.js +1 -291
- package/lib/commonjs/index.web.js +1 -241
- package/lib/commonjs/reactDevtoolsTypes.js +1 -1
- package/lib/commonjs/releaseOptIn.js +1 -0
- package/lib/commonjs/telemetry/installPing.js +1 -131
- package/lib/commonjs/toolkit.js +1 -584
- package/lib/commonjs/toolkitComponents.js +1 -241
- package/lib/commonjs/utils/autoDiscoverPresets.web.js +1 -46
- package/lib/commonjs/utils/createWebTool.js +1 -20
- package/lib/commonjs/utils/createWebTools.js +1 -30
- package/lib/commonjs/version.js +1 -18
- package/lib/module/Buoy.js +1 -102
- package/lib/module/browserRegister.js +1 -44
- package/lib/module/browserRegister.server.js +1 -6
- package/lib/module/earlyHookScript.js +1 -0
- package/lib/module/earlyNetwork.js +1 -0
- package/lib/module/floatingMenu/AppHost.js +1 -452
- package/lib/module/floatingMenu/AppHost.web.js +1 -368
- package/lib/module/floatingMenu/AppHostLogic.js +1 -45
- package/lib/module/floatingMenu/AppIcon.js +1 -84
- package/lib/module/floatingMenu/AppIcon.web.js +1 -47
- package/lib/module/floatingMenu/BrowserToolRuntime.js +1 -146
- package/lib/module/floatingMenu/DefaultConfigContext.js +1 -39
- package/lib/module/floatingMenu/DevToolsSettingsModal.js +1 -3
- package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -1110
- package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +1 -44
- package/lib/module/floatingMenu/DevToolsVisibilityContext.js +1 -44
- package/lib/module/floatingMenu/FloatingDevTools.js +1 -556
- package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -412
- package/lib/module/floatingMenu/FloatingMenu.js +1 -366
- package/lib/module/floatingMenu/MinimizedToolsContext.js +1 -266
- package/lib/module/floatingMenu/MinimizedToolsStack.js +1 -285
- package/lib/module/floatingMenu/MinimizedToolsStack.web.js +1 -374
- package/lib/module/floatingMenu/ToggleStateManager.js +1 -32
- package/lib/module/floatingMenu/ToolHost.js +1 -273
- package/lib/module/floatingMenu/ToolOpenerBridge.js +1 -37
- package/lib/module/floatingMenu/autoDiscoverPresets.js +1 -467
- package/lib/module/floatingMenu/autoExternalSync.js +1 -436
- package/lib/module/floatingMenu/defaultConfig.js +1 -158
- package/lib/module/floatingMenu/deviceIdentity.js +1 -163
- package/lib/module/floatingMenu/dial/DialDevTools.js +1 -900
- package/lib/module/floatingMenu/dial/DialDevTools.web.js +1 -891
- package/lib/module/floatingMenu/dial/DialHyperspace.js +1 -173
- package/lib/module/floatingMenu/dial/DialIcon.js +1 -301
- package/lib/module/floatingMenu/dial/DialPagination.js +1 -160
- package/lib/module/floatingMenu/dial/DialSnow.js +1 -90
- package/lib/module/floatingMenu/dial/OnboardingTooltip.js +1 -240
- package/lib/module/floatingMenu/dial/OnboardingTooltip.web.js +2 -142
- package/lib/module/floatingMenu/dial/dialUsageStore.js +1 -85
- package/lib/module/floatingMenu/dial/onboardingConstants.js +1 -3
- package/lib/module/floatingMenu/dial/onboardingConstants.web.js +1 -3
- package/lib/module/floatingMenu/externalSyncGate.js +1 -44
- package/lib/module/floatingMenu/floatingTools.js +1 -27
- package/lib/module/floatingMenu/floatingTools.web.js +1 -3
- package/lib/module/floatingMenu/optionalRequire.js +1 -33
- package/lib/module/floatingMenu/settingsBus.js +1 -3
- package/lib/module/floatingMenu/sync/appSyncAdapter.js +1 -112
- package/lib/module/floatingMenu/types.js +1 -3
- package/lib/module/floatingMenu/useDesktopSyncStatus.js +1 -25
- package/lib/module/floatingMenu/useDesktopSyncStatus.web.js +1 -10
- package/lib/module/index.js +1 -41
- package/lib/module/index.web.js +1 -36
- package/lib/module/reactDevtoolsTypes.js +1 -1
- package/lib/module/releaseOptIn.js +1 -0
- package/lib/module/telemetry/installPing.js +1 -127
- package/lib/module/toolkit.js +1 -62
- package/lib/module/toolkitComponents.js +1 -230
- package/lib/module/utils/autoDiscoverPresets.web.js +1 -38
- package/lib/module/utils/createWebTool.js +1 -17
- package/lib/module/utils/createWebTools.js +1 -25
- package/lib/module/version.js +1 -14
- package/lib/typescript/commonjs/browserRegister.d.ts +9 -1
- package/lib/typescript/commonjs/browserRegister.server.d.ts +1 -0
- package/lib/typescript/commonjs/earlyHookScript.d.ts +12 -0
- package/lib/typescript/commonjs/earlyNetwork.d.ts +52 -0
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +1 -0
- package/lib/typescript/commonjs/releaseOptIn.d.ts +4 -0
- package/lib/typescript/commonjs/version.d.ts +1 -1
- package/lib/typescript/module/browserRegister.d.ts +9 -1
- package/lib/typescript/module/browserRegister.server.d.ts +1 -0
- package/lib/typescript/module/earlyHookScript.d.ts +12 -0
- package/lib/typescript/module/earlyNetwork.d.ts +52 -0
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/module/index.web.d.ts +1 -0
- package/lib/typescript/module/releaseOptIn.d.ts +4 -0
- package/lib/typescript/module/version.d.ts +1 -1
- package/lib/web/chunks/chunk-5SGL6QL4.mjs +1 -0
- package/lib/web/chunks/chunk-FROELTJH.mjs +1 -0
- package/lib/web/chunks/chunk-QZDVCMCT.mjs +1 -2
- package/lib/web/chunks/chunk-R7RGRTY5.mjs +1 -2
- package/lib/web/index.mjs +2 -3
- package/lib/web/register-server.mjs +1 -2
- package/lib/web/register.mjs +1 -2
- package/lib/web/toolkit.mjs +1 -2
- package/package.json +6 -9
- package/lib/typescript/commonjs/Buoy.d.ts.map +0 -1
- package/lib/typescript/commonjs/browserRegister.d.ts.map +0 -1
- package/lib/typescript/commonjs/browserRegister.server.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppIcon.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppIcon.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/BrowserToolRuntime.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.shared.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/ToggleStateManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/ToolHost.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/deviceIdentity.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialPagination.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialSnow.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/externalSyncGate.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/optionalRequire.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/index.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/reactDevtoolsTypes.d.ts.map +0 -1
- package/lib/typescript/commonjs/telemetry/installPing.d.ts.map +0 -1
- package/lib/typescript/commonjs/toolkit.d.ts.map +0 -1
- package/lib/typescript/commonjs/toolkitComponents.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils/createWebTool.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils/createWebTools.d.ts.map +0 -1
- package/lib/typescript/commonjs/version.d.ts.map +0 -1
- package/lib/typescript/module/Buoy.d.ts.map +0 -1
- package/lib/typescript/module/browserRegister.d.ts.map +0 -1
- package/lib/typescript/module/browserRegister.server.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppHost.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppHost.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppIcon.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppIcon.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/BrowserToolRuntime.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.shared.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/ToggleStateManager.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/ToolHost.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/deviceIdentity.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialPagination.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialSnow.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/externalSyncGate.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/floatingTools.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/optionalRequire.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/settingsBus.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/types.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.web.d.ts.map +0 -1
- package/lib/typescript/module/index.d.ts.map +0 -1
- package/lib/typescript/module/index.web.d.ts.map +0 -1
- package/lib/typescript/module/reactDevtoolsTypes.d.ts.map +0 -1
- package/lib/typescript/module/telemetry/installPing.d.ts.map +0 -1
- package/lib/typescript/module/toolkit.d.ts.map +0 -1
- package/lib/typescript/module/toolkitComponents.d.ts.map +0 -1
- package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts.map +0 -1
- package/lib/typescript/module/utils/createWebTool.d.ts.map +0 -1
- package/lib/typescript/module/utils/createWebTools.d.ts.map +0 -1
- package/lib/typescript/module/version.d.ts.map +0 -1
- package/lib/web/chunks/chunk-5NZOQR6Q.mjs +0 -2
- package/lib/web/chunks/chunk-CGDSLLZF.mjs +0 -2
- package/lib/web/chunks/chunk-DCJDUSNR.mjs +0 -2
- package/lib/web/chunks/chunk-IDSHFS6G.mjs +0 -2
- package/lib/web/chunks/chunk-JOAMJGCS.mjs +0 -2
- package/lib/web/chunks/chunk-KYKZ2N52.mjs +0 -2
- package/lib/web/chunks/chunk-NGM7JGGS.mjs +0 -2
- package/lib/web/chunks/chunk-Z3XWDDIO.mjs +0 -2
- package/lib/web/chunks/chunk-ZTGQ6TTY.mjs +0 -2
|
@@ -1,443 +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 notificationsModule = null;
|
|
57
|
-
try {
|
|
58
|
-
notificationsModule = require("@buoy-gg/notifications");
|
|
59
|
-
} catch (e) {
|
|
60
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/notifications", e);
|
|
61
|
-
}
|
|
62
|
-
let envModule = null;
|
|
63
|
-
let highlightUpdatesModule = null;
|
|
64
|
-
let debugBordersModule = null;
|
|
65
|
-
let impersonateModule = null;
|
|
66
|
-
let perfMonitorModule = null;
|
|
67
|
-
let jsTopModule = null;
|
|
68
|
-
let imagesModule = null;
|
|
69
|
-
let assetsModule = null;
|
|
70
|
-
let tvRemoteModule = null;
|
|
71
|
-
let focusInspectorModule = null;
|
|
72
|
-
let expoConstantsModule = null;
|
|
73
|
-
|
|
74
|
-
// Catch bodies report through reportOptionalRequireError: silent for a
|
|
75
|
-
// genuinely absent package, one dev warning when an installed package fails
|
|
76
|
-
// to load (broken transitive resolve, top-level crash).
|
|
77
|
-
try {
|
|
78
|
-
externalSyncModule = require("@buoy-gg/external-sync");
|
|
79
|
-
} catch (e) {
|
|
80
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/external-sync", e);
|
|
81
|
-
}
|
|
82
|
-
try {
|
|
83
|
-
storageModule = require("@buoy-gg/storage");
|
|
84
|
-
} catch (e) {
|
|
85
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/storage", e);
|
|
86
|
-
}
|
|
87
|
-
try {
|
|
88
|
-
networkModule = require("@buoy-gg/network");
|
|
89
|
-
} catch (e) {
|
|
90
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/network", e);
|
|
91
|
-
}
|
|
92
|
-
try {
|
|
93
|
-
reactQueryModule = require("@buoy-gg/react-query");
|
|
94
|
-
} catch (e) {
|
|
95
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/react-query", e);
|
|
96
|
-
}
|
|
97
|
-
try {
|
|
98
|
-
routeEventsModule = require("@buoy-gg/route-events");
|
|
99
|
-
} catch (e) {
|
|
100
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/route-events", e);
|
|
101
|
-
}
|
|
102
|
-
try {
|
|
103
|
-
reduxModule = require("@buoy-gg/redux");
|
|
104
|
-
} catch (e) {
|
|
105
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/redux", e);
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
zustandModule = require("@buoy-gg/zustand");
|
|
109
|
-
} catch (e) {
|
|
110
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/zustand", e);
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
jotaiModule = require("@buoy-gg/jotai");
|
|
114
|
-
} catch (e) {
|
|
115
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/jotai", e);
|
|
116
|
-
}
|
|
117
|
-
try {
|
|
118
|
-
eventsModule = require("@buoy-gg/events");
|
|
119
|
-
} catch (e) {
|
|
120
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/events", e);
|
|
121
|
-
}
|
|
122
|
-
try {
|
|
123
|
-
consoleModule = require("@buoy-gg/console");
|
|
124
|
-
} catch (e) {
|
|
125
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/console", e);
|
|
126
|
-
}
|
|
127
|
-
try {
|
|
128
|
-
sentryModule = require("@buoy-gg/sentry");
|
|
129
|
-
} catch (e) {
|
|
130
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/sentry", e);
|
|
131
|
-
}
|
|
132
|
-
try {
|
|
133
|
-
envModule = require("@buoy-gg/env");
|
|
134
|
-
} catch (e) {
|
|
135
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/env", e);
|
|
136
|
-
}
|
|
137
|
-
try {
|
|
138
|
-
highlightUpdatesModule = require("@buoy-gg/highlight-updates");
|
|
139
|
-
} catch (e) {
|
|
140
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/highlight-updates", e);
|
|
141
|
-
}
|
|
142
|
-
try {
|
|
143
|
-
debugBordersModule = require("@buoy-gg/debug-borders");
|
|
144
|
-
} catch (e) {
|
|
145
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/debug-borders", e);
|
|
146
|
-
}
|
|
147
|
-
try {
|
|
148
|
-
impersonateModule = require("@buoy-gg/impersonate");
|
|
149
|
-
} catch (e) {
|
|
150
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/impersonate", e);
|
|
151
|
-
}
|
|
152
|
-
try {
|
|
153
|
-
perfMonitorModule = require("@buoy-gg/perf-monitor");
|
|
154
|
-
} catch (e) {
|
|
155
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/perf-monitor", e);
|
|
156
|
-
}
|
|
157
|
-
try {
|
|
158
|
-
jsTopModule = require("@buoy-gg/js-top");
|
|
159
|
-
} catch (e) {
|
|
160
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/js-top", e);
|
|
161
|
-
}
|
|
162
|
-
try {
|
|
163
|
-
imagesModule = require("@buoy-gg/images");
|
|
164
|
-
} catch (e) {
|
|
165
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/images", e);
|
|
166
|
-
}
|
|
167
|
-
try {
|
|
168
|
-
assetsModule = require("@buoy-gg/assets");
|
|
169
|
-
} catch (e) {
|
|
170
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/assets", e);
|
|
171
|
-
}
|
|
172
|
-
try {
|
|
173
|
-
tvRemoteModule = require("@buoy-gg/tv-remote");
|
|
174
|
-
} catch (e) {
|
|
175
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/tv-remote", e);
|
|
176
|
-
}
|
|
177
|
-
try {
|
|
178
|
-
focusInspectorModule = require("@buoy-gg/focus-inspector");
|
|
179
|
-
} catch (e) {
|
|
180
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/focus-inspector", e);
|
|
181
|
-
}
|
|
182
|
-
try {
|
|
183
|
-
expoConstantsModule = require("expo-constants");
|
|
184
|
-
} catch (e) {
|
|
185
|
-
// not installed (RN CLI apps) — still report real load failures
|
|
186
|
-
(0, _optionalRequire.reportOptionalRequireError)("expo-constants", e);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/** Whether zero-config sync can run (the external-sync package is installed). */
|
|
190
|
-
function isExternalSyncAvailable() {
|
|
191
|
-
return !!externalSyncModule?.useExternalSyncSocket;
|
|
192
|
-
}
|
|
193
|
-
function getAppName() {
|
|
194
|
-
const constants = expoConstantsModule?.default ?? expoConstantsModule;
|
|
195
|
-
return constants?.expoConfig?.name ?? constants?.manifest2?.extra?.expoClient?.name ?? null;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/** expo-constants' `deviceName`: the simulator's name on a sim, the model on Android. */
|
|
199
|
-
function getHardwareName() {
|
|
200
|
-
const constants = expoConstantsModule?.default ?? expoConstantsModule;
|
|
201
|
-
const name = constants?.deviceName;
|
|
202
|
-
return typeof name === "string" && name.length > 0 ? name : null;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Build the `toolId -> sync adapter` map from whatever tool packages the app
|
|
206
|
-
* installed.
|
|
207
|
-
*
|
|
208
|
-
* Extracted out of AutoExternalSync so the map can be published on-device
|
|
209
|
-
* WITHOUT opening a broker socket. It used to be inline, which quietly welded
|
|
210
|
-
* the two together: `registerToolAdapters` had exactly one caller, inside a
|
|
211
|
-
* component that only mounts when the sync gate passes, so in any build where
|
|
212
|
-
* the broker path was closed the on-device registry was empty too and every
|
|
213
|
-
* `dispatchToolAction` threw `Unknown tool`. Anything that drives tools from
|
|
214
|
-
* inside the app — the Scenarios runner, Ask Buoy — needs the map without the
|
|
215
|
-
* socket.
|
|
216
|
-
*/
|
|
217
|
-
function useToolAdapterMap({
|
|
218
|
-
requiredEnvVars,
|
|
219
|
-
customApps
|
|
220
|
-
}) {
|
|
221
|
-
// Context-based query adapter; null when there is no QueryClientProvider
|
|
222
|
-
// above FloatingDevTools (or the installed @buoy-gg/react-query predates
|
|
223
|
-
// the hook).
|
|
224
|
-
const queryAdapter = reactQueryModule?.useReactQuerySyncAdapter ? reactQueryModule.useReactQuerySyncAdapter() : null;
|
|
225
|
-
return useToolAdapterMapInner(queryAdapter, requiredEnvVars, customApps);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Publish the adapter map on-device, with no socket and no external-sync
|
|
230
|
-
* dependency.
|
|
231
|
-
*
|
|
232
|
-
* Mounted unconditionally by FloatingDevTools. A getter is registered rather
|
|
233
|
-
* than a snapshot for the same reason `attachDeviceSync` does it: the memo is
|
|
234
|
-
* rebuilt whenever its inputs change, and a captured copy would keep
|
|
235
|
-
* dispatching into adapters the tree has already replaced.
|
|
236
|
-
*/
|
|
237
|
-
function ToolRegistryPublisher({
|
|
238
|
-
requiredEnvVars,
|
|
239
|
-
customApps
|
|
240
|
-
}) {
|
|
241
|
-
const tools = useToolAdapterMap({
|
|
242
|
-
requiredEnvVars,
|
|
243
|
-
customApps
|
|
244
|
-
});
|
|
245
|
-
const toolsRef = (0, _react.useRef)(tools);
|
|
246
|
-
toolsRef.current = tools;
|
|
247
|
-
(0, _react.useEffect)(() => (0, _sharedUi.registerToolAdapters)(() => toolsRef.current), []);
|
|
248
|
-
return null;
|
|
249
|
-
}
|
|
250
|
-
function AutoExternalSync({
|
|
251
|
-
options,
|
|
252
|
-
requiredEnvVars,
|
|
253
|
-
isPro,
|
|
254
|
-
tier,
|
|
255
|
-
licenseKey,
|
|
256
|
-
customApps
|
|
257
|
-
}) {
|
|
258
|
-
const {
|
|
259
|
-
useExternalSyncSocket,
|
|
260
|
-
useExternalSync
|
|
261
|
-
} = externalSyncModule;
|
|
262
|
-
const tools = useToolAdapterMap({
|
|
263
|
-
requiredEnvVars,
|
|
264
|
-
customApps
|
|
265
|
-
});
|
|
266
|
-
const identity = (0, _deviceIdentity.useDeviceIdentity)(options, {
|
|
267
|
-
appName: getAppName(),
|
|
268
|
-
hardwareName: getHardwareName(),
|
|
269
|
-
platform: _reactNative.Platform.OS
|
|
270
|
-
});
|
|
271
|
-
const deviceId = identity?.deviceId ?? null;
|
|
272
|
-
const {
|
|
273
|
-
socket
|
|
274
|
-
} = useExternalSyncSocket({
|
|
275
|
-
deviceName: identity?.deviceName ?? "Buoy Device",
|
|
276
|
-
// Older external-sync versions predate getDefaultSocketURL and require
|
|
277
|
-
// an explicit URL — keep the literal fallback for them.
|
|
278
|
-
socketURL: options?.socketURL ?? externalSyncModule.getDefaultSocketURL?.() ?? "http://localhost:42831",
|
|
279
|
-
persistentDeviceId: deviceId,
|
|
280
|
-
platform: _reactNative.Platform.OS,
|
|
281
|
-
enableLogs: options?.enableLogs
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
// The license validates asynchronously (Keygen call on mount), usually AFTER
|
|
285
|
-
// the socket handshake is already sent — so the one-shot handshake query
|
|
286
|
-
// can't carry Pro status reliably. Emit it as an event whenever it resolves
|
|
287
|
-
// or changes, and on every (re)connect. The broker stores it on the device
|
|
288
|
-
// record and rebroadcasts, so the desktop dashboard can auto-adopt the key.
|
|
289
|
-
const licenseRef = (0, _react.useRef)({
|
|
290
|
-
isPro,
|
|
291
|
-
tier,
|
|
292
|
-
licenseKey
|
|
293
|
-
});
|
|
294
|
-
licenseRef.current = {
|
|
295
|
-
isPro,
|
|
296
|
-
tier,
|
|
297
|
-
licenseKey
|
|
298
|
-
};
|
|
299
|
-
(0, _react.useEffect)(() => {
|
|
300
|
-
if (!socket) return;
|
|
301
|
-
const emitLicense = () => {
|
|
302
|
-
if (!_license.LicenseManager.hasAccountAccess() || !socket.connected) return;
|
|
303
|
-
socket.emit("device-license", {
|
|
304
|
-
isPro: licenseRef.current.isPro ? "1" : "0",
|
|
305
|
-
// Brokers older than the tier split ignore this; newer ones prefer it.
|
|
306
|
-
tier: licenseRef.current.tier ?? (licenseRef.current.isPro ? "pro" : "free")
|
|
307
|
-
});
|
|
308
|
-
};
|
|
309
|
-
if (socket.connected) emitLicense();
|
|
310
|
-
socket.on("connect", emitLicense);
|
|
311
|
-
return () => {
|
|
312
|
-
socket.off("connect", emitLicense);
|
|
313
|
-
};
|
|
314
|
-
}, [socket, isPro, tier, licenseKey]);
|
|
315
|
-
useExternalSync({
|
|
316
|
-
tools,
|
|
317
|
-
socket,
|
|
318
|
-
deviceId,
|
|
319
|
-
enableLogs: options?.enableLogs
|
|
320
|
-
});
|
|
321
|
-
return null;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* The map itself. Split from `useToolAdapterMap` only so the react-query hook
|
|
326
|
-
* is called at a stable position while the memo takes its result as a plain
|
|
327
|
-
* dependency.
|
|
328
|
-
*/
|
|
329
|
-
function useToolAdapterMapInner(queryAdapter, requiredEnvVars, customApps) {
|
|
330
|
-
return (0, _react.useMemo)(() => {
|
|
331
|
-
// Core's own adapter — device-level capabilities (JS-bundle reload) that
|
|
332
|
-
// don't belong to any tool package. Registered unconditionally so remote
|
|
333
|
-
// drivers can rely on it for every app, whatever tools are installed.
|
|
334
|
-
const map = {
|
|
335
|
-
app: _appSyncAdapter.appSyncAdapter
|
|
336
|
-
};
|
|
337
|
-
if (storageModule?.storageSyncAdapter) {
|
|
338
|
-
map.storage = storageModule.storageSyncAdapter;
|
|
339
|
-
}
|
|
340
|
-
if (networkModule?.networkSyncAdapter) {
|
|
341
|
-
map.network = networkModule.networkSyncAdapter;
|
|
342
|
-
}
|
|
343
|
-
if (queryAdapter) {
|
|
344
|
-
map.query = queryAdapter;
|
|
345
|
-
}
|
|
346
|
-
if (routeEventsModule?.routeEventsSyncAdapter) {
|
|
347
|
-
map["route-events"] = routeEventsModule.routeEventsSyncAdapter;
|
|
348
|
-
}
|
|
349
|
-
if (reduxModule?.reduxSyncAdapter) {
|
|
350
|
-
map.redux = reduxModule.reduxSyncAdapter;
|
|
351
|
-
}
|
|
352
|
-
if (zustandModule?.zustandSyncAdapter) {
|
|
353
|
-
map.zustand = zustandModule.zustandSyncAdapter;
|
|
354
|
-
}
|
|
355
|
-
if (jotaiModule?.jotaiSyncAdapter) {
|
|
356
|
-
map.jotai = jotaiModule.jotaiSyncAdapter;
|
|
357
|
-
}
|
|
358
|
-
if (eventsModule?.eventsSyncAdapter) {
|
|
359
|
-
map.events = eventsModule.eventsSyncAdapter;
|
|
360
|
-
}
|
|
361
|
-
if (consoleModule?.consoleSyncAdapter) {
|
|
362
|
-
map.console = consoleModule.consoleSyncAdapter;
|
|
363
|
-
}
|
|
364
|
-
if (notificationsModule?.notificationSyncAdapter) {
|
|
365
|
-
map["push-notifications"] = notificationsModule.notificationSyncAdapter;
|
|
366
|
-
}
|
|
367
|
-
if (sentryModule?.sentrySyncAdapter) {
|
|
368
|
-
map.sentry = sentryModule.sentrySyncAdapter;
|
|
369
|
-
}
|
|
370
|
-
// Lazy: time-machine imports `@buoy-gg/core` (useToolHost), and this file
|
|
371
|
-
// is loaded from core's index. Requiring it at module top-level is a
|
|
372
|
-
// require cycle (LogBox on every reload). Waiting until first render
|
|
373
|
-
// lets core finish evaluating first.
|
|
374
|
-
try {
|
|
375
|
-
const timeMachineModule = require("@buoy-gg/time-machine");
|
|
376
|
-
if (timeMachineModule?.timeMachineSyncAdapter) {
|
|
377
|
-
map["time-machine"] = timeMachineModule.timeMachineSyncAdapter;
|
|
378
|
-
}
|
|
379
|
-
} catch (e) {
|
|
380
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/time-machine", e);
|
|
381
|
-
}
|
|
382
|
-
// Lazy for the same reason as time-machine: scenarios imports
|
|
383
|
-
// `@buoy-gg/core` for useToolHost/useToolHeader.
|
|
384
|
-
try {
|
|
385
|
-
const scenariosModule = require("@buoy-gg/scenarios");
|
|
386
|
-
if (scenariosModule?.scenariosSyncAdapter) {
|
|
387
|
-
map.scenarios = scenariosModule.scenariosSyncAdapter;
|
|
388
|
-
}
|
|
389
|
-
} catch (e) {
|
|
390
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/scenarios", e);
|
|
391
|
-
}
|
|
392
|
-
// Lazy, same require-cycle reason as time-machine and scenarios: the
|
|
393
|
-
// ask-buoy package imports `@buoy-gg/core` for the tool-host hooks.
|
|
394
|
-
try {
|
|
395
|
-
const askBuoyModule = require("@buoy-gg/ask-buoy");
|
|
396
|
-
if (askBuoyModule?.askBuoySyncAdapter) {
|
|
397
|
-
map["ask-buoy"] = askBuoyModule.askBuoySyncAdapter;
|
|
398
|
-
}
|
|
399
|
-
} catch (e) {
|
|
400
|
-
(0, _optionalRequire.reportOptionalRequireError)("@buoy-gg/ask-buoy", e);
|
|
401
|
-
}
|
|
402
|
-
if (envModule?.createEnvSyncAdapter) {
|
|
403
|
-
map.env = envModule.createEnvSyncAdapter(requiredEnvVars ?? []);
|
|
404
|
-
}
|
|
405
|
-
if (highlightUpdatesModule?.highlightUpdatesSyncAdapter) {
|
|
406
|
-
map["highlight-updates"] = highlightUpdatesModule.highlightUpdatesSyncAdapter;
|
|
407
|
-
}
|
|
408
|
-
if (debugBordersModule?.debugBordersSyncAdapter) {
|
|
409
|
-
map["debug-borders"] = debugBordersModule.debugBordersSyncAdapter;
|
|
410
|
-
}
|
|
411
|
-
if (impersonateModule?.impersonateSyncAdapter) {
|
|
412
|
-
map.impersonate = impersonateModule.impersonateSyncAdapter;
|
|
413
|
-
}
|
|
414
|
-
if (perfMonitorModule?.perfMonitorSyncAdapter) {
|
|
415
|
-
map["perf-monitor"] = perfMonitorModule.perfMonitorSyncAdapter;
|
|
416
|
-
}
|
|
417
|
-
if (jsTopModule?.jsTopSyncAdapter) {
|
|
418
|
-
map["js-top"] = jsTopModule.jsTopSyncAdapter;
|
|
419
|
-
}
|
|
420
|
-
if (imagesModule?.imagesSyncAdapter) {
|
|
421
|
-
map.images = imagesModule.imagesSyncAdapter;
|
|
422
|
-
}
|
|
423
|
-
if (assetsModule?.assetsSyncAdapter) {
|
|
424
|
-
map.assets = assetsModule.assetsSyncAdapter;
|
|
425
|
-
}
|
|
426
|
-
if (tvRemoteModule?.tvRemoteSyncAdapter) {
|
|
427
|
-
map["tv-remote"] = tvRemoteModule.tvRemoteSyncAdapter;
|
|
428
|
-
}
|
|
429
|
-
if (focusInspectorModule?.focusInspectorSyncAdapter) {
|
|
430
|
-
map["focus-inspector"] = focusInspectorModule.focusInspectorSyncAdapter;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
// Third-party custom tools that declared InstalledApp.sync. Namespaced so
|
|
434
|
-
// a custom tool named "network" can't shadow the first-party adapter on
|
|
435
|
-
// the broker, in MCP call_action, or in desktop watch state.
|
|
436
|
-
for (const app of customApps ?? []) {
|
|
437
|
-
if (app?.sync) {
|
|
438
|
-
map[`custom:${app.id}`] = app.sync;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
return map;
|
|
442
|
-
}, [queryAdapter, requiredEnvVars, customApps]);
|
|
443
|
-
}
|
|
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}
|