@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.
- 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 +5 -5
- 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,33 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const isDev = typeof __DEV__ !== "undefined" && __DEV__;
|
|
4
|
-
const reported = new Set();
|
|
5
|
-
const MODULE_NOT_FOUND_RE = /could not be found within the project|Cannot find module|Unable to resolve module/i;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Call from the CATCH block of a guarded optional require (the require
|
|
9
|
-
* literal itself must stay lexically inside try{} for Metro to treat the
|
|
10
|
-
* dependency as optional — this helper only inspects the failure).
|
|
11
|
-
*
|
|
12
|
-
* Silent when the package simply isn't installed. Warns once per module
|
|
13
|
-
* (dev only) when the package IS present but threw during import — a broken
|
|
14
|
-
* transitive resolve (subpath exports, version skew) or a top-level crash —
|
|
15
|
-
* which otherwise fails silently and makes tools vanish with no clue.
|
|
16
|
-
*/
|
|
17
|
-
export function reportOptionalRequireError(moduleName, err) {
|
|
18
|
-
if (!isDev) return;
|
|
19
|
-
// Under an ESM bundler (the desktop's Vite renderer) `require` itself does
|
|
20
|
-
// not exist, so every guarded require fails the same way. That says nothing
|
|
21
|
-
// about the package, so it is not worth a warning.
|
|
22
|
-
if (typeof require !== "function") return;
|
|
23
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
24
|
-
const code = err?.code;
|
|
25
|
-
const isNotFound = code === "MODULE_NOT_FOUND" || MODULE_NOT_FOUND_RE.test(message);
|
|
26
|
-
// "Not found" naming the module itself = expected (not installed).
|
|
27
|
-
// "Not found" naming a DIFFERENT module = broken transitive dep inside an
|
|
28
|
-
// installed package — a real error worth surfacing.
|
|
29
|
-
if (isNotFound && message.includes(moduleName)) return;
|
|
30
|
-
if (reported.has(moduleName)) return;
|
|
31
|
-
reported.add(moduleName);
|
|
32
|
-
console.warn(`[buoy] "${moduleName}" is installed but failed to load — its tools won't appear. ` + `Underlying error: ${message}`);
|
|
33
|
-
}
|
|
1
|
+
"use strict";const s=typeof __DEV__!=="undefined"&&__DEV__;const e=new Set;const c=/could not be found within the project|Cannot find module|Unable to resolve module/i;export function reportOptionalRequireError(t,n){if(!s)return;if(typeof require!=="function")return;const o=n instanceof Error?n.message:String(n);const r=n?.code;const i=r==="MODULE_NOT_FOUND"||c.test(o);if(i&&o.includes(t))return;if(e.has(t))return;e.add(t);console.warn(`[buoy] "${t}" is installed but failed to load \u2014 its tools won't appear. Underlying error: ${o}`)}
|
|
@@ -1,112 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Platform } from "react-native";
|
|
4
|
-
import { getDevServerOrigin, resolveReloadStrategy, scheduleReloadApp } from "@buoy-gg/shared-ui";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Sync adapter for the "app" pseudo-tool — device-level capabilities that
|
|
8
|
-
* belong to the app itself rather than to any one Buoy tool, consumed by
|
|
9
|
-
* @buoy-gg/external-sync's `useExternalSync` (structurally matches its
|
|
10
|
-
* ToolSyncAdapter interface so this package doesn't need a dependency on it).
|
|
11
|
-
*
|
|
12
|
-
* Lives in core and is registered UNCONDITIONALLY, so a remote driver (Buoy
|
|
13
|
-
* Desktop, the MCP server) can count on it for every connected app — no tool
|
|
14
|
-
* package, and no native peer deps, required.
|
|
15
|
-
*
|
|
16
|
-
* Two things today: reloading the JS bundle, and what KIND of device this is.
|
|
17
|
-
* The snapshot is static (there is nothing to stream), it just advertises
|
|
18
|
-
* whether a reload would work and which mechanism would run, so a driver can
|
|
19
|
-
* say so up front instead of discovering it by failing.
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* When THIS JS realm booted. A reload replaces the realm, so a driver that
|
|
23
|
-
* remembers this value can tell "the app came back" apart from "the old,
|
|
24
|
-
* doomed realm answered me" — the difference between reporting a reload done
|
|
25
|
-
* and reporting it too early.
|
|
26
|
-
*/
|
|
27
|
-
const REALM_STARTED_AT = Date.now();
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Where this bundle came from, resolved once at module load.
|
|
31
|
-
*
|
|
32
|
-
* Reported so a remote driver can recover the app when the app itself can no
|
|
33
|
-
* longer be asked to: after a fatal render error the React tree is gone, every
|
|
34
|
-
* tool action goes unanswered, and `reloadApp` below is unreachable. The dev
|
|
35
|
-
* server's reload path runs natively and still works — but only for a driver
|
|
36
|
-
* that learned this origin while the app was healthy.
|
|
37
|
-
*/
|
|
38
|
-
const DEV_SERVER_ORIGIN = getDevServerOrigin();
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* What kind of device this is, resolved once at module load.
|
|
42
|
-
*
|
|
43
|
-
* A dashboard cannot infer this from `platform` alone: an Apple TV and an
|
|
44
|
-
* iPhone both report "ios", and an Android TV and a phone both report
|
|
45
|
-
* "android". Without it Buoy Desktop has to show every tool for every device —
|
|
46
|
-
* including TV-only tools on a phone, where they can never do anything.
|
|
47
|
-
*
|
|
48
|
-
* `Platform.isTVOS` is `undefined` (not `false`) on Android TV, so it is only
|
|
49
|
-
* ever compared against `true`.
|
|
50
|
-
*/
|
|
51
|
-
const DEVICE = {
|
|
52
|
-
platform: Platform.OS,
|
|
53
|
-
isTV: Platform.isTV === true,
|
|
54
|
-
isTVOS: Platform.isTVOS === true
|
|
55
|
-
};
|
|
56
|
-
export const appSyncAdapter = {
|
|
57
|
-
// v3 adds `device`. Consumers must tolerate its absence — an older app on a
|
|
58
|
-
// newer dashboard simply reports an unknown device kind.
|
|
59
|
-
version: 3,
|
|
60
|
-
getSnapshot: () => {
|
|
61
|
-
const strategy = resolveReloadStrategy("auto");
|
|
62
|
-
return {
|
|
63
|
-
startedAt: REALM_STARTED_AT,
|
|
64
|
-
devServerOrigin: DEV_SERVER_ORIGIN,
|
|
65
|
-
device: DEVICE,
|
|
66
|
-
reload: {
|
|
67
|
-
available: strategy !== null,
|
|
68
|
-
strategy
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
// Nothing changes over time — take the callback and hand back a no-op
|
|
73
|
-
// unsubscribe so the sync layer's contract still holds.
|
|
74
|
-
subscribe: _onChange => () => {},
|
|
75
|
-
actions: {
|
|
76
|
-
/**
|
|
77
|
-
* Cheap round-trip liveness probe. Only a live JS realm can answer it, and
|
|
78
|
-
* `startedAt` identifies WHICH realm — that's how a driver confirms a
|
|
79
|
-
* reload actually completed rather than just being accepted.
|
|
80
|
-
*/
|
|
81
|
-
ping: () => ({
|
|
82
|
-
ok: true,
|
|
83
|
-
startedAt: REALM_STARTED_AT,
|
|
84
|
-
devServerOrigin: DEV_SERVER_ORIGIN
|
|
85
|
-
}),
|
|
86
|
-
/**
|
|
87
|
-
* Reload the app's JS bundle: RN's `DevSettings.reload()` in dev builds,
|
|
88
|
-
* `expo-updates` otherwise. The same primitive perf-monitor's batch runner
|
|
89
|
-
* uses between cases, and the MCP server's `reload_app`.
|
|
90
|
-
*
|
|
91
|
-
* Returns BEFORE the reload fires: the realm dies the moment it does, so
|
|
92
|
-
* the ack has to be on the wire first (scheduleReloadApp arms it a beat
|
|
93
|
-
* later). An unavailable mechanism throws here, so the caller gets a real
|
|
94
|
-
* error instead of a silent no-op.
|
|
95
|
-
*/
|
|
96
|
-
reloadApp: params => {
|
|
97
|
-
const p = params ?? {};
|
|
98
|
-
const {
|
|
99
|
-
strategy,
|
|
100
|
-
delayMs
|
|
101
|
-
} = scheduleReloadApp({
|
|
102
|
-
strategy: p.strategy,
|
|
103
|
-
delayMs: p.delayMs
|
|
104
|
-
});
|
|
105
|
-
return {
|
|
106
|
-
scheduled: true,
|
|
107
|
-
strategy,
|
|
108
|
-
delayMs
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
};
|
|
1
|
+
"use strict";import{Platform as t}from"react-native";import{getDevServerOrigin as i,resolveReloadStrategy as d,scheduleReloadApp as l}from"@buoy-gg/shared-ui";const s=Date.now();const a=i();const c={platform:t.OS,isTV:t.isTV===true,isTVOS:t.isTVOS===true};export const appSyncAdapter={version:3,getSnapshot:()=>{const e=d("auto");return{startedAt:s,devServerOrigin:a,device:c,reload:{available:e!==null,strategy:e}}},subscribe:e=>()=>{},actions:{ping:()=>({ok:true,startedAt:s,devServerOrigin:a}),reloadApp:e=>{const r=e??{};const{strategy:o,delayMs:n}=l({strategy:r.strategy,delayMs:r.delayMs});return{scheduled:true,strategy:o,delayMs:n}}}};
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useSyncExternalStore } from "react";
|
|
4
|
-
import { reportOptionalRequireError } from "./optionalRequire.js";
|
|
5
|
-
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
7
|
-
|
|
8
|
-
// Guarded module-level require (same Metro constraint as autoExternalSync:
|
|
9
|
-
// the require literal must sit lexically inside try{} to stay optional).
|
|
10
|
-
let syncModule = null;
|
|
11
|
-
try {
|
|
12
|
-
syncModule = require("@buoy-gg/external-sync");
|
|
13
|
-
} catch (e) {
|
|
14
|
-
reportOptionalRequireError("@buoy-gg/external-sync", e);
|
|
15
|
-
}
|
|
16
|
-
const noopSubscribe = () => () => {};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Live desktop-sync status for the settings modal. Returns null when
|
|
20
|
-
* external-sync isn't installed or predates the sync-status store — the
|
|
21
|
-
* caller hides the status row in that case.
|
|
22
|
-
*/
|
|
23
|
-
export function useDesktopSyncStatus() {
|
|
24
|
-
return useSyncExternalStore(syncModule?.subscribeSyncStatus ?? noopSubscribe, () => syncModule?.getSyncStatus?.() ?? null);
|
|
25
|
-
}
|
|
1
|
+
"use strict";import{useSyncExternalStore as r}from"react";import{reportOptionalRequireError as n}from"./optionalRequire.js";let t=null;try{t=require("@buoy-gg/external-sync")}catch(e){n("@buoy-gg/external-sync",e)}const o=()=>()=>{};export function useDesktopSyncStatus(){return r(t?.subscribeSyncStatus??o,()=>t?.getSyncStatus?.()??null)}
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useSyncExternalStore } from "react";
|
|
4
|
-
import { getRegisteredToolModule } from "@buoy-gg/shared-ui";
|
|
5
|
-
const noopSubscribe = () => () => {};
|
|
6
|
-
const serverSnapshot = () => null;
|
|
7
|
-
export function useDesktopSyncStatus() {
|
|
8
|
-
const sync = getRegisteredToolModule("@buoy-gg/external-sync");
|
|
9
|
-
return useSyncExternalStore(sync?.subscribeSyncStatus ?? noopSubscribe, () => sync?.getSyncStatus?.() ?? null, serverSnapshot);
|
|
10
|
-
}
|
|
1
|
+
"use strict";import{useSyncExternalStore as e}from"react";import{getRegisteredToolModule as s}from"@buoy-gg/shared-ui";const n=()=>()=>{};const o=()=>null;export function useDesktopSyncStatus(){const t=s("@buoy-gg/external-sync");return e(t?.subscribeSyncStatus??n,()=>t?.getSyncStatus?.()??null,o)}
|
package/lib/module/index.js
CHANGED
|
@@ -1,41 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Main SDK entry point
|
|
4
|
-
export { Buoy, default as BuoyDefault } from "./Buoy.js";
|
|
5
|
-
// Export unified component - primary interface
|
|
6
|
-
export { FloatingDevTools } from "./floatingMenu/FloatingDevTools";
|
|
7
|
-
// Device-level sync adapter (JS-bundle reload). FloatingDevTools registers it
|
|
8
|
-
// automatically; exported for apps that wire <DevToolsSync> by hand.
|
|
9
|
-
export { appSyncAdapter } from "./floatingMenu/sync/appSyncAdapter.js";
|
|
10
|
-
|
|
11
|
-
// Export auto-discovery utilities
|
|
12
|
-
export { autoDiscoverPresets, autoDiscoverPresetsWithCustom } from "./floatingMenu/autoDiscoverPresets.js";
|
|
13
|
-
|
|
14
|
-
// Export default configuration types and utilities
|
|
15
|
-
export { createDefaultConfig, validateDialConfig, isFloatingToolId, isDialToolId, MAX_DIAL_TOOLS } from "./floatingMenu/defaultConfig.js";
|
|
16
|
-
// Export FloatingMenu and its types
|
|
17
|
-
export { FloatingMenu } from "./floatingMenu/FloatingMenu.js";
|
|
18
|
-
export * from "./floatingMenu/types.js";
|
|
19
|
-
export { DevToolsSettingsModal, useDevToolsSettings } from "./floatingMenu/DevToolsSettingsModal";
|
|
20
|
-
// Export AppHost components for advanced use cases
|
|
21
|
-
export { AppHostProvider, AppOverlay, useAppHost } from "./floatingMenu/AppHost";
|
|
22
|
-
|
|
23
|
-
// Declarative chrome for custom tools (pairs with InstalledApp.modal)
|
|
24
|
-
export { useToolHost, useToolHeader } from "./floatingMenu/ToolHost.js";
|
|
25
|
-
|
|
26
|
-
// The custom-tools toolkit: blessed shared-ui components/hooks/tokens
|
|
27
|
-
export * from "./toolkit.js";
|
|
28
|
-
|
|
29
|
-
// Export DevTools visibility tracking
|
|
30
|
-
export { DevToolsVisibilityProvider, useDevToolsVisibility } from "./floatingMenu/DevToolsVisibilityContext.js";
|
|
31
|
-
|
|
32
|
-
// Export toggle state manager
|
|
33
|
-
export { toggleStateManager } from "./floatingMenu/ToggleStateManager.js";
|
|
34
|
-
|
|
35
|
-
// Export minimized tools components
|
|
36
|
-
export { MinimizedToolsProvider, useMinimizedTools, getIconPosition, getIconSize } from "./floatingMenu/MinimizedToolsContext.js";
|
|
37
|
-
export { MinimizedToolsStack } from "./floatingMenu/MinimizedToolsStack";
|
|
38
|
-
|
|
39
|
-
// Re-export license functionality from @buoy-gg/license
|
|
40
|
-
// These are re-exported for convenience so users can import from @buoy-gg/core
|
|
41
|
-
export { LicenseManager, DeviceRegistrationModal, useLicense, useFeatureAccess, useIsPro, setLicenseKey, isPro, hasEntitlement } from "@buoy-gg/license";
|
|
1
|
+
"use strict";export{Buoy,default as BuoyDefault}from"./Buoy.js";export{FloatingDevTools}from"./floatingMenu/FloatingDevTools";export{appSyncAdapter}from"./floatingMenu/sync/appSyncAdapter.js";export{autoDiscoverPresets,autoDiscoverPresetsWithCustom}from"./floatingMenu/autoDiscoverPresets.js";export{createDefaultConfig,validateDialConfig,isFloatingToolId,isDialToolId,MAX_DIAL_TOOLS}from"./floatingMenu/defaultConfig.js";export{FloatingMenu}from"./floatingMenu/FloatingMenu.js";export*from"./floatingMenu/types.js";export{DevToolsSettingsModal,useDevToolsSettings}from"./floatingMenu/DevToolsSettingsModal";export{AppHostProvider,AppOverlay,useAppHost}from"./floatingMenu/AppHost";export{useToolHost,useToolHeader}from"./floatingMenu/ToolHost.js";export*from"./toolkit.js";export{DevToolsVisibilityProvider,useDevToolsVisibility}from"./floatingMenu/DevToolsVisibilityContext.js";export{toggleStateManager}from"./floatingMenu/ToggleStateManager.js";export{MinimizedToolsProvider,useMinimizedTools,getIconPosition,getIconSize}from"./floatingMenu/MinimizedToolsContext.js";export{MinimizedToolsStack}from"./floatingMenu/MinimizedToolsStack";export{LicenseManager,DeviceRegistrationModal,useLicense,useFeatureAccess,useIsPro,setLicenseKey,isPro,hasEntitlement}from"@buoy-gg/license";
|
package/lib/module/index.web.js
CHANGED
|
@@ -1,36 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @buoy-gg/core - Web Entry Point
|
|
5
|
-
*
|
|
6
|
-
* This is the entry point for React DOM Web apps (Vite, CRA, Next.js, Electron).
|
|
7
|
-
* Bundlers will automatically resolve this file over index.tsx for web builds.
|
|
8
|
-
*
|
|
9
|
-
* @platform React DOM Web
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
// Export unified component - primary interface (web version)
|
|
13
|
-
export { FloatingDevTools } from "./floatingMenu/FloatingDevTools.web.js";
|
|
14
|
-
export { createWebTool } from "./utils/createWebTool.js";
|
|
15
|
-
|
|
16
|
-
// Export individual web components for advanced use cases
|
|
17
|
-
export { FloatingTools, UserStatus, Divider } from "./floatingMenu/floatingTools.web.js";
|
|
18
|
-
export { DialMenu } from "./floatingMenu/dial/DialDevTools.web.js";
|
|
19
|
-
export { SettingsModal } from "./floatingMenu/DevToolsSettingsModal.web.js";
|
|
20
|
-
// Tool host (open tool panels + minimized dock) — web twin of the native
|
|
21
|
-
// AppHostProvider/AppOverlay/useAppHost. FloatingDevTools wires these up
|
|
22
|
-
// automatically; exported for advanced/standalone use.
|
|
23
|
-
export { AppHostProvider, AppOverlay, useAppHost } from "./floatingMenu/AppHost.web.js";
|
|
24
|
-
|
|
25
|
-
// Export auto-discovery utilities (web version)
|
|
26
|
-
export { autoDiscoverWebPresets, autoDiscoverWithCustom, getToolsBySlot, getEnabledTools, defaultToolPresets } from "./utils/autoDiscoverPresets.web.js";
|
|
27
|
-
|
|
28
|
-
// Re-export types from floating-tools-react for convenience
|
|
29
|
-
|
|
30
|
-
// Re-export commonly used utilities from floating-tools-react
|
|
31
|
-
export { useSettings, useFloatingTools, getToolLabel, getToolDescription, getToolColor, settingsColors, settingsStyles, dialColors, dialStyles } from "@buoy-gg/floating-tools-react";
|
|
32
|
-
export { createWebTools } from "./utils/createWebTools.js";
|
|
33
|
-
export * from "./toolkit.js";
|
|
34
|
-
export { useToolHost, useToolHeader } from "./floatingMenu/ToolHost.js";
|
|
35
|
-
export { DevToolsVisibilityProvider, useDevToolsVisibility } from "./floatingMenu/DevToolsVisibilityContext.js";
|
|
36
|
-
export { appSyncAdapter } from "./floatingMenu/sync/appSyncAdapter.js";
|
|
1
|
+
"use strict";export{FloatingDevTools}from"./floatingMenu/FloatingDevTools.web.js";export{createWebTool}from"./utils/createWebTool.js";export{clearReleaseOptIn}from"./releaseOptIn.js";export{FloatingTools,UserStatus,Divider}from"./floatingMenu/floatingTools.web.js";export{DialMenu}from"./floatingMenu/dial/DialDevTools.web.js";export{SettingsModal}from"./floatingMenu/DevToolsSettingsModal.web.js";export{AppHostProvider,AppOverlay,useAppHost}from"./floatingMenu/AppHost.web.js";export{autoDiscoverWebPresets,autoDiscoverWithCustom,getToolsBySlot,getEnabledTools,defaultToolPresets}from"./utils/autoDiscoverPresets.web.js";export{useSettings,useFloatingTools,getToolLabel,getToolDescription,getToolColor,settingsColors,settingsStyles,dialColors,dialStyles}from"@buoy-gg/floating-tools-react";export{createWebTools}from"./utils/createWebTools.js";export*from"./toolkit.js";export{useToolHost,useToolHeader}from"./floatingMenu/ToolHost.js";export{DevToolsVisibilityProvider,useDevToolsVisibility}from"./floatingMenu/DevToolsVisibilityContext.js";export{appSyncAdapter}from"./floatingMenu/sync/appSyncAdapter.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t="@react_buoy_web_register_until";const r=7*24*60*60*1e3;export function hasReleaseOptIn(){try{const e=Number(globalThis.localStorage?.getItem(t));return Number.isFinite(e)&&e>Date.now()}catch{return false}}export function markReleaseOptIn(){try{globalThis.localStorage?.setItem(t,String(Date.now()+r))}catch{}}export function clearReleaseOptIn(){try{globalThis.localStorage?.removeItem(t)}catch{}}
|
|
@@ -1,127 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Anonymous install ping.
|
|
5
|
-
*
|
|
6
|
-
* Answers the one question licensing data cannot: how many people run Buoy at
|
|
7
|
-
* all. Keygen sees every free and paid key, but by definition it cannot see an
|
|
8
|
-
* install that never claimed one — so without this, "what fraction of installs
|
|
9
|
-
* have an account" has no denominator.
|
|
10
|
-
*
|
|
11
|
-
* Constraints this is built to honor:
|
|
12
|
-
*
|
|
13
|
-
* - **Development only.** Never fires from a shipped app. Buoy is a developer
|
|
14
|
-
* tool; pinging from a release build would phone home from an end user's
|
|
15
|
-
* device — someone who never chose to use Buoy — which is not a trade we are
|
|
16
|
-
* willing to make for a metric.
|
|
17
|
-
* - **No PII, no fingerprint.** The install id is a random UUID minted here.
|
|
18
|
-
* It is not derived from hardware, account, project, or app identity, so it
|
|
19
|
-
* cannot be correlated to a person or joined against anything else we hold.
|
|
20
|
-
* - **No tool usage.** What you open and inspect stays on your machine, which
|
|
21
|
-
* is the whole security story for enterprise adoption. Only the four fields
|
|
22
|
-
* below ever leave.
|
|
23
|
-
* - **Silent and harmless.** Fire-and-forget, throttled to once a day, and
|
|
24
|
-
* every failure path is swallowed. It can never block, slow, or break an app.
|
|
25
|
-
*
|
|
26
|
-
* Opt out with `Buoy.init({ telemetry: false })`.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
import { Platform } from "react-native";
|
|
30
|
-
import { persistentStorage } from "@buoy-gg/shared-ui";
|
|
31
|
-
import { SDK_VERSION } from "../version.js";
|
|
32
|
-
|
|
33
|
-
/** Same `@react_buoy` prefix as every other Buoy key, so it is inspectable. */
|
|
34
|
-
const STORAGE_KEY = "@react_buoy_install";
|
|
35
|
-
const ENDPOINT = "https://buoy.gg/api/t";
|
|
36
|
-
|
|
37
|
-
/** One ping per install per day is enough to count installs and daily actives. */
|
|
38
|
-
const PING_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
39
|
-
/** RFC4122 v4, from Math.random — this is a counter, not a credential. */
|
|
40
|
-
function uuid() {
|
|
41
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, c => {
|
|
42
|
-
const r = Math.random() * 16 | 0;
|
|
43
|
-
const v = c === "x" ? r : r & 0x3 | 0x8;
|
|
44
|
-
return v.toString(16);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
async function readState() {
|
|
48
|
-
try {
|
|
49
|
-
const raw = await persistentStorage.getItem(STORAGE_KEY);
|
|
50
|
-
if (!raw) return null;
|
|
51
|
-
const parsed = JSON.parse(raw);
|
|
52
|
-
if (typeof parsed?.installId !== "string") return null;
|
|
53
|
-
return {
|
|
54
|
-
installId: parsed.installId,
|
|
55
|
-
lastPingAt: typeof parsed.lastPingAt === "number" ? parsed.lastPingAt : 0
|
|
56
|
-
};
|
|
57
|
-
} catch {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Told once, on the very first ping of a new install — not on every launch.
|
|
64
|
-
*
|
|
65
|
-
* A dev tool that phones home silently deserves the reputation it would get.
|
|
66
|
-
* One line, the first time, saying exactly what leaves and how to stop it.
|
|
67
|
-
*/
|
|
68
|
-
function announceOnce() {
|
|
69
|
-
console.log("[Buoy] Anonymous usage ping enabled: a random install id, the Buoy " + "version, your platform, and your license tier — no project, app, or " + "tool data, and only in development. Opt out with " + "Buoy.init({ telemetry: false }). Details: https://buoy.gg/buoy/latest/docs/telemetry");
|
|
70
|
-
}
|
|
71
|
-
let sentThisSession = false;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* What the ping reports about the account: the tier of an admitted account,
|
|
75
|
-
* or "locked" for an install that has not been admitted (no key, or a key the
|
|
76
|
-
* license server rejected). "locked" is what gives "how many installs never
|
|
77
|
-
* get an account" its numerator.
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Send the ping if it is due. Safe to call on every mount: it is idempotent
|
|
82
|
-
* within a session, throttled to once a day across sessions, and resolves
|
|
83
|
-
* without throwing no matter what fails.
|
|
84
|
-
*/
|
|
85
|
-
export async function sendInstallPing(options) {
|
|
86
|
-
// Never from a shipped app — see the header. This is the single most
|
|
87
|
-
// important line in the file.
|
|
88
|
-
const isDevelopment = typeof __DEV__ !== "undefined" && __DEV__;
|
|
89
|
-
if (!isDevelopment) return;
|
|
90
|
-
if (!options.enabled) return;
|
|
91
|
-
if (sentThisSession) return;
|
|
92
|
-
sentThisSession = true;
|
|
93
|
-
try {
|
|
94
|
-
const existing = await readState();
|
|
95
|
-
const now = Date.now();
|
|
96
|
-
if (existing && now - existing.lastPingAt < PING_INTERVAL_MS) return;
|
|
97
|
-
const installId = existing?.installId ?? uuid();
|
|
98
|
-
if (!existing) announceOnce();
|
|
99
|
-
|
|
100
|
-
// Recorded BEFORE the request, so a server that is down or unreachable
|
|
101
|
-
// can't turn into a ping every single mount.
|
|
102
|
-
await persistentStorage.setItem(STORAGE_KEY, JSON.stringify({
|
|
103
|
-
installId,
|
|
104
|
-
lastPingAt: now
|
|
105
|
-
}));
|
|
106
|
-
await fetch(ENDPOINT, {
|
|
107
|
-
method: "POST",
|
|
108
|
-
headers: {
|
|
109
|
-
"Content-Type": "application/json"
|
|
110
|
-
},
|
|
111
|
-
body: JSON.stringify({
|
|
112
|
-
installId,
|
|
113
|
-
version: SDK_VERSION,
|
|
114
|
-
platform: Platform.OS,
|
|
115
|
-
tier: options.tier
|
|
116
|
-
})
|
|
117
|
-
});
|
|
118
|
-
} catch {
|
|
119
|
-
// Offline, firewalled, endpoint down — all fine. A metric is never worth
|
|
120
|
-
// a warning in someone else's console.
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/** Test seam: forget that a ping already went out this session. */
|
|
125
|
-
export function __resetInstallPingForTests() {
|
|
126
|
-
sentThisSession = false;
|
|
127
|
-
}
|
|
1
|
+
"use strict";import{Platform as l}from"react-native";import{persistentStorage as s}from"@buoy-gg/shared-ui";import{SDK_VERSION as u}from"../version.js";const a="@react_buoy_install";const x="https://buoy.gg/api/t";const c=24*60*60*1e3;function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const t=Math.random()*16|0;const e=n==="x"?t:t&3|8;return e.toString(16)})}async function p(){try{const n=await s.getItem(a);if(!n)return null;const t=JSON.parse(n);if(typeof t?.installId!=="string")return null;return{installId:t.installId,lastPingAt:typeof t.lastPingAt==="number"?t.lastPingAt:0}}catch{return null}}function y(){console.log("[Buoy] Anonymous usage ping enabled: a random install id, the Buoy version, your platform, and your license tier \u2014 no project, app, or tool data, and only in development. Opt out with Buoy.init({ telemetry: false }). Details: https://buoy.gg/buoy/latest/docs/telemetry")}let o=false;export async function sendInstallPing(n){const t=typeof __DEV__!=="undefined"&&__DEV__;if(!t)return;if(!n.enabled)return;if(o)return;o=true;try{const e=await p();const r=Date.now();if(e&&r-e.lastPingAt<c)return;const i=e?.installId??f();if(!e)y();await s.setItem(a,JSON.stringify({installId:i,lastPingAt:r}));await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({installId:i,version:u,platform:l.OS,tier:n.tier})})}catch{}}export function __resetInstallPingForTests(){o=false}
|
package/lib/module/toolkit.js
CHANGED
|
@@ -1,62 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The public custom-tools toolkit — the blessed subset of Buoy's shared UI
|
|
5
|
-
* re-exported from `@buoy-gg/core`, so third-party tool authors need exactly
|
|
6
|
-
* one dependency and never touch `@buoy-gg/shared-ui` (which stays internal
|
|
7
|
-
* and free to churn).
|
|
8
|
-
*
|
|
9
|
-
* Design rules for this surface (keep it Tailwind-small):
|
|
10
|
-
* - Variants over components: a styling difference is a prop, not an export.
|
|
11
|
-
* - Behavior earns a component (CopyButton); a size preset does not.
|
|
12
|
-
* - The tool shell owns chrome — header/back/search buttons are not user API.
|
|
13
|
-
*
|
|
14
|
-
* Everything here is considered API: additions are minor bumps, removals are
|
|
15
|
-
* major. If a component you want is missing, that's deliberate — request it
|
|
16
|
-
* rather than deep-importing.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
// ---- Theme tokens ---------------------------------------------------------
|
|
20
|
-
export { toolTheme } from "@buoy-gg/shared-ui";
|
|
21
|
-
|
|
22
|
-
// ---- Badges & status ------------------------------------------------------
|
|
23
|
-
// One Badge for every chip job; color it with the semantic helpers.
|
|
24
|
-
export { Badge, StatusDot, statusColor, methodColor, typeColor } from "./toolkitComponents.js";
|
|
25
|
-
|
|
26
|
-
// ---- Buttons --------------------------------------------------------------
|
|
27
|
-
export { ToolButton as Button, CopyButton, PowerToggleButton as PowerToggle } from "@buoy-gg/shared-ui";
|
|
28
|
-
|
|
29
|
-
// ---- Rows & cards ---------------------------------------------------------
|
|
30
|
-
export { CompactRow as Row, DevToolsCard as Card } from "@buoy-gg/shared-ui";
|
|
31
|
-
export { InfoRow } from "./toolkitComponents.js";
|
|
32
|
-
|
|
33
|
-
// ---- Structure ------------------------------------------------------------
|
|
34
|
-
export { SectionHeader, CollapsibleSection, TabSelector, EmptyState, SearchBar, EventStepperFooter } from "@buoy-gg/shared-ui";
|
|
35
|
-
|
|
36
|
-
// ---- Data -----------------------------------------------------------------
|
|
37
|
-
export { DataViewer } from "@buoy-gg/shared-ui/dataViewer";
|
|
38
|
-
export { DiffViewer } from "./toolkitComponents.js";
|
|
39
|
-
|
|
40
|
-
// ---- Stores (event log / observable state for tool data) ------------------
|
|
41
|
-
export { BaseEventStore } from "@buoy-gg/shared-ui";
|
|
42
|
-
|
|
43
|
-
// ---- Time -----------------------------------------------------------------
|
|
44
|
-
// The tool shell mounts the shared tick clock, so RelativeTime just works.
|
|
45
|
-
export { RelativeTime } from "@buoy-gg/shared-ui";
|
|
46
|
-
|
|
47
|
-
// ---- Formatting -----------------------------------------------------------
|
|
48
|
-
export { formatBytes, formatDuration, formatNumber, truncateMiddle, safeStringify } from "@buoy-gg/shared-ui";
|
|
49
|
-
|
|
50
|
-
// ---- Persistence ----------------------------------------------------------
|
|
51
|
-
export { usePersistedState, persistentStorage, devToolsStorageKeys } from "@buoy-gg/shared-ui";
|
|
52
|
-
|
|
53
|
-
// ---- Hooks / utils --------------------------------------------------------
|
|
54
|
-
export { useSafeAreaInsets, copyToClipboard } from "@buoy-gg/shared-ui";
|
|
55
|
-
|
|
56
|
-
// ---- Manual chrome (advanced escape hatch) --------------------------------
|
|
57
|
-
// Tools should use `InstalledApp.modal` + `useToolHost` instead; JsModal is
|
|
58
|
-
// for the rare tool that needs full control of its shell.
|
|
59
|
-
export { JsModal } from "@buoy-gg/shared-ui";
|
|
60
|
-
|
|
61
|
-
// ---- Icons (curated lucide set) ------------------------------------------
|
|
62
|
-
export { Activity, AlertTriangle, Bug, Check, CheckCircle, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Clock, Copy, Database, Eye, EyeOff, FileJson, FileText, Filter, FlaskConical, Globe, Hash, Info, Key, Layers, Lock, Pause, Play, Plus, Power, RefreshCw, Search, Settings, Shield, Trash2, User, Wifi, X, Zap, AlertCircle, BarChart3, Bookmark, Cloud, Download, Edit3, GitBranch, HardDrive, HelpCircle, Home, Image, Link, Maximize2, Minus, Palette, Pin, Route, Server, Smartphone, Square, CheckSquare, Timer, Unlock, Upload, Users, XCircle } from "@buoy-gg/shared-ui";
|
|
1
|
+
"use strict";export{toolTheme}from"@buoy-gg/shared-ui";export{Badge,StatusDot,statusColor,methodColor,typeColor}from"./toolkitComponents.js";export{ToolButton as Button,CopyButton,PowerToggleButton as PowerToggle}from"@buoy-gg/shared-ui";export{CompactRow as Row,DevToolsCard as Card}from"@buoy-gg/shared-ui";export{InfoRow}from"./toolkitComponents.js";export{SectionHeader,CollapsibleSection,TabSelector,EmptyState,SearchBar,EventStepperFooter}from"@buoy-gg/shared-ui";export{DataViewer}from"@buoy-gg/shared-ui/dataViewer";export{DiffViewer}from"./toolkitComponents.js";export{BaseEventStore}from"@buoy-gg/shared-ui";export{RelativeTime}from"@buoy-gg/shared-ui";export{formatBytes,formatDuration,formatNumber,truncateMiddle,safeStringify}from"@buoy-gg/shared-ui";export{usePersistedState,persistentStorage,devToolsStorageKeys}from"@buoy-gg/shared-ui";export{useSafeAreaInsets,copyToClipboard}from"@buoy-gg/shared-ui";export{JsModal}from"@buoy-gg/shared-ui";export{Activity,AlertTriangle,Bug,Check,CheckCircle,ChevronDown,ChevronLeft,ChevronRight,ChevronUp,Clock,Copy,Database,Eye,EyeOff,FileJson,FileText,Filter,FlaskConical,Globe,Hash,Info,Key,Layers,Lock,Pause,Play,Plus,Power,RefreshCw,Search,Settings,Shield,Trash2,User,Wifi,X,Zap,AlertCircle,BarChart3,Bookmark,Cloud,Download,Edit3,GitBranch,HardDrive,HelpCircle,Home,Image,Link,Maximize2,Minus,Palette,Pin,Route,Server,Smartphone,Square,CheckSquare,Timer,Unlock,Upload,Users,XCircle}from"@buoy-gg/shared-ui";
|