@buoy-gg/shared-ui 7.0.35 → 7.0.38
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 +33 -26
- package/floating.d.ts +1 -0
- package/floating.js +2 -0
- package/lib/commonjs/JsModal.js +16 -1
- package/lib/commonjs/JsModal.web.js +16 -1
- package/lib/commonjs/dataViewer/CyberpunkInput.js +6 -1
- package/lib/commonjs/dataViewer/LiveExplorer.js +28 -16
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/icons/ReactQueryIcon.js +9 -161
- package/lib/commonjs/icons/SentryBugIcon.js +9 -171
- package/lib/commonjs/icons/index.js +7 -0
- package/lib/commonjs/index.js +105 -6
- package/lib/commonjs/license/AccountSetup.js +56 -0
- package/lib/commonjs/license/AccountSetup.web.js +81 -0
- package/lib/commonjs/license/FeatureGate.js +10 -43
- package/lib/commonjs/license/FreeAccountPrompt.js +35 -12
- package/lib/commonjs/license/index.js +0 -6
- package/lib/commonjs/license/licenseModule.js +56 -36
- package/lib/commonjs/license/tierLimits.js +12 -63
- package/lib/commonjs/storage/devToolsStorageKeys.js +8 -1
- package/lib/commonjs/stores/BaseEventStore.js +21 -5
- package/lib/commonjs/stores/createToolStore.js +21 -3
- package/lib/commonjs/stores/floatingToolStore.js +71 -0
- package/lib/commonjs/stores/floatingToolStore.test.js +112 -0
- package/lib/commonjs/sync/keyedArrays.js +209 -0
- package/lib/commonjs/sync/toolActionRegistry.js +85 -2
- package/lib/commonjs/sync/toolAttention.test.js +51 -0
- package/lib/commonjs/sync/toolUiBridge.js +58 -0
- package/lib/commonjs/sync/typedEdit.js +228 -0
- package/lib/commonjs/sync/valuePath.js +337 -0
- package/lib/commonjs/sync/valueShape.js +161 -0
- package/lib/commonjs/ui/backgrounds/README.md +52 -0
- package/lib/commonjs/ui/backgrounds/ToolBackground.js +4 -2
- package/lib/commonjs/ui/backgrounds/index.js +8 -1
- package/lib/commonjs/ui/backgrounds/registry.js +8 -0
- package/lib/commonjs/ui/backgrounds/variants/wormhole/motion.js +48 -0
- package/lib/commonjs/ui/backgrounds/variants/wormhole/textures.js +3 -0
- package/lib/commonjs/ui/backgrounds/variants/wormhole.js +133 -0
- package/lib/commonjs/ui/components/ClipboardHintBanner.js +5 -6
- package/lib/commonjs/ui/components/CompactRow.js +94 -74
- package/lib/commonjs/ui/components/DraggableHeader.js +16 -1
- package/lib/commonjs/ui/components/ExpandablePopover.js +38 -6
- package/lib/commonjs/ui/components/HeaderSearchButton.js +17 -4
- package/lib/commonjs/ui/floating/FloatingTool.js +1010 -0
- package/lib/commonjs/ui/floating/FloatingTool.web.js +591 -0
- package/lib/commonjs/ui/floating/FloatingToolHost.js +32 -0
- package/lib/commonjs/ui/floating/FloatingToolHost.web.js +28 -0
- package/lib/commonjs/ui/floating/index.js +105 -0
- package/lib/commonjs/ui/floating/index.web.js +105 -0
- package/lib/commonjs/ui/floating/onboardingConstants.js +70 -0
- package/lib/commonjs/ui/floating/onboardingConstants.web.js +34 -0
- package/lib/commonjs/ui/gameUI/constants/gameUIColors.js +3 -1
- package/lib/commonjs/ui/index.js +118 -2
- package/lib/commonjs/ui/night/nightTheme.js +10 -0
- package/lib/commonjs/ui/night/primitives.js +22 -5
- package/lib/commonjs/ui/otto/OttoSceneView.js +69 -0
- package/lib/commonjs/ui/otto/index.js +22 -0
- package/lib/commonjs/ui/otto/ottoEngine.js +10 -7
- package/lib/commonjs/ui/otto/ottoScenes.js +949 -0
- package/lib/commonjs/utils/minimalSuperJSON.js +13 -3
- package/lib/module/JsModal.js +16 -1
- package/lib/module/JsModal.web.js +16 -1
- package/lib/module/dataViewer/CyberpunkInput.js +6 -1
- package/lib/module/dataViewer/LiveExplorer.js +28 -16
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/icons/ReactQueryIcon.js +9 -161
- package/lib/module/icons/SentryBugIcon.js +9 -171
- package/lib/module/icons/index.js +3 -1
- package/lib/module/index.js +8 -1
- package/lib/module/license/AccountSetup.js +52 -0
- package/lib/module/license/AccountSetup.web.js +77 -0
- package/lib/module/license/FeatureGate.js +10 -43
- package/lib/module/license/FreeAccountPrompt.js +35 -12
- package/lib/module/license/index.js +1 -1
- package/lib/module/license/licenseModule.js +50 -35
- package/lib/module/license/tierLimits.js +13 -63
- package/lib/module/storage/devToolsStorageKeys.js +8 -1
- package/lib/module/stores/BaseEventStore.js +21 -5
- package/lib/module/stores/createToolStore.js +21 -3
- package/lib/module/stores/floatingToolStore.js +61 -0
- package/lib/module/stores/floatingToolStore.test.js +111 -0
- package/lib/module/sync/keyedArrays.js +204 -0
- package/lib/module/sync/toolActionRegistry.js +84 -2
- package/lib/module/sync/toolAttention.test.js +50 -0
- package/lib/module/sync/toolUiBridge.js +55 -0
- package/lib/module/sync/typedEdit.js +220 -0
- package/lib/module/sync/valuePath.js +330 -0
- package/lib/module/sync/valueShape.js +153 -0
- package/lib/module/ui/backgrounds/README.md +52 -0
- package/lib/module/ui/backgrounds/ToolBackground.js +4 -2
- package/lib/module/ui/backgrounds/index.js +2 -1
- package/lib/module/ui/backgrounds/registry.js +8 -0
- package/lib/module/ui/backgrounds/variants/wormhole/motion.js +44 -0
- package/lib/module/ui/backgrounds/variants/wormhole/textures.js +3 -0
- package/lib/module/ui/backgrounds/variants/wormhole.js +129 -0
- package/lib/module/ui/components/ClipboardHintBanner.js +5 -6
- package/lib/module/ui/components/CompactRow.js +94 -74
- package/lib/module/ui/components/DraggableHeader.js +16 -1
- package/lib/module/ui/components/ExpandablePopover.js +38 -6
- package/lib/module/ui/components/HeaderSearchButton.js +17 -4
- package/lib/module/ui/floating/FloatingTool.js +1003 -0
- package/lib/module/ui/floating/FloatingTool.web.js +590 -0
- package/lib/module/ui/floating/FloatingToolHost.js +29 -0
- package/lib/module/ui/floating/FloatingToolHost.web.js +25 -0
- package/lib/module/ui/floating/index.js +6 -0
- package/lib/module/ui/floating/index.web.js +6 -0
- package/lib/module/ui/floating/onboardingConstants.js +64 -0
- package/lib/module/ui/floating/onboardingConstants.web.js +27 -0
- package/lib/module/ui/gameUI/constants/gameUIColors.js +3 -1
- package/lib/module/ui/index.js +5 -1
- package/lib/module/ui/night/nightTheme.js +10 -0
- package/lib/module/ui/night/primitives.js +22 -5
- package/lib/module/ui/otto/OttoSceneView.js +64 -0
- package/lib/module/ui/otto/index.js +3 -1
- package/lib/module/ui/otto/ottoEngine.js +10 -7
- package/lib/module/ui/otto/ottoScenes.js +942 -0
- package/lib/module/utils/minimalSuperJSON.js +13 -3
- package/lib/typescript/commonjs/JsModal.d.ts +43 -2
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/JsModal.web.d.ts +5 -2
- package/lib/typescript/commonjs/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/CyberpunkInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/LiveExplorer.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/icons/ReactQueryIcon.d.ts +1 -2
- package/lib/typescript/commonjs/icons/ReactQueryIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/SentryBugIcon.d.ts +1 -2
- package/lib/typescript/commonjs/icons/SentryBugIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +8 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/AccountSetup.d.ts +4 -0
- package/lib/typescript/commonjs/license/AccountSetup.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/AccountSetup.web.d.ts +2 -0
- package/lib/typescript/commonjs/license/AccountSetup.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/FeatureGate.d.ts +3 -19
- package/lib/typescript/commonjs/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts +8 -11
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/index.d.ts +1 -1
- package/lib/typescript/commonjs/license/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/licenseModule.d.ts +18 -31
- package/lib/typescript/commonjs/license/licenseModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/tierLimits.d.ts +9 -52
- package/lib/typescript/commonjs/license/tierLimits.d.ts.map +1 -1
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts +6 -0
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/BaseEventStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/createToolStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/floatingToolStore.d.ts +27 -0
- package/lib/typescript/commonjs/stores/floatingToolStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/stores/floatingToolStore.test.d.ts +2 -0
- package/lib/typescript/commonjs/stores/floatingToolStore.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/keyedArrays.d.ts +35 -0
- package/lib/typescript/commonjs/sync/keyedArrays.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/toolActionRegistry.d.ts +4 -32
- package/lib/typescript/commonjs/sync/toolActionRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/sync/toolAttention.test.d.ts +2 -0
- package/lib/typescript/commonjs/sync/toolAttention.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/toolUiBridge.d.ts +25 -0
- package/lib/typescript/commonjs/sync/toolUiBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/sync/typedEdit.d.ts +70 -0
- package/lib/typescript/commonjs/sync/typedEdit.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/valuePath.d.ts +52 -0
- package/lib/typescript/commonjs/sync/valuePath.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/valueShape.d.ts +77 -0
- package/lib/typescript/commonjs/sync/valueShape.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts +7 -1
- package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts +2 -1
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts +11 -1
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole/motion.d.ts +24 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole/motion.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole/textures.d.ts +13 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole/textures.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole.d.ts +3 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ClipboardHintBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CompactRow.d.ts +8 -1
- package/lib/typescript/commonjs/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/DraggableHeader.d.ts +4 -1
- package/lib/typescript/commonjs/ui/components/DraggableHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ExpandablePopover.d.ts +14 -1
- package/lib/typescript/commonjs/ui/components/ExpandablePopover.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/HeaderSearchButton.d.ts +7 -1
- package/lib/typescript/commonjs/ui/components/HeaderSearchButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/floating/FloatingTool.d.ts +79 -0
- package/lib/typescript/commonjs/ui/floating/FloatingTool.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/FloatingTool.web.d.ts +64 -0
- package/lib/typescript/commonjs/ui/floating/FloatingTool.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/FloatingToolHost.d.ts +3 -0
- package/lib/typescript/commonjs/ui/floating/FloatingToolHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/FloatingToolHost.web.d.ts +3 -0
- package/lib/typescript/commonjs/ui/floating/FloatingToolHost.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/index.d.ts +7 -0
- package/lib/typescript/commonjs/ui/floating/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/index.web.d.ts +7 -0
- package/lib/typescript/commonjs/ui/floating/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/onboardingConstants.d.ts +30 -0
- package/lib/typescript/commonjs/ui/floating/onboardingConstants.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/onboardingConstants.web.d.ts +13 -0
- package/lib/typescript/commonjs/ui/floating/onboardingConstants.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts +2 -0
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +6 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/night/nightTheme.d.ts +10 -0
- package/lib/typescript/commonjs/ui/night/nightTheme.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/night/primitives.d.ts +10 -3
- package/lib/typescript/commonjs/ui/night/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/otto/OttoSceneView.d.ts +30 -0
- package/lib/typescript/commonjs/ui/otto/OttoSceneView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/otto/index.d.ts +2 -0
- package/lib/typescript/commonjs/ui/otto/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts +1 -1
- package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/otto/ottoScenes.d.ts +75 -0
- package/lib/typescript/commonjs/ui/otto/ottoScenes.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/minimalSuperJSON.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.d.ts +43 -2
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.web.d.ts +5 -2
- package/lib/typescript/module/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/CyberpunkInput.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/LiveExplorer.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/icons/ReactQueryIcon.d.ts +1 -2
- package/lib/typescript/module/icons/ReactQueryIcon.d.ts.map +1 -1
- package/lib/typescript/module/icons/SentryBugIcon.d.ts +1 -2
- package/lib/typescript/module/icons/SentryBugIcon.d.ts.map +1 -1
- package/lib/typescript/module/icons/index.d.ts +1 -1
- package/lib/typescript/module/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +8 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/license/AccountSetup.d.ts +4 -0
- package/lib/typescript/module/license/AccountSetup.d.ts.map +1 -0
- package/lib/typescript/module/license/AccountSetup.web.d.ts +2 -0
- package/lib/typescript/module/license/AccountSetup.web.d.ts.map +1 -0
- package/lib/typescript/module/license/FeatureGate.d.ts +3 -19
- package/lib/typescript/module/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts +8 -11
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts.map +1 -1
- package/lib/typescript/module/license/index.d.ts +1 -1
- package/lib/typescript/module/license/index.d.ts.map +1 -1
- package/lib/typescript/module/license/licenseModule.d.ts +18 -31
- package/lib/typescript/module/license/licenseModule.d.ts.map +1 -1
- package/lib/typescript/module/license/tierLimits.d.ts +9 -52
- package/lib/typescript/module/license/tierLimits.d.ts.map +1 -1
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts +6 -0
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/module/stores/BaseEventStore.d.ts.map +1 -1
- package/lib/typescript/module/stores/createToolStore.d.ts.map +1 -1
- package/lib/typescript/module/stores/floatingToolStore.d.ts +27 -0
- package/lib/typescript/module/stores/floatingToolStore.d.ts.map +1 -0
- package/lib/typescript/module/stores/floatingToolStore.test.d.ts +2 -0
- package/lib/typescript/module/stores/floatingToolStore.test.d.ts.map +1 -0
- package/lib/typescript/module/sync/keyedArrays.d.ts +35 -0
- package/lib/typescript/module/sync/keyedArrays.d.ts.map +1 -0
- package/lib/typescript/module/sync/toolActionRegistry.d.ts +4 -32
- package/lib/typescript/module/sync/toolActionRegistry.d.ts.map +1 -1
- package/lib/typescript/module/sync/toolAttention.test.d.ts +2 -0
- package/lib/typescript/module/sync/toolAttention.test.d.ts.map +1 -0
- package/lib/typescript/module/sync/toolUiBridge.d.ts +25 -0
- package/lib/typescript/module/sync/toolUiBridge.d.ts.map +1 -1
- package/lib/typescript/module/sync/typedEdit.d.ts +70 -0
- package/lib/typescript/module/sync/typedEdit.d.ts.map +1 -0
- package/lib/typescript/module/sync/valuePath.d.ts +52 -0
- package/lib/typescript/module/sync/valuePath.d.ts.map +1 -0
- package/lib/typescript/module/sync/valueShape.d.ts +77 -0
- package/lib/typescript/module/sync/valueShape.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts +7 -1
- package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/index.d.ts +2 -1
- package/lib/typescript/module/ui/backgrounds/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/registry.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/types.d.ts +11 -1
- package/lib/typescript/module/ui/backgrounds/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/variants/wormhole/motion.d.ts +24 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole/motion.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole/textures.d.ts +13 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole/textures.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole.d.ts +3 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ClipboardHintBanner.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CompactRow.d.ts +8 -1
- package/lib/typescript/module/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/DraggableHeader.d.ts +4 -1
- package/lib/typescript/module/ui/components/DraggableHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ExpandablePopover.d.ts +14 -1
- package/lib/typescript/module/ui/components/ExpandablePopover.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/HeaderSearchButton.d.ts +7 -1
- package/lib/typescript/module/ui/components/HeaderSearchButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/floating/FloatingTool.d.ts +79 -0
- package/lib/typescript/module/ui/floating/FloatingTool.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/FloatingTool.web.d.ts +64 -0
- package/lib/typescript/module/ui/floating/FloatingTool.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/FloatingToolHost.d.ts +3 -0
- package/lib/typescript/module/ui/floating/FloatingToolHost.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/FloatingToolHost.web.d.ts +3 -0
- package/lib/typescript/module/ui/floating/FloatingToolHost.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/index.d.ts +7 -0
- package/lib/typescript/module/ui/floating/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/index.web.d.ts +7 -0
- package/lib/typescript/module/ui/floating/index.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/onboardingConstants.d.ts +30 -0
- package/lib/typescript/module/ui/floating/onboardingConstants.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/onboardingConstants.web.d.ts +13 -0
- package/lib/typescript/module/ui/floating/onboardingConstants.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts +2 -0
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +6 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/night/nightTheme.d.ts +10 -0
- package/lib/typescript/module/ui/night/nightTheme.d.ts.map +1 -1
- package/lib/typescript/module/ui/night/primitives.d.ts +10 -3
- package/lib/typescript/module/ui/night/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/otto/OttoSceneView.d.ts +30 -0
- package/lib/typescript/module/ui/otto/OttoSceneView.d.ts.map +1 -0
- package/lib/typescript/module/ui/otto/index.d.ts +2 -0
- package/lib/typescript/module/ui/otto/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/otto/ottoEngine.d.ts +1 -1
- package/lib/typescript/module/ui/otto/ottoEngine.d.ts.map +1 -1
- package/lib/typescript/module/ui/otto/ottoScenes.d.ts +75 -0
- package/lib/typescript/module/ui/otto/ottoScenes.d.ts.map +1 -0
- package/lib/typescript/module/utils/minimalSuperJSON.d.ts.map +1 -1
- package/package.json +25 -5
- package/scripts/generate-wormhole-textures.cjs +261 -0
- package/scripts/test-wormhole-motion.cjs +59 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.expandKeyedArrays = expandKeyedArrays;
|
|
7
|
+
exports.identityField = identityField;
|
|
8
|
+
/**
|
|
9
|
+
* Id-addressed list edits — one implementation, shared by every adapter that
|
|
10
|
+
* takes a merge patch.
|
|
11
|
+
*
|
|
12
|
+
* WHY. Resending a whole array is correct only when the caller has SEEN the
|
|
13
|
+
* whole array, and reads are capped. Measured with a 20-item list truncated to
|
|
14
|
+
* 5 (`pnpm ai:array --truncate=5`): the whole-array form scored 0/9 across three
|
|
15
|
+
* models — two refused outright, and one silently sent back only the 5 items it
|
|
16
|
+
* had been shown, destroying the other 15. Addressed edits scored 9/9.
|
|
17
|
+
*
|
|
18
|
+
* It also makes mass deletion impossible BY OMISSION: an addressed edit can only
|
|
19
|
+
* remove ids it names. Sending a real array still replaces the list, which is
|
|
20
|
+
* how a caller deliberately empties one.
|
|
21
|
+
*
|
|
22
|
+
* This lives here rather than in one adapter because react-query, zustand and
|
|
23
|
+
* network all take merge patches, and a second copy of a data-destroying safety
|
|
24
|
+
* rule is a copy that drifts.
|
|
25
|
+
*/
|
|
26
|
+
const isPlainObject = v => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
27
|
+
|
|
28
|
+
/** Fields we will treat as an item's stable identity, best first. */
|
|
29
|
+
const ID_FIELDS = ["id", "lineId", "key", "uuid", "_id", "slug", "name"];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The field that identifies items in this list, or undefined if there isn't one.
|
|
33
|
+
*
|
|
34
|
+
* Every item must carry it, and every value must be a distinct string/number —
|
|
35
|
+
* a duplicated id would make an addressed edit ambiguous, and silently picking
|
|
36
|
+
* the first match is exactly the kind of "helpful" guess that loses data.
|
|
37
|
+
*/
|
|
38
|
+
function identityField(items) {
|
|
39
|
+
if (!items.length || !items.every(isPlainObject)) return undefined;
|
|
40
|
+
const first = items[0];
|
|
41
|
+
for (const f of ID_FIELDS) {
|
|
42
|
+
if (!(f in first)) continue;
|
|
43
|
+
const values = items.map(it => it[f]);
|
|
44
|
+
const usable = values.every(v => typeof v === "string" || typeof v === "number");
|
|
45
|
+
if (!usable) continue;
|
|
46
|
+
if (new Set(values.map(String)).size !== values.length) continue;
|
|
47
|
+
return f;
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The identity an ADDED item should carry.
|
|
54
|
+
*
|
|
55
|
+
* `Object.entries` hands back STRING keys, so `{"9901": {id: 9901, …}}` was
|
|
56
|
+
* written as `{id: "9901"}` — the caller's own numeric id replaced by text, and
|
|
57
|
+
* then refused by the typed-edit guard as `[2].id: number → string`. The caller
|
|
58
|
+
* recovers by resending the WHOLE array, which is exactly the truncation-unsafe
|
|
59
|
+
* move this module exists to prevent. Measured on a live QA run: one added
|
|
60
|
+
* offer cost a refusal, a full-list retransmission and 35 seconds.
|
|
61
|
+
*
|
|
62
|
+
* So the id the caller WROTE wins. With no id in the body, the key is coerced
|
|
63
|
+
* to the type the existing items use, and only when the text round-trips
|
|
64
|
+
* exactly: "007" is not 7, and inventing that identity is worse than a refusal
|
|
65
|
+
* the caller can read.
|
|
66
|
+
*/
|
|
67
|
+
function identityForAdd(current, idField, key, edit) {
|
|
68
|
+
const supplied = edit[idField];
|
|
69
|
+
if (typeof supplied === "string" || typeof supplied === "number") {
|
|
70
|
+
// An item whose id disagrees with the address it was sent under is
|
|
71
|
+
// ambiguous — either could be the one the caller meant. Say so rather than
|
|
72
|
+
// silently picking one and writing an item nobody asked for.
|
|
73
|
+
if (String(supplied) !== key) {
|
|
74
|
+
return {
|
|
75
|
+
ok: false,
|
|
76
|
+
error: `The new item is addressed as \`${key}\` but carries \`${idField}\`: ${JSON.stringify(supplied)}. Use the same value for both — address it by the id it carries.`
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
ok: true,
|
|
81
|
+
value: supplied
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const numericList = current.every(it => typeof it[idField] === "number");
|
|
85
|
+
if (numericList && key.trim() !== "" && String(Number(key)) === key) {
|
|
86
|
+
return {
|
|
87
|
+
ok: true,
|
|
88
|
+
value: Number(key)
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
ok: true,
|
|
93
|
+
value: key
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Let a caller address list items by their own id instead of resending the list.
|
|
99
|
+
*
|
|
100
|
+
* { lines: { "seed-1": { qty: 5 } } } change one field of one item
|
|
101
|
+
* { lines: { "seed-2": null } } remove that item
|
|
102
|
+
* { lines: { "new-1": { …all fields… } } } append (id not already present)
|
|
103
|
+
*
|
|
104
|
+
* WHY THIS EXISTS. Resending the whole array is correct only when the caller has
|
|
105
|
+
* SEEN the whole array, and reads are capped — so on a long list the honest
|
|
106
|
+
* agents refuse and the careless ones send back only the items they were shown,
|
|
107
|
+
* silently destroying the rest. Measured: with a 20-item bag truncated to 5, the
|
|
108
|
+
* whole-array form scored 0/9 across three models and one of them deleted 15
|
|
109
|
+
* lines without a word. Addressed edits scored 9/9. (`pnpm ai:array`.)
|
|
110
|
+
*
|
|
111
|
+
* It also makes mass deletion impossible BY OMISSION: `lines: []` empties a bag,
|
|
112
|
+
* but a keyed edit can only remove ids it names.
|
|
113
|
+
*
|
|
114
|
+
* Returns the patch with keyed objects expanded into real arrays, so everything
|
|
115
|
+
* downstream — the typed-edit guard, the receipt, the store write — is unchanged
|
|
116
|
+
* and keeps all of its protections.
|
|
117
|
+
*/
|
|
118
|
+
function expandKeyedArrays(current, patch, path = "", notes = []) {
|
|
119
|
+
if (Array.isArray(current) && isPlainObject(patch)) {
|
|
120
|
+
const idField = identityField(current);
|
|
121
|
+
if (!idField) {
|
|
122
|
+
// No stable identity: leave it alone and let the normal guard report the
|
|
123
|
+
// object-vs-array type change, which says something truer than we could.
|
|
124
|
+
return {
|
|
125
|
+
patch,
|
|
126
|
+
notes
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
const byId = new Map(current.map(it => [String(it[idField]), it]));
|
|
130
|
+
const next = current.slice();
|
|
131
|
+
let removed = 0;
|
|
132
|
+
let changed = 0;
|
|
133
|
+
let added = 0;
|
|
134
|
+
for (const [id, edit] of Object.entries(patch)) {
|
|
135
|
+
const i = next.findIndex(it => String(it[idField]) === id);
|
|
136
|
+
if (edit === null) {
|
|
137
|
+
if (i === -1) return {
|
|
138
|
+
patch,
|
|
139
|
+
notes
|
|
140
|
+
};
|
|
141
|
+
next.splice(i, 1);
|
|
142
|
+
removed++;
|
|
143
|
+
} else if (i === -1) {
|
|
144
|
+
if (!isPlainObject(edit)) return {
|
|
145
|
+
patch,
|
|
146
|
+
notes
|
|
147
|
+
};
|
|
148
|
+
const identity = identityForAdd(current, idField, id, edit);
|
|
149
|
+
if (!identity.ok) {
|
|
150
|
+
return {
|
|
151
|
+
patch,
|
|
152
|
+
notes,
|
|
153
|
+
error: identity.error
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
next.push({
|
|
157
|
+
...edit,
|
|
158
|
+
[idField]: identity.value
|
|
159
|
+
});
|
|
160
|
+
added++;
|
|
161
|
+
} else {
|
|
162
|
+
const merged = expandKeyedArrays(byId.get(id), edit, `${path}[${id}]`, notes);
|
|
163
|
+
if (merged.error) return {
|
|
164
|
+
patch,
|
|
165
|
+
notes,
|
|
166
|
+
error: merged.error
|
|
167
|
+
};
|
|
168
|
+
const base = next[i];
|
|
169
|
+
next[i] = isPlainObject(base) && isPlainObject(merged.patch) ? {
|
|
170
|
+
...base,
|
|
171
|
+
...merged.patch
|
|
172
|
+
} : merged.patch;
|
|
173
|
+
changed++;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
notes.push(`${path || "(root)"}: addressed by \`${idField}\` — ${changed} changed, ${added} added, ${removed} removed, ${next.length} item(s) remain`);
|
|
177
|
+
return {
|
|
178
|
+
patch: next,
|
|
179
|
+
notes
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
if (isPlainObject(current) && isPlainObject(patch)) {
|
|
183
|
+
const outPatch = {};
|
|
184
|
+
for (const [k, v] of Object.entries(patch)) {
|
|
185
|
+
const p = path ? `${path}.${k}` : k;
|
|
186
|
+
if (!(k in current)) {
|
|
187
|
+
outPatch[k] = v;
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
const inner = expandKeyedArrays(current[k], v, p, notes);
|
|
191
|
+
// A refusal deep in the tree is the whole patch's refusal: writing the
|
|
192
|
+
// rest of it would apply half of what the caller asked for.
|
|
193
|
+
if (inner.error) return {
|
|
194
|
+
patch,
|
|
195
|
+
notes,
|
|
196
|
+
error: inner.error
|
|
197
|
+
};
|
|
198
|
+
outPatch[k] = inner.patch;
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
patch: outPatch,
|
|
202
|
+
notes
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
patch,
|
|
207
|
+
notes
|
|
208
|
+
};
|
|
209
|
+
}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.dispatchToolAction = dispatchToolAction;
|
|
7
7
|
exports.getToolAdapters = getToolAdapters;
|
|
8
|
+
exports.guardToolAdapter = guardToolAdapter;
|
|
8
9
|
exports.isToolRegistryReady = isToolRegistryReady;
|
|
9
10
|
exports.listSnapshotToolIds = listSnapshotToolIds;
|
|
10
11
|
exports.listToolActions = listToolActions;
|
|
@@ -12,6 +13,7 @@ exports.listToolIds = listToolIds;
|
|
|
12
13
|
exports.readToolSnapshot = readToolSnapshot;
|
|
13
14
|
exports.registerToolAdapters = registerToolAdapters;
|
|
14
15
|
exports.waitForToolRegistry = waitForToolRegistry;
|
|
16
|
+
var _licenseModule = require("../license/licenseModule.js");
|
|
15
17
|
/**
|
|
16
18
|
* toolActionRegistry — the on-device twin of the broker's action dispatch.
|
|
17
19
|
*
|
|
@@ -68,13 +70,45 @@ function sources() {
|
|
|
68
70
|
function registerToolAdapters(getTools) {
|
|
69
71
|
const set = sources();
|
|
70
72
|
set.add(getTools);
|
|
73
|
+
let disposed = false;
|
|
74
|
+
const dispose = () => {
|
|
75
|
+
if (disposed) return;
|
|
76
|
+
disposed = true;
|
|
77
|
+
const raw = getTools();
|
|
78
|
+
// Private inverse operations only. No credential bypass reaches public dispatch.
|
|
79
|
+
const cleanup = async (toolId, action, params) => {
|
|
80
|
+
if (!(toolId === "network" && action === "deleteOverrideRule" || toolId === "impersonate" && action === "stopImpersonation")) {
|
|
81
|
+
throw new Error("Unsupported account-lock cleanup operation");
|
|
82
|
+
}
|
|
83
|
+
if (toolId === "impersonate") return raw[toolId]?.dispose?.(cleanup);
|
|
84
|
+
const fn = raw[toolId]?.actions?.[action];
|
|
85
|
+
if (!fn) throw new Error(`Cleanup unavailable for ${toolId}`);
|
|
86
|
+
return fn(params);
|
|
87
|
+
};
|
|
88
|
+
for (const adapter of Object.values(raw)) {
|
|
89
|
+
try {
|
|
90
|
+
Promise.resolve(adapter.dispose?.(cleanup)).catch(error => console.warn("[Buoy] Tool cleanup failed", error));
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.warn("[Buoy] Tool cleanup failed", error);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const off = (0, _licenseModule.subscribeAccountAccess)(() => {
|
|
97
|
+
if (!(0, _licenseModule.hasAccountAccess)()) dispose();else disposed = false;
|
|
98
|
+
});
|
|
71
99
|
return () => {
|
|
100
|
+
off();
|
|
72
101
|
set.delete(getTools);
|
|
102
|
+
// A second provider still owns these adapters during Strict Mode/remount.
|
|
103
|
+
Promise.resolve().then(() => {
|
|
104
|
+
if (set.size === 0) dispose();
|
|
105
|
+
});
|
|
73
106
|
};
|
|
74
107
|
}
|
|
75
108
|
|
|
76
109
|
/** The merged adapter map across every live source. */
|
|
77
110
|
function getToolAdapters() {
|
|
111
|
+
if (!(0, _licenseModule.hasAccountAccess)()) return {};
|
|
78
112
|
const merged = {};
|
|
79
113
|
for (const get of sources()) {
|
|
80
114
|
try {
|
|
@@ -83,7 +117,7 @@ function getToolAdapters() {
|
|
|
83
117
|
// A source that throws must not take the whole registry down.
|
|
84
118
|
}
|
|
85
119
|
}
|
|
86
|
-
return merged;
|
|
120
|
+
return Object.fromEntries(Object.entries(merged).map(([id, adapter]) => [id, guardToolAdapter(adapter)]));
|
|
87
121
|
}
|
|
88
122
|
|
|
89
123
|
/** Tool ids currently dispatchable. */
|
|
@@ -123,6 +157,7 @@ function listSnapshotToolIds() {
|
|
|
123
157
|
* an adapter is free to make this a promise later without breaking them.
|
|
124
158
|
*/
|
|
125
159
|
async function readToolSnapshot(toolId) {
|
|
160
|
+
(0, _licenseModule.assertAccountAccess)();
|
|
126
161
|
const tools = getToolAdapters();
|
|
127
162
|
const adapter = tools[toolId];
|
|
128
163
|
if (!adapter) throw new Error(`Unknown tool "${toolId}"`);
|
|
@@ -132,7 +167,7 @@ async function readToolSnapshot(toolId) {
|
|
|
132
167
|
return await adapter.getSnapshot();
|
|
133
168
|
}
|
|
134
169
|
function isToolRegistryReady() {
|
|
135
|
-
return sources().size > 0;
|
|
170
|
+
return (0, _licenseModule.hasAccountAccess)() && sources().size > 0;
|
|
136
171
|
}
|
|
137
172
|
|
|
138
173
|
/**
|
|
@@ -141,6 +176,7 @@ function isToolRegistryReady() {
|
|
|
141
176
|
* surface as plain messages rather than objects nobody can read on a phone.
|
|
142
177
|
*/
|
|
143
178
|
async function dispatchToolAction(toolId, action, params) {
|
|
179
|
+
(0, _licenseModule.assertAccountAccess)();
|
|
144
180
|
const tools = getToolAdapters();
|
|
145
181
|
const tool = tools[toolId];
|
|
146
182
|
const fn = tool?.actions?.[action];
|
|
@@ -163,4 +199,51 @@ async function waitForToolRegistry(timeoutMs = 2000) {
|
|
|
163
199
|
if (isToolRegistryReady()) return true;
|
|
164
200
|
}
|
|
165
201
|
return false;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** Guard retained references too, and discard results completed after revocation. */
|
|
205
|
+
function guardToolAdapter(adapter) {
|
|
206
|
+
const guard = fn => (...args) => {
|
|
207
|
+
(0, _licenseModule.assertAccountAccess)();
|
|
208
|
+
let revoked = false;
|
|
209
|
+
const off = (0, _licenseModule.subscribeAccountAccess)(() => {
|
|
210
|
+
if (!(0, _licenseModule.hasAccountAccess)()) revoked = true;
|
|
211
|
+
});
|
|
212
|
+
const check = () => {
|
|
213
|
+
if (revoked) throw new Error("Buoy account access ended while the operation was pending.");
|
|
214
|
+
(0, _licenseModule.assertAccountAccess)();
|
|
215
|
+
};
|
|
216
|
+
try {
|
|
217
|
+
const result = fn.apply(adapter, args);
|
|
218
|
+
if (result && typeof result.then === "function") {
|
|
219
|
+
return Promise.resolve(result).then(value => {
|
|
220
|
+
check();
|
|
221
|
+
return value;
|
|
222
|
+
}).finally(off);
|
|
223
|
+
}
|
|
224
|
+
check();
|
|
225
|
+
off();
|
|
226
|
+
return result;
|
|
227
|
+
} catch (error) {
|
|
228
|
+
off();
|
|
229
|
+
throw error;
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
return {
|
|
233
|
+
...adapter,
|
|
234
|
+
...(adapter.getSnapshot ? {
|
|
235
|
+
getSnapshot: guard(adapter.getSnapshot)
|
|
236
|
+
} : {}),
|
|
237
|
+
...(adapter.actions ? {
|
|
238
|
+
actions: Object.fromEntries(Object.entries(adapter.actions).map(([name, action]) => [name, guard(action)]))
|
|
239
|
+
} : {}),
|
|
240
|
+
...(adapter.subscribe ? {
|
|
241
|
+
subscribe: listener => {
|
|
242
|
+
(0, _licenseModule.assertAccountAccess)();
|
|
243
|
+
return adapter.subscribe(() => {
|
|
244
|
+
if ((0, _licenseModule.hasAccountAccess)()) listener();
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
} : {})
|
|
248
|
+
};
|
|
166
249
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _vitest = require("vitest");
|
|
4
|
+
var _toolUiBridge = require("./toolUiBridge.js");
|
|
5
|
+
/**
|
|
6
|
+
* The attention badge seam: a tool says "I need you" and the rail hears it.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
(0, _vitest.describe)("toolAttention", () => {
|
|
10
|
+
(0, _vitest.it)("stores, replaces and clears a badge, notifying once per change", () => {
|
|
11
|
+
const fn = _vitest.vi.fn();
|
|
12
|
+
const off = (0, _toolUiBridge.subscribeToolAttention)(fn);
|
|
13
|
+
(0, _toolUiBridge.setToolAttention)("ask-buoy", {
|
|
14
|
+
kind: "needsInput",
|
|
15
|
+
label: "Needs your approval"
|
|
16
|
+
});
|
|
17
|
+
(0, _vitest.expect)((0, _toolUiBridge.getToolAttention)("ask-buoy")).toEqual({
|
|
18
|
+
kind: "needsInput",
|
|
19
|
+
label: "Needs your approval"
|
|
20
|
+
});
|
|
21
|
+
(0, _vitest.expect)(fn).toHaveBeenCalledTimes(1);
|
|
22
|
+
// Same value again is not a change.
|
|
23
|
+
(0, _toolUiBridge.setToolAttention)("ask-buoy", {
|
|
24
|
+
kind: "needsInput",
|
|
25
|
+
label: "Needs your approval"
|
|
26
|
+
});
|
|
27
|
+
(0, _vitest.expect)(fn).toHaveBeenCalledTimes(1);
|
|
28
|
+
(0, _toolUiBridge.setToolAttention)("ask-buoy", {
|
|
29
|
+
kind: "done",
|
|
30
|
+
label: "Finished"
|
|
31
|
+
});
|
|
32
|
+
(0, _vitest.expect)(fn).toHaveBeenCalledTimes(2);
|
|
33
|
+
(0, _toolUiBridge.setToolAttention)("ask-buoy", null);
|
|
34
|
+
(0, _vitest.expect)((0, _toolUiBridge.getToolAttention)("ask-buoy")).toBeNull();
|
|
35
|
+
(0, _vitest.expect)(fn).toHaveBeenCalledTimes(3);
|
|
36
|
+
// Clearing what is already clear is silent.
|
|
37
|
+
(0, _toolUiBridge.setToolAttention)("ask-buoy", null);
|
|
38
|
+
(0, _vitest.expect)(fn).toHaveBeenCalledTimes(3);
|
|
39
|
+
off();
|
|
40
|
+
});
|
|
41
|
+
(0, _vitest.it)("keeps tools apart", () => {
|
|
42
|
+
(0, _toolUiBridge.setToolAttention)("a", {
|
|
43
|
+
kind: "failed",
|
|
44
|
+
label: "x"
|
|
45
|
+
});
|
|
46
|
+
(0, _toolUiBridge.setToolAttention)("b", null);
|
|
47
|
+
(0, _vitest.expect)((0, _toolUiBridge.getToolAttention)("a")?.kind).toBe("failed");
|
|
48
|
+
(0, _vitest.expect)((0, _toolUiBridge.getToolAttention)("b")).toBeNull();
|
|
49
|
+
(0, _toolUiBridge.setToolAttention)("a", null);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.canOpenBuoyTools = canOpenBuoyTools;
|
|
7
|
+
exports.getToolAttention = getToolAttention;
|
|
7
8
|
exports.openBuoyTool = openBuoyTool;
|
|
8
9
|
exports.registerToolOpener = registerToolOpener;
|
|
10
|
+
exports.setToolAttention = setToolAttention;
|
|
11
|
+
exports.subscribeToolAttention = subscribeToolAttention;
|
|
9
12
|
/**
|
|
10
13
|
* toolUiBridge — let a tool ask the host to bring another tool back on screen.
|
|
11
14
|
*
|
|
@@ -71,4 +74,59 @@ function openBuoyTool(toolId) {
|
|
|
71
74
|
/** True when some host is listening — for deciding whether to offer the button. */
|
|
72
75
|
function canOpenBuoyTools() {
|
|
73
76
|
return openers().size > 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// ─── Attention ───────────────────────────────────────────────────────────────
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* "This tool needs you" — shown as a badge on its chip in the minimized rail.
|
|
83
|
+
*
|
|
84
|
+
* The case: Ask Buoy is minimized so a tester can watch the app, and the
|
|
85
|
+
* agent hits a step that needs a tap. Nobody can see the card. The sheet used
|
|
86
|
+
* to fail safe by DECLINING the change and ending the turn — which made
|
|
87
|
+
* minimize mean "stop", the opposite of what it is for. Now the approval
|
|
88
|
+
* holds, the chip gets a badge, and tapping the chip (the existing restore
|
|
89
|
+
* path) brings the card back. Same seam shape as the opener above: the rail
|
|
90
|
+
* lives inside the host, the tool cannot import the host, so it publishes
|
|
91
|
+
* through a global.
|
|
92
|
+
*
|
|
93
|
+
* `done` and `failed` cover the other thing a hidden tool cannot say — that
|
|
94
|
+
* the work you minimized it to wait for has finished.
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
const ATTENTION_KEY = "__buoyToolAttention";
|
|
98
|
+
function attention() {
|
|
99
|
+
const g = globalThis;
|
|
100
|
+
if (!g[ATTENTION_KEY]) g[ATTENTION_KEY] = {
|
|
101
|
+
byTool: new Map(),
|
|
102
|
+
listeners: new Set()
|
|
103
|
+
};
|
|
104
|
+
return g[ATTENTION_KEY];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Set, replace or (with null) clear a tool's badge. No-op when nothing changed. */
|
|
108
|
+
function setToolAttention(toolId, next) {
|
|
109
|
+
const store = attention();
|
|
110
|
+
const prev = store.byTool.get(toolId) ?? null;
|
|
111
|
+
if (prev === next || prev && next && prev.kind === next.kind && prev.label === next.label) return;
|
|
112
|
+
if (next) store.byTool.set(toolId, next);else store.byTool.delete(toolId);
|
|
113
|
+
for (const fn of store.listeners) {
|
|
114
|
+
try {
|
|
115
|
+
fn();
|
|
116
|
+
} catch {
|
|
117
|
+
// A throwing subscriber must not stop the others from hearing.
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function getToolAttention(toolId) {
|
|
122
|
+
return attention().byTool.get(toolId) ?? null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** For `useSyncExternalStore` in the rail. */
|
|
126
|
+
function subscribeToolAttention(fn) {
|
|
127
|
+
const store = attention();
|
|
128
|
+
store.listeners.add(fn);
|
|
129
|
+
return () => {
|
|
130
|
+
store.listeners.delete(fn);
|
|
131
|
+
};
|
|
74
132
|
}
|