@intentcomputing/koko-agent-sdk 1.0.1
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/CHANGELOG.md +10 -0
- package/CODE_OF_CONDUCT.md +3 -0
- package/CONTRIBUTING.md +9 -0
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/README.zh-CN.md +50 -0
- package/SECURITY.md +5 -0
- package/android/build.gradle +40 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/cn/intentcomputing/kokoagentsdk/KokoAgentSdkModule.java +1356 -0
- package/android/src/main/java/cn/intentcomputing/kokoagentsdk/KokoAgentSdkPackage.java +23 -0
- package/docs/INTEGRATION.md +168 -0
- package/docs/INTEGRATION.zh-CN.md +140 -0
- package/docs/PRIVACY.md +11 -0
- package/docs/PRIVACY.zh-CN.md +11 -0
- package/docs/PUBLISH.md +11 -0
- package/docs/PUBLISH.zh-CN.md +11 -0
- package/ios/KokoAgentSdk/KokoAgentSdk.h +5 -0
- package/ios/KokoAgentSdk/KokoAgentSdk.m +2464 -0
- package/ios/KokoAgentSdk/KokoOcrBounds.h +20 -0
- package/ios/KokoAgentSdk/KokoScrollBounds.h +21 -0
- package/koko-agent-sdk.podspec +23 -0
- package/lib/commonjs/KokoAgent.js +1427 -0
- package/lib/commonjs/KokoAgent.js.map +1 -0
- package/lib/commonjs/assist/OnDeviceAssist.js +94 -0
- package/lib/commonjs/assist/OnDeviceAssist.js.map +1 -0
- package/lib/commonjs/assist/intentClassify.js +100 -0
- package/lib/commonjs/assist/intentClassify.js.map +1 -0
- package/lib/commonjs/assist/nodeRank.js +120 -0
- package/lib/commonjs/assist/nodeRank.js.map +1 -0
- package/lib/commonjs/assist/ocrTarget.js +135 -0
- package/lib/commonjs/assist/ocrTarget.js.map +1 -0
- package/lib/commonjs/assist/webVisualChange.js +29 -0
- package/lib/commonjs/assist/webVisualChange.js.map +1 -0
- package/lib/commonjs/client/ActionOutcomeUnknownError.js +28 -0
- package/lib/commonjs/client/ActionOutcomeUnknownError.js.map +1 -0
- package/lib/commonjs/client/AgentSession.js +858 -0
- package/lib/commonjs/client/AgentSession.js.map +1 -0
- package/lib/commonjs/client/GatewayClient.js +302 -0
- package/lib/commonjs/client/GatewayClient.js.map +1 -0
- package/lib/commonjs/client/OperationReplayGuard.js +62 -0
- package/lib/commonjs/client/OperationReplayGuard.js.map +1 -0
- package/lib/commonjs/client/RunCheckpoint.js +139 -0
- package/lib/commonjs/client/RunCheckpoint.js.map +1 -0
- package/lib/commonjs/client/loopDetect.js +184 -0
- package/lib/commonjs/client/loopDetect.js.map +1 -0
- package/lib/commonjs/client/recentSearch.js +50 -0
- package/lib/commonjs/client/recentSearch.js.map +1 -0
- package/lib/commonjs/client/walletChoiceGuard.js +18 -0
- package/lib/commonjs/client/walletChoiceGuard.js.map +1 -0
- package/lib/commonjs/client/webResultCategory.js +38 -0
- package/lib/commonjs/client/webResultCategory.js.map +1 -0
- package/lib/commonjs/commercial/AccountStore.js +78 -0
- package/lib/commonjs/commercial/AccountStore.js.map +1 -0
- package/lib/commonjs/commercial/AgentDebug.js +104 -0
- package/lib/commonjs/commercial/AgentDebug.js.map +1 -0
- package/lib/commonjs/commercial/ExecutionGuard.js +53 -0
- package/lib/commonjs/commercial/ExecutionGuard.js.map +1 -0
- package/lib/commonjs/commercial/UsageBus.js +42 -0
- package/lib/commonjs/commercial/UsageBus.js.map +1 -0
- package/lib/commonjs/commercial/branding.js +69 -0
- package/lib/commonjs/commercial/branding.js.map +1 -0
- package/lib/commonjs/commercial/devMode.js +52 -0
- package/lib/commonjs/commercial/devMode.js.map +1 -0
- package/lib/commonjs/commercial/trust.js +69 -0
- package/lib/commonjs/commercial/trust.js.map +1 -0
- package/lib/commonjs/confirmation/gate.js +62 -0
- package/lib/commonjs/confirmation/gate.js.map +1 -0
- package/lib/commonjs/cursor/CursorOverlay.js +141 -0
- package/lib/commonjs/cursor/CursorOverlay.js.map +1 -0
- package/lib/commonjs/cursor/PointerHand.js +51 -0
- package/lib/commonjs/cursor/PointerHand.js.map +1 -0
- package/lib/commonjs/cursor/controller.js +91 -0
- package/lib/commonjs/cursor/controller.js.map +1 -0
- package/lib/commonjs/cursor/pointer.js +49 -0
- package/lib/commonjs/cursor/pointer.js.map +1 -0
- package/lib/commonjs/debug/KokoRemoteSmoke.js +611 -0
- package/lib/commonjs/debug/KokoRemoteSmoke.js.map +1 -0
- package/lib/commonjs/explore/ExplorationGraph.js +418 -0
- package/lib/commonjs/explore/ExplorationGraph.js.map +1 -0
- package/lib/commonjs/explore/bootstrapExplore.js +59 -0
- package/lib/commonjs/explore/bootstrapExplore.js.map +1 -0
- package/lib/commonjs/host/HostActions.js +266 -0
- package/lib/commonjs/host/HostActions.js.map +1 -0
- package/lib/commonjs/i18n/index.js +169 -0
- package/lib/commonjs/i18n/index.js.map +1 -0
- package/lib/commonjs/i18n/runtimeMessages.js +184 -0
- package/lib/commonjs/i18n/runtimeMessages.js.map +1 -0
- package/lib/commonjs/index.js +640 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/native/NativeBridge.js +132 -0
- package/lib/commonjs/native/NativeBridge.js.map +1 -0
- package/lib/commonjs/native/navigationLabel.js +16 -0
- package/lib/commonjs/native/navigationLabel.js.map +1 -0
- package/lib/commonjs/native/normalizeViewTree.js +28 -0
- package/lib/commonjs/native/normalizeViewTree.js.map +1 -0
- package/lib/commonjs/native/pruneOffscreen.js +76 -0
- package/lib/commonjs/native/pruneOffscreen.js.map +1 -0
- package/lib/commonjs/native/scrollViewport.js +69 -0
- package/lib/commonjs/native/scrollViewport.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/privacy/redact.js +108 -0
- package/lib/commonjs/privacy/redact.js.map +1 -0
- package/lib/commonjs/privacy/screenEvidence.js +59 -0
- package/lib/commonjs/privacy/screenEvidence.js.map +1 -0
- package/lib/commonjs/privacy/screenModel.js +404 -0
- package/lib/commonjs/privacy/screenModel.js.map +1 -0
- package/lib/commonjs/privacy/sensitiveScreen.js +58 -0
- package/lib/commonjs/privacy/sensitiveScreen.js.map +1 -0
- package/lib/commonjs/privacy/userGate.js +213 -0
- package/lib/commonjs/privacy/userGate.js.map +1 -0
- package/lib/commonjs/protocol/actions.js +112 -0
- package/lib/commonjs/protocol/actions.js.map +1 -0
- package/lib/commonjs/provider/HostAppearanceStore.js +111 -0
- package/lib/commonjs/provider/HostAppearanceStore.js.map +1 -0
- package/lib/commonjs/provider/KokoProvider.js +81 -0
- package/lib/commonjs/provider/KokoProvider.js.map +1 -0
- package/lib/commonjs/provider/KokoUiContext.js +102 -0
- package/lib/commonjs/provider/KokoUiContext.js.map +1 -0
- package/lib/commonjs/selector/match.js +378 -0
- package/lib/commonjs/selector/match.js.map +1 -0
- package/lib/commonjs/task/TaskStore.js +361 -0
- package/lib/commonjs/task/TaskStore.js.map +1 -0
- package/lib/commonjs/task/types.js +2 -0
- package/lib/commonjs/task/types.js.map +1 -0
- package/lib/commonjs/task/useTaskStore.js +14 -0
- package/lib/commonjs/task/useTaskStore.js.map +1 -0
- package/lib/commonjs/types.js +2 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/ui/KokoChatSheet.js +885 -0
- package/lib/commonjs/ui/KokoChatSheet.js.map +1 -0
- package/lib/commonjs/ui/KokoComposer.js +161 -0
- package/lib/commonjs/ui/KokoComposer.js.map +1 -0
- package/lib/commonjs/ui/KokoDialogHost.js +254 -0
- package/lib/commonjs/ui/KokoDialogHost.js.map +1 -0
- package/lib/commonjs/ui/KokoEntryButton.js +81 -0
- package/lib/commonjs/ui/KokoEntryButton.js.map +1 -0
- package/lib/commonjs/ui/KokoObserver.js +522 -0
- package/lib/commonjs/ui/KokoObserver.js.map +1 -0
- package/lib/commonjs/ui/KokoOverlayLayer.js +45 -0
- package/lib/commonjs/ui/KokoOverlayLayer.js.map +1 -0
- package/lib/commonjs/ui/KokoSubtitle.js +95 -0
- package/lib/commonjs/ui/KokoSubtitle.js.map +1 -0
- package/lib/commonjs/ui/KokoTaskPanel.js +322 -0
- package/lib/commonjs/ui/KokoTaskPanel.js.map +1 -0
- package/lib/commonjs/ui/hostOverlay.js +126 -0
- package/lib/commonjs/ui/hostOverlay.js.map +1 -0
- package/lib/commonjs/ui/icons.js +132 -0
- package/lib/commonjs/ui/icons.js.map +1 -0
- package/lib/commonjs/ui/progressChrome.js +66 -0
- package/lib/commonjs/ui/progressChrome.js.map +1 -0
- package/lib/commonjs/ui/safeArea.js +96 -0
- package/lib/commonjs/ui/safeArea.js.map +1 -0
- package/lib/commonjs/ui/useOverlayOrigin.js +40 -0
- package/lib/commonjs/ui/useOverlayOrigin.js.map +1 -0
- package/lib/module/KokoAgent.js +1418 -0
- package/lib/module/KokoAgent.js.map +1 -0
- package/lib/module/assist/OnDeviceAssist.js +89 -0
- package/lib/module/assist/OnDeviceAssist.js.map +1 -0
- package/lib/module/assist/intentClassify.js +95 -0
- package/lib/module/assist/intentClassify.js.map +1 -0
- package/lib/module/assist/nodeRank.js +115 -0
- package/lib/module/assist/nodeRank.js.map +1 -0
- package/lib/module/assist/ocrTarget.js +123 -0
- package/lib/module/assist/ocrTarget.js.map +1 -0
- package/lib/module/assist/webVisualChange.js +24 -0
- package/lib/module/assist/webVisualChange.js.map +1 -0
- package/lib/module/client/ActionOutcomeUnknownError.js +23 -0
- package/lib/module/client/ActionOutcomeUnknownError.js.map +1 -0
- package/lib/module/client/AgentSession.js +854 -0
- package/lib/module/client/AgentSession.js.map +1 -0
- package/lib/module/client/GatewayClient.js +293 -0
- package/lib/module/client/GatewayClient.js.map +1 -0
- package/lib/module/client/OperationReplayGuard.js +58 -0
- package/lib/module/client/OperationReplayGuard.js.map +1 -0
- package/lib/module/client/RunCheckpoint.js +135 -0
- package/lib/module/client/RunCheckpoint.js.map +1 -0
- package/lib/module/client/loopDetect.js +177 -0
- package/lib/module/client/loopDetect.js.map +1 -0
- package/lib/module/client/recentSearch.js +46 -0
- package/lib/module/client/recentSearch.js.map +1 -0
- package/lib/module/client/walletChoiceGuard.js +14 -0
- package/lib/module/client/walletChoiceGuard.js.map +1 -0
- package/lib/module/client/webResultCategory.js +34 -0
- package/lib/module/client/webResultCategory.js.map +1 -0
- package/lib/module/commercial/AccountStore.js +75 -0
- package/lib/module/commercial/AccountStore.js.map +1 -0
- package/lib/module/commercial/AgentDebug.js +99 -0
- package/lib/module/commercial/AgentDebug.js.map +1 -0
- package/lib/module/commercial/ExecutionGuard.js +49 -0
- package/lib/module/commercial/ExecutionGuard.js.map +1 -0
- package/lib/module/commercial/UsageBus.js +38 -0
- package/lib/module/commercial/UsageBus.js.map +1 -0
- package/lib/module/commercial/branding.js +63 -0
- package/lib/module/commercial/branding.js.map +1 -0
- package/lib/module/commercial/devMode.js +45 -0
- package/lib/module/commercial/devMode.js.map +1 -0
- package/lib/module/commercial/trust.js +62 -0
- package/lib/module/commercial/trust.js.map +1 -0
- package/lib/module/confirmation/gate.js +54 -0
- package/lib/module/confirmation/gate.js.map +1 -0
- package/lib/module/cursor/CursorOverlay.js +136 -0
- package/lib/module/cursor/CursorOverlay.js.map +1 -0
- package/lib/module/cursor/PointerHand.js +47 -0
- package/lib/module/cursor/PointerHand.js.map +1 -0
- package/lib/module/cursor/controller.js +87 -0
- package/lib/module/cursor/controller.js.map +1 -0
- package/lib/module/cursor/pointer.js +45 -0
- package/lib/module/cursor/pointer.js.map +1 -0
- package/lib/module/debug/KokoRemoteSmoke.js +608 -0
- package/lib/module/debug/KokoRemoteSmoke.js.map +1 -0
- package/lib/module/explore/ExplorationGraph.js +406 -0
- package/lib/module/explore/ExplorationGraph.js.map +1 -0
- package/lib/module/explore/bootstrapExplore.js +55 -0
- package/lib/module/explore/bootstrapExplore.js.map +1 -0
- package/lib/module/host/HostActions.js +255 -0
- package/lib/module/host/HostActions.js.map +1 -0
- package/lib/module/i18n/index.js +159 -0
- package/lib/module/i18n/index.js.map +1 -0
- package/lib/module/i18n/runtimeMessages.js +180 -0
- package/lib/module/i18n/runtimeMessages.js.map +1 -0
- package/lib/module/index.js +44 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/NativeBridge.js +128 -0
- package/lib/module/native/NativeBridge.js.map +1 -0
- package/lib/module/native/navigationLabel.js +12 -0
- package/lib/module/native/navigationLabel.js.map +1 -0
- package/lib/module/native/normalizeViewTree.js +25 -0
- package/lib/module/native/normalizeViewTree.js.map +1 -0
- package/lib/module/native/pruneOffscreen.js +72 -0
- package/lib/module/native/pruneOffscreen.js.map +1 -0
- package/lib/module/native/scrollViewport.js +63 -0
- package/lib/module/native/scrollViewport.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/privacy/redact.js +103 -0
- package/lib/module/privacy/redact.js.map +1 -0
- package/lib/module/privacy/screenEvidence.js +50 -0
- package/lib/module/privacy/screenEvidence.js.map +1 -0
- package/lib/module/privacy/screenModel.js +397 -0
- package/lib/module/privacy/screenModel.js.map +1 -0
- package/lib/module/privacy/sensitiveScreen.js +52 -0
- package/lib/module/privacy/sensitiveScreen.js.map +1 -0
- package/lib/module/privacy/userGate.js +202 -0
- package/lib/module/privacy/userGate.js.map +1 -0
- package/lib/module/protocol/actions.js +108 -0
- package/lib/module/protocol/actions.js.map +1 -0
- package/lib/module/provider/HostAppearanceStore.js +101 -0
- package/lib/module/provider/HostAppearanceStore.js.map +1 -0
- package/lib/module/provider/KokoProvider.js +74 -0
- package/lib/module/provider/KokoProvider.js.map +1 -0
- package/lib/module/provider/KokoUiContext.js +96 -0
- package/lib/module/provider/KokoUiContext.js.map +1 -0
- package/lib/module/selector/match.js +366 -0
- package/lib/module/selector/match.js.map +1 -0
- package/lib/module/task/TaskStore.js +356 -0
- package/lib/module/task/TaskStore.js.map +1 -0
- package/lib/module/task/types.js +2 -0
- package/lib/module/task/types.js.map +1 -0
- package/lib/module/task/useTaskStore.js +10 -0
- package/lib/module/task/useTaskStore.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/ui/KokoChatSheet.js +879 -0
- package/lib/module/ui/KokoChatSheet.js.map +1 -0
- package/lib/module/ui/KokoComposer.js +155 -0
- package/lib/module/ui/KokoComposer.js.map +1 -0
- package/lib/module/ui/KokoDialogHost.js +247 -0
- package/lib/module/ui/KokoDialogHost.js.map +1 -0
- package/lib/module/ui/KokoEntryButton.js +74 -0
- package/lib/module/ui/KokoEntryButton.js.map +1 -0
- package/lib/module/ui/KokoObserver.js +516 -0
- package/lib/module/ui/KokoObserver.js.map +1 -0
- package/lib/module/ui/KokoOverlayLayer.js +39 -0
- package/lib/module/ui/KokoOverlayLayer.js.map +1 -0
- package/lib/module/ui/KokoSubtitle.js +90 -0
- package/lib/module/ui/KokoSubtitle.js.map +1 -0
- package/lib/module/ui/KokoTaskPanel.js +316 -0
- package/lib/module/ui/KokoTaskPanel.js.map +1 -0
- package/lib/module/ui/hostOverlay.js +120 -0
- package/lib/module/ui/hostOverlay.js.map +1 -0
- package/lib/module/ui/icons.js +124 -0
- package/lib/module/ui/icons.js.map +1 -0
- package/lib/module/ui/progressChrome.js +58 -0
- package/lib/module/ui/progressChrome.js.map +1 -0
- package/lib/module/ui/safeArea.js +92 -0
- package/lib/module/ui/safeArea.js.map +1 -0
- package/lib/module/ui/useOverlayOrigin.js +36 -0
- package/lib/module/ui/useOverlayOrigin.js.map +1 -0
- package/lib/typescript/commonjs/KokoAgent.d.ts +167 -0
- package/lib/typescript/commonjs/KokoAgent.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/OnDeviceAssist.d.ts +31 -0
- package/lib/typescript/commonjs/assist/OnDeviceAssist.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/intentClassify.d.ts +18 -0
- package/lib/typescript/commonjs/assist/intentClassify.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/nodeRank.d.ts +32 -0
- package/lib/typescript/commonjs/assist/nodeRank.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/ocrTarget.d.ts +25 -0
- package/lib/typescript/commonjs/assist/ocrTarget.d.ts.map +1 -0
- package/lib/typescript/commonjs/assist/webVisualChange.d.ts +6 -0
- package/lib/typescript/commonjs/assist/webVisualChange.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/ActionOutcomeUnknownError.d.ts +13 -0
- package/lib/typescript/commonjs/client/ActionOutcomeUnknownError.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/AgentSession.d.ts +56 -0
- package/lib/typescript/commonjs/client/AgentSession.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/GatewayClient.d.ts +149 -0
- package/lib/typescript/commonjs/client/GatewayClient.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/OperationReplayGuard.d.ts +13 -0
- package/lib/typescript/commonjs/client/OperationReplayGuard.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/RunCheckpoint.d.ts +57 -0
- package/lib/typescript/commonjs/client/RunCheckpoint.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/loopDetect.d.ts +15 -0
- package/lib/typescript/commonjs/client/loopDetect.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/recentSearch.d.ts +5 -0
- package/lib/typescript/commonjs/client/recentSearch.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/walletChoiceGuard.d.ts +4 -0
- package/lib/typescript/commonjs/client/walletChoiceGuard.d.ts.map +1 -0
- package/lib/typescript/commonjs/client/webResultCategory.d.ts +5 -0
- package/lib/typescript/commonjs/client/webResultCategory.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/AccountStore.d.ts +17 -0
- package/lib/typescript/commonjs/commercial/AccountStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/AgentDebug.d.ts +25 -0
- package/lib/typescript/commonjs/commercial/AgentDebug.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/ExecutionGuard.d.ts +18 -0
- package/lib/typescript/commonjs/commercial/ExecutionGuard.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/UsageBus.d.ts +18 -0
- package/lib/typescript/commonjs/commercial/UsageBus.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/branding.d.ts +25 -0
- package/lib/typescript/commonjs/commercial/branding.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/devMode.d.ts +26 -0
- package/lib/typescript/commonjs/commercial/devMode.d.ts.map +1 -0
- package/lib/typescript/commonjs/commercial/trust.d.ts +21 -0
- package/lib/typescript/commonjs/commercial/trust.d.ts.map +1 -0
- package/lib/typescript/commonjs/confirmation/gate.d.ts +18 -0
- package/lib/typescript/commonjs/confirmation/gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/cursor/CursorOverlay.d.ts +13 -0
- package/lib/typescript/commonjs/cursor/CursorOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/cursor/PointerHand.d.ts +16 -0
- package/lib/typescript/commonjs/cursor/PointerHand.d.ts.map +1 -0
- package/lib/typescript/commonjs/cursor/controller.d.ts +30 -0
- package/lib/typescript/commonjs/cursor/controller.d.ts.map +1 -0
- package/lib/typescript/commonjs/cursor/pointer.d.ts +23 -0
- package/lib/typescript/commonjs/cursor/pointer.d.ts.map +1 -0
- package/lib/typescript/commonjs/debug/KokoRemoteSmoke.d.ts +96 -0
- package/lib/typescript/commonjs/debug/KokoRemoteSmoke.d.ts.map +1 -0
- package/lib/typescript/commonjs/explore/ExplorationGraph.d.ts +96 -0
- package/lib/typescript/commonjs/explore/ExplorationGraph.d.ts.map +1 -0
- package/lib/typescript/commonjs/explore/bootstrapExplore.d.ts +40 -0
- package/lib/typescript/commonjs/explore/bootstrapExplore.d.ts.map +1 -0
- package/lib/typescript/commonjs/host/HostActions.d.ts +101 -0
- package/lib/typescript/commonjs/host/HostActions.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n/index.d.ts +20 -0
- package/lib/typescript/commonjs/i18n/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n/runtimeMessages.d.ts +178 -0
- package/lib/typescript/commonjs/i18n/runtimeMessages.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +66 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/NativeBridge.d.ts +70 -0
- package/lib/typescript/commonjs/native/NativeBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/navigationLabel.d.ts +4 -0
- package/lib/typescript/commonjs/native/navigationLabel.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/normalizeViewTree.d.ts +4 -0
- package/lib/typescript/commonjs/native/normalizeViewTree.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/pruneOffscreen.d.ts +3 -0
- package/lib/typescript/commonjs/native/pruneOffscreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/native/scrollViewport.d.ts +13 -0
- package/lib/typescript/commonjs/native/scrollViewport.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/privacy/redact.d.ts +9 -0
- package/lib/typescript/commonjs/privacy/redact.d.ts.map +1 -0
- package/lib/typescript/commonjs/privacy/screenEvidence.d.ts +14 -0
- package/lib/typescript/commonjs/privacy/screenEvidence.d.ts.map +1 -0
- package/lib/typescript/commonjs/privacy/screenModel.d.ts +26 -0
- package/lib/typescript/commonjs/privacy/screenModel.d.ts.map +1 -0
- package/lib/typescript/commonjs/privacy/sensitiveScreen.d.ts +8 -0
- package/lib/typescript/commonjs/privacy/sensitiveScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/privacy/userGate.d.ts +58 -0
- package/lib/typescript/commonjs/privacy/userGate.d.ts.map +1 -0
- package/lib/typescript/commonjs/protocol/actions.d.ts +7 -0
- package/lib/typescript/commonjs/protocol/actions.d.ts.map +1 -0
- package/lib/typescript/commonjs/provider/HostAppearanceStore.d.ts +64 -0
- package/lib/typescript/commonjs/provider/HostAppearanceStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/provider/KokoProvider.d.ts +39 -0
- package/lib/typescript/commonjs/provider/KokoProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/provider/KokoUiContext.d.ts +22 -0
- package/lib/typescript/commonjs/provider/KokoUiContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/selector/match.d.ts +27 -0
- package/lib/typescript/commonjs/selector/match.d.ts.map +1 -0
- package/lib/typescript/commonjs/task/TaskStore.d.ts +65 -0
- package/lib/typescript/commonjs/task/TaskStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/task/types.d.ts +66 -0
- package/lib/typescript/commonjs/task/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/task/useTaskStore.d.ts +3 -0
- package/lib/typescript/commonjs/task/useTaskStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/types.d.ts +372 -0
- package/lib/typescript/commonjs/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoChatSheet.d.ts +8 -0
- package/lib/typescript/commonjs/ui/KokoChatSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoComposer.d.ts +13 -0
- package/lib/typescript/commonjs/ui/KokoComposer.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoDialogHost.d.ts +32 -0
- package/lib/typescript/commonjs/ui/KokoDialogHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoEntryButton.d.ts +18 -0
- package/lib/typescript/commonjs/ui/KokoEntryButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoObserver.d.ts +13 -0
- package/lib/typescript/commonjs/ui/KokoObserver.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoOverlayLayer.d.ts +35 -0
- package/lib/typescript/commonjs/ui/KokoOverlayLayer.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoSubtitle.d.ts +7 -0
- package/lib/typescript/commonjs/ui/KokoSubtitle.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/KokoTaskPanel.d.ts +7 -0
- package/lib/typescript/commonjs/ui/KokoTaskPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hostOverlay.d.ts +28 -0
- package/lib/typescript/commonjs/ui/hostOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/icons.d.ts +26 -0
- package/lib/typescript/commonjs/ui/icons.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/progressChrome.d.ts +21 -0
- package/lib/typescript/commonjs/ui/progressChrome.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/safeArea.d.ts +12 -0
- package/lib/typescript/commonjs/ui/safeArea.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/useOverlayOrigin.d.ts +22 -0
- package/lib/typescript/commonjs/ui/useOverlayOrigin.d.ts.map +1 -0
- package/lib/typescript/module/KokoAgent.d.ts +167 -0
- package/lib/typescript/module/KokoAgent.d.ts.map +1 -0
- package/lib/typescript/module/assist/OnDeviceAssist.d.ts +31 -0
- package/lib/typescript/module/assist/OnDeviceAssist.d.ts.map +1 -0
- package/lib/typescript/module/assist/intentClassify.d.ts +18 -0
- package/lib/typescript/module/assist/intentClassify.d.ts.map +1 -0
- package/lib/typescript/module/assist/nodeRank.d.ts +32 -0
- package/lib/typescript/module/assist/nodeRank.d.ts.map +1 -0
- package/lib/typescript/module/assist/ocrTarget.d.ts +25 -0
- package/lib/typescript/module/assist/ocrTarget.d.ts.map +1 -0
- package/lib/typescript/module/assist/webVisualChange.d.ts +6 -0
- package/lib/typescript/module/assist/webVisualChange.d.ts.map +1 -0
- package/lib/typescript/module/client/ActionOutcomeUnknownError.d.ts +13 -0
- package/lib/typescript/module/client/ActionOutcomeUnknownError.d.ts.map +1 -0
- package/lib/typescript/module/client/AgentSession.d.ts +56 -0
- package/lib/typescript/module/client/AgentSession.d.ts.map +1 -0
- package/lib/typescript/module/client/GatewayClient.d.ts +149 -0
- package/lib/typescript/module/client/GatewayClient.d.ts.map +1 -0
- package/lib/typescript/module/client/OperationReplayGuard.d.ts +13 -0
- package/lib/typescript/module/client/OperationReplayGuard.d.ts.map +1 -0
- package/lib/typescript/module/client/RunCheckpoint.d.ts +57 -0
- package/lib/typescript/module/client/RunCheckpoint.d.ts.map +1 -0
- package/lib/typescript/module/client/loopDetect.d.ts +15 -0
- package/lib/typescript/module/client/loopDetect.d.ts.map +1 -0
- package/lib/typescript/module/client/recentSearch.d.ts +5 -0
- package/lib/typescript/module/client/recentSearch.d.ts.map +1 -0
- package/lib/typescript/module/client/walletChoiceGuard.d.ts +4 -0
- package/lib/typescript/module/client/walletChoiceGuard.d.ts.map +1 -0
- package/lib/typescript/module/client/webResultCategory.d.ts +5 -0
- package/lib/typescript/module/client/webResultCategory.d.ts.map +1 -0
- package/lib/typescript/module/commercial/AccountStore.d.ts +17 -0
- package/lib/typescript/module/commercial/AccountStore.d.ts.map +1 -0
- package/lib/typescript/module/commercial/AgentDebug.d.ts +25 -0
- package/lib/typescript/module/commercial/AgentDebug.d.ts.map +1 -0
- package/lib/typescript/module/commercial/ExecutionGuard.d.ts +18 -0
- package/lib/typescript/module/commercial/ExecutionGuard.d.ts.map +1 -0
- package/lib/typescript/module/commercial/UsageBus.d.ts +18 -0
- package/lib/typescript/module/commercial/UsageBus.d.ts.map +1 -0
- package/lib/typescript/module/commercial/branding.d.ts +25 -0
- package/lib/typescript/module/commercial/branding.d.ts.map +1 -0
- package/lib/typescript/module/commercial/devMode.d.ts +26 -0
- package/lib/typescript/module/commercial/devMode.d.ts.map +1 -0
- package/lib/typescript/module/commercial/trust.d.ts +21 -0
- package/lib/typescript/module/commercial/trust.d.ts.map +1 -0
- package/lib/typescript/module/confirmation/gate.d.ts +18 -0
- package/lib/typescript/module/confirmation/gate.d.ts.map +1 -0
- package/lib/typescript/module/cursor/CursorOverlay.d.ts +13 -0
- package/lib/typescript/module/cursor/CursorOverlay.d.ts.map +1 -0
- package/lib/typescript/module/cursor/PointerHand.d.ts +16 -0
- package/lib/typescript/module/cursor/PointerHand.d.ts.map +1 -0
- package/lib/typescript/module/cursor/controller.d.ts +30 -0
- package/lib/typescript/module/cursor/controller.d.ts.map +1 -0
- package/lib/typescript/module/cursor/pointer.d.ts +23 -0
- package/lib/typescript/module/cursor/pointer.d.ts.map +1 -0
- package/lib/typescript/module/debug/KokoRemoteSmoke.d.ts +96 -0
- package/lib/typescript/module/debug/KokoRemoteSmoke.d.ts.map +1 -0
- package/lib/typescript/module/explore/ExplorationGraph.d.ts +96 -0
- package/lib/typescript/module/explore/ExplorationGraph.d.ts.map +1 -0
- package/lib/typescript/module/explore/bootstrapExplore.d.ts +40 -0
- package/lib/typescript/module/explore/bootstrapExplore.d.ts.map +1 -0
- package/lib/typescript/module/host/HostActions.d.ts +101 -0
- package/lib/typescript/module/host/HostActions.d.ts.map +1 -0
- package/lib/typescript/module/i18n/index.d.ts +20 -0
- package/lib/typescript/module/i18n/index.d.ts.map +1 -0
- package/lib/typescript/module/i18n/runtimeMessages.d.ts +178 -0
- package/lib/typescript/module/i18n/runtimeMessages.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +66 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/native/NativeBridge.d.ts +70 -0
- package/lib/typescript/module/native/NativeBridge.d.ts.map +1 -0
- package/lib/typescript/module/native/navigationLabel.d.ts +4 -0
- package/lib/typescript/module/native/navigationLabel.d.ts.map +1 -0
- package/lib/typescript/module/native/normalizeViewTree.d.ts +4 -0
- package/lib/typescript/module/native/normalizeViewTree.d.ts.map +1 -0
- package/lib/typescript/module/native/pruneOffscreen.d.ts +3 -0
- package/lib/typescript/module/native/pruneOffscreen.d.ts.map +1 -0
- package/lib/typescript/module/native/scrollViewport.d.ts +13 -0
- package/lib/typescript/module/native/scrollViewport.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/privacy/redact.d.ts +9 -0
- package/lib/typescript/module/privacy/redact.d.ts.map +1 -0
- package/lib/typescript/module/privacy/screenEvidence.d.ts +14 -0
- package/lib/typescript/module/privacy/screenEvidence.d.ts.map +1 -0
- package/lib/typescript/module/privacy/screenModel.d.ts +26 -0
- package/lib/typescript/module/privacy/screenModel.d.ts.map +1 -0
- package/lib/typescript/module/privacy/sensitiveScreen.d.ts +8 -0
- package/lib/typescript/module/privacy/sensitiveScreen.d.ts.map +1 -0
- package/lib/typescript/module/privacy/userGate.d.ts +58 -0
- package/lib/typescript/module/privacy/userGate.d.ts.map +1 -0
- package/lib/typescript/module/protocol/actions.d.ts +7 -0
- package/lib/typescript/module/protocol/actions.d.ts.map +1 -0
- package/lib/typescript/module/provider/HostAppearanceStore.d.ts +64 -0
- package/lib/typescript/module/provider/HostAppearanceStore.d.ts.map +1 -0
- package/lib/typescript/module/provider/KokoProvider.d.ts +39 -0
- package/lib/typescript/module/provider/KokoProvider.d.ts.map +1 -0
- package/lib/typescript/module/provider/KokoUiContext.d.ts +22 -0
- package/lib/typescript/module/provider/KokoUiContext.d.ts.map +1 -0
- package/lib/typescript/module/selector/match.d.ts +27 -0
- package/lib/typescript/module/selector/match.d.ts.map +1 -0
- package/lib/typescript/module/task/TaskStore.d.ts +65 -0
- package/lib/typescript/module/task/TaskStore.d.ts.map +1 -0
- package/lib/typescript/module/task/types.d.ts +66 -0
- package/lib/typescript/module/task/types.d.ts.map +1 -0
- package/lib/typescript/module/task/useTaskStore.d.ts +3 -0
- package/lib/typescript/module/task/useTaskStore.d.ts.map +1 -0
- package/lib/typescript/module/types.d.ts +372 -0
- package/lib/typescript/module/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoChatSheet.d.ts +8 -0
- package/lib/typescript/module/ui/KokoChatSheet.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoComposer.d.ts +13 -0
- package/lib/typescript/module/ui/KokoComposer.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoDialogHost.d.ts +32 -0
- package/lib/typescript/module/ui/KokoDialogHost.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoEntryButton.d.ts +18 -0
- package/lib/typescript/module/ui/KokoEntryButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoObserver.d.ts +13 -0
- package/lib/typescript/module/ui/KokoObserver.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoOverlayLayer.d.ts +35 -0
- package/lib/typescript/module/ui/KokoOverlayLayer.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoSubtitle.d.ts +7 -0
- package/lib/typescript/module/ui/KokoSubtitle.d.ts.map +1 -0
- package/lib/typescript/module/ui/KokoTaskPanel.d.ts +7 -0
- package/lib/typescript/module/ui/KokoTaskPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/hostOverlay.d.ts +28 -0
- package/lib/typescript/module/ui/hostOverlay.d.ts.map +1 -0
- package/lib/typescript/module/ui/icons.d.ts +26 -0
- package/lib/typescript/module/ui/icons.d.ts.map +1 -0
- package/lib/typescript/module/ui/progressChrome.d.ts +21 -0
- package/lib/typescript/module/ui/progressChrome.d.ts.map +1 -0
- package/lib/typescript/module/ui/safeArea.d.ts +12 -0
- package/lib/typescript/module/ui/safeArea.d.ts.map +1 -0
- package/lib/typescript/module/ui/useOverlayOrigin.d.ts +22 -0
- package/lib/typescript/module/ui/useOverlayOrigin.d.ts.map +1 -0
- package/package.json +153 -0
- package/react-native.config.js +12 -0
- package/src/KokoAgent.ts +1415 -0
- package/src/assist/OnDeviceAssist.ts +133 -0
- package/src/assist/intentClassify.ts +122 -0
- package/src/assist/nodeRank.ts +167 -0
- package/src/assist/ocrTarget.ts +146 -0
- package/src/assist/webVisualChange.ts +24 -0
- package/src/client/ActionOutcomeUnknownError.ts +18 -0
- package/src/client/AgentSession.ts +952 -0
- package/src/client/GatewayClient.ts +439 -0
- package/src/client/OperationReplayGuard.ts +61 -0
- package/src/client/RunCheckpoint.ts +154 -0
- package/src/client/loopDetect.ts +213 -0
- package/src/client/recentSearch.ts +47 -0
- package/src/client/walletChoiceGuard.ts +15 -0
- package/src/client/webResultCategory.ts +28 -0
- package/src/commercial/AccountStore.ts +85 -0
- package/src/commercial/AgentDebug.ts +142 -0
- package/src/commercial/ExecutionGuard.ts +67 -0
- package/src/commercial/UsageBus.ts +44 -0
- package/src/commercial/branding.ts +97 -0
- package/src/commercial/devMode.ts +48 -0
- package/src/commercial/trust.ts +67 -0
- package/src/confirmation/gate.ts +82 -0
- package/src/cursor/CursorOverlay.tsx +138 -0
- package/src/cursor/PointerHand.tsx +49 -0
- package/src/cursor/controller.ts +98 -0
- package/src/cursor/pointer.ts +40 -0
- package/src/debug/KokoRemoteSmoke.tsx +561 -0
- package/src/explore/ExplorationGraph.ts +518 -0
- package/src/explore/bootstrapExplore.ts +89 -0
- package/src/host/HostActions.ts +349 -0
- package/src/i18n/index.ts +229 -0
- package/src/i18n/runtimeMessages.ts +180 -0
- package/src/index.ts +203 -0
- package/src/native/NativeBridge.ts +207 -0
- package/src/native/navigationLabel.ts +11 -0
- package/src/native/normalizeViewTree.ts +16 -0
- package/src/native/pruneOffscreen.ts +72 -0
- package/src/native/scrollViewport.ts +51 -0
- package/src/privacy/redact.ts +115 -0
- package/src/privacy/screenEvidence.ts +55 -0
- package/src/privacy/screenModel.ts +504 -0
- package/src/privacy/sensitiveScreen.ts +55 -0
- package/src/privacy/userGate.ts +233 -0
- package/src/protocol/actions.ts +66 -0
- package/src/provider/HostAppearanceStore.ts +148 -0
- package/src/provider/KokoProvider.tsx +118 -0
- package/src/provider/KokoUiContext.tsx +162 -0
- package/src/selector/match.ts +417 -0
- package/src/task/TaskStore.ts +387 -0
- package/src/task/types.ts +82 -0
- package/src/task/useTaskStore.ts +9 -0
- package/src/types.ts +318 -0
- package/src/ui/KokoChatSheet.tsx +930 -0
- package/src/ui/KokoComposer.tsx +174 -0
- package/src/ui/KokoDialogHost.tsx +249 -0
- package/src/ui/KokoEntryButton.tsx +74 -0
- package/src/ui/KokoObserver.tsx +587 -0
- package/src/ui/KokoOverlayLayer.tsx +53 -0
- package/src/ui/KokoSubtitle.tsx +80 -0
- package/src/ui/KokoTaskPanel.tsx +299 -0
- package/src/ui/hostOverlay.tsx +148 -0
- package/src/ui/icons.tsx +145 -0
- package/src/ui/progressChrome.ts +73 -0
- package/src/ui/safeArea.ts +95 -0
- package/src/ui/useOverlayOrigin.ts +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UsageBusImpl","listeners","Set","recent","maxRecent","subscribe","listener","add","delete","emit","event","push","length","splice","l","getRecent","clear","UsageBus","exports"],"sourceRoot":"../../../src","sources":["commercial/UsageBus.ts"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA,MAAMA,YAAY,CAAC;EACTC,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;EAC/BC,MAAM,GAAqB,EAAE;EACpBC,SAAS,GAAG,GAAG;EAEhCC,SAASA,CAACC,QAAkB,EAAc;IACxC,IAAI,CAACL,SAAS,CAACM,GAAG,CAACD,QAAQ,CAAC;IAC5B,OAAO,MAAM;MACX,IAAI,CAACL,SAAS,CAACO,MAAM,CAACF,QAAQ,CAAC;IACjC,CAAC;EACH;EAEAG,IAAIA,CAACC,KAAqB,EAAE;IAC1B,IAAI,CAACP,MAAM,CAACQ,IAAI,CAACD,KAAK,CAAC;IACvB,IAAI,IAAI,CAACP,MAAM,CAACS,MAAM,GAAG,IAAI,CAACR,SAAS,EAAE;MACvC,IAAI,CAACD,MAAM,CAACU,MAAM,CAAC,CAAC,EAAE,IAAI,CAACV,MAAM,CAACS,MAAM,GAAG,IAAI,CAACR,SAAS,CAAC;IAC5D;IACA,KAAK,MAAMU,CAAC,IAAI,IAAI,CAACb,SAAS,EAAE;MAC9B,IAAI;QACFa,CAAC,CAACJ,KAAK,CAAC;MACV,CAAC,CAAC,MAAM;QACN;MAAA;IAEJ;EACF;EAEAK,SAASA,CAAA,EAAqB;IAC5B,OAAO,CAAC,GAAG,IAAI,CAACZ,MAAM,CAAC;EACzB;EAEAa,KAAKA,CAAA,EAAG;IACN,IAAI,CAACb,MAAM,GAAG,EAAE;EAClB;AACF;AAEO,MAAMc,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAIjB,YAAY,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_ENTITLEMENTS = void 0;
|
|
7
|
+
exports.emptyAccount = emptyAccount;
|
|
8
|
+
exports.resolveBranding = resolveBranding;
|
|
9
|
+
var _index = require("../i18n/index.js");
|
|
10
|
+
const DEFAULT_ENTITLEMENTS = exports.DEFAULT_ENTITLEMENTS = {
|
|
11
|
+
custom_branding: false,
|
|
12
|
+
locale: true
|
|
13
|
+
};
|
|
14
|
+
const DEFAULT_PRIMARY = '#0A84FF';
|
|
15
|
+
function wantsCustomBranding(branding) {
|
|
16
|
+
if (!branding) return false;
|
|
17
|
+
return Boolean(branding.name && branding.name.trim() && branding.name.trim() !== 'Koko' || branding.icon != null || branding.tagline && branding.tagline.trim() || branding.placeholder && branding.placeholder.trim() || branding.primaryColor && branding.primaryColor.trim());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Resolve what the **built-in** chat UI may show.
|
|
22
|
+
* This is a soft client gate for honest hosts + official gateway.
|
|
23
|
+
* Forked SDKs / custom chrome can always draw their own brand — that is outside
|
|
24
|
+
* this product surface. Usage metering remains server-authoritative.
|
|
25
|
+
*/
|
|
26
|
+
function resolveBranding(locale, branding, entitlements) {
|
|
27
|
+
const allowed = entitlements?.custom_branding === true;
|
|
28
|
+
const custom = wantsCustomBranding(branding);
|
|
29
|
+
const downgraded = custom && !allowed;
|
|
30
|
+
const useCustom = custom && allowed;
|
|
31
|
+
let iconSource = null;
|
|
32
|
+
let mark = (0, _index.t)(locale, 'brand.defaultMark');
|
|
33
|
+
if (useCustom && branding?.icon != null) {
|
|
34
|
+
if (typeof branding.icon === 'string') {
|
|
35
|
+
if (/^https?:\/\//i.test(branding.icon) || branding.icon.startsWith('data:')) {
|
|
36
|
+
iconSource = {
|
|
37
|
+
uri: branding.icon
|
|
38
|
+
};
|
|
39
|
+
} else {
|
|
40
|
+
mark = branding.icon.slice(0, 2);
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
iconSource = branding.icon;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
name: useCustom && branding?.name?.trim() ? branding.name.trim() : (0, _index.t)(locale, 'brand.defaultName'),
|
|
48
|
+
mark,
|
|
49
|
+
iconSource,
|
|
50
|
+
tagline: useCustom && branding?.tagline?.trim() ? branding.tagline.trim() : (0, _index.t)(locale, 'brand.defaultTagline'),
|
|
51
|
+
placeholder: useCustom && branding?.placeholder?.trim() ? branding.placeholder.trim() : (0, _index.t)(locale, 'brand.defaultPlaceholder'),
|
|
52
|
+
primaryColor: useCustom && branding?.primaryColor?.trim() ? branding.primaryColor.trim() : DEFAULT_PRIMARY,
|
|
53
|
+
downgraded
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function emptyAccount() {
|
|
57
|
+
return {
|
|
58
|
+
plan: 'free',
|
|
59
|
+
entitlements: {
|
|
60
|
+
...DEFAULT_ENTITLEMENTS
|
|
61
|
+
},
|
|
62
|
+
quota: {
|
|
63
|
+
daily: 30,
|
|
64
|
+
used_today: 0,
|
|
65
|
+
remaining: 30
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=branding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_index","require","DEFAULT_ENTITLEMENTS","exports","custom_branding","locale","DEFAULT_PRIMARY","wantsCustomBranding","branding","Boolean","name","trim","icon","tagline","placeholder","primaryColor","resolveBranding","entitlements","allowed","custom","downgraded","useCustom","iconSource","mark","t","test","startsWith","uri","slice","emptyAccount","plan","quota","daily","used_today","remaining"],"sourceRoot":"../../../src","sources":["commercial/branding.ts"],"mappings":";;;;;;;;AAOA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,oBAAsC,GAAAC,OAAA,CAAAD,oBAAA,GAAG;EACpDE,eAAe,EAA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AAG;EACnD,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.allowLocalGatewayForDebugClient = allowLocalGatewayForDebugClient;
|
|
7
|
+
exports.isMetroDevBuild = isMetroDevBuild;
|
|
8
|
+
exports.resolveDebugLogging = resolveDebugLogging;
|
|
9
|
+
exports.resolveDevMode = resolveDevMode;
|
|
10
|
+
/** True only in Metro debug clients (never in store release binaries). */
|
|
11
|
+
function isMetroDevBuild() {
|
|
12
|
+
try {
|
|
13
|
+
// eslint-disable-next-line no-undef
|
|
14
|
+
return typeof __DEV__ !== 'undefined' && __DEV__ === true;
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Verbose SDK / agent execution logs for developers.
|
|
22
|
+
* Does NOT relax security (permits, gateway allowlist).
|
|
23
|
+
*
|
|
24
|
+
* On when:
|
|
25
|
+
* - `config.debug === true`, or
|
|
26
|
+
* - Metro `__DEV__` and `config.debug !== false`
|
|
27
|
+
*
|
|
28
|
+
* Release builds: only if host explicitly sets `debug: true`
|
|
29
|
+
* (logs only — still cannot use localhost gateway or skip permits).
|
|
30
|
+
*/
|
|
31
|
+
function resolveDebugLogging(config) {
|
|
32
|
+
if (config?.debug === true || config?.devMode === true) return true;
|
|
33
|
+
if (config?.debug === false || config?.devMode === false) return false;
|
|
34
|
+
return isMetroDevBuild();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use resolveDebugLogging. Kept for call-site migration.
|
|
39
|
+
* Previously also meant "relax security" — that behavior is removed.
|
|
40
|
+
*/
|
|
41
|
+
function resolveDevMode(config) {
|
|
42
|
+
return resolveDebugLogging(config);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Localhost / LAN gateway is only for Intent Computing debugging the
|
|
47
|
+
* in-repo gateway against a Metro debug app — not a customer "self-host" mode.
|
|
48
|
+
*/
|
|
49
|
+
function allowLocalGatewayForDebugClient() {
|
|
50
|
+
return isMetroDevBuild();
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=devMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isMetroDevBuild","__DEV__","resolveDebugLogging","config","debug","devMode","resolveDevMode","allowLocalGatewayForDebugClient"],"sourceRoot":"../../../src","sources":["commercial/devMode.ts"],"mappings":";;;;;;;;;AAEA;AACO,SAASA,eAAeA,CAAA,EAAY;EACzC,IAAI;IACF;IACA,OAAO,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,KAAK,IAAI;EAC3D,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CACjCC,MAAmD,EAC1C;EACT,IAAIA,MAAM,EAAEC,KAAK,KAAK,IAAI,IAAID,MAAM,EAAEE,OAAO,KAAK,IAAI,EAAE,OAAO,IAAI;EACnE,IAAIF,MAAM,EAAEC,KAAK,KAAK,KAAK,IAAID,MAAM,EAAEE,OAAO,KAAK,KAAK,EAAE,OAAO,KAAK;EACtE,OAAOL,eAAe,CAAC,CAAC;AAC1B;;AAEA;AACA;AACA;AACA;AACO,SAASM,cAAcA,CAC5BH,MAAmD,EAC1C;EACT,OAAOD,mBAAmB,CAACC,MAAM,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACO,SAASI,+BAA+BA,CAAA,EAAY;EACzD,OAAOP,eAAe,CAAC,CAAC;AAC1B","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isAllowedGatewayUrl = isAllowedGatewayUrl;
|
|
7
|
+
exports.isLocalDevHost = isLocalDevHost;
|
|
8
|
+
exports.isOfficialGatewayHost = isOfficialGatewayHost;
|
|
9
|
+
exports.isTrustedEntitlementHost = isTrustedEntitlementHost;
|
|
10
|
+
/**
|
|
11
|
+
* Gateway host policy + entitlement trust.
|
|
12
|
+
*
|
|
13
|
+
* Customers always use official Intent Computing hosts in release apps.
|
|
14
|
+
* Localhost is allowed only in Metro debug clients (so we can dogfood the
|
|
15
|
+
* in-repo gateway) — that is NOT a supported "self-host your own AI" mode.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// `agent.intentcomputing.net` is a different Intent Computing service and must
|
|
19
|
+
// not be trusted as a gateway.
|
|
20
|
+
const OFFICIAL_HOST_SUFFIXES = ['sdk.intentcomputing.cn', 'sdk.intentcomputing.net'];
|
|
21
|
+
function isLocalDevHost(hostname) {
|
|
22
|
+
const host = hostname.toLowerCase();
|
|
23
|
+
return host === 'localhost' || host === '127.0.0.1' || host === '10.0.2.2' || host === '0.0.0.0';
|
|
24
|
+
}
|
|
25
|
+
function isOfficialGatewayHost(hostname) {
|
|
26
|
+
const host = hostname.toLowerCase();
|
|
27
|
+
return OFFICIAL_HOST_SUFFIXES.some(h => host === h || host.endsWith(`.${h}`));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Hosts whose /v1/me branding claims we trust. */
|
|
31
|
+
function isTrustedEntitlementHost(baseUrl) {
|
|
32
|
+
try {
|
|
33
|
+
const u = new URL(baseUrl.includes('://') ? baseUrl : `https://${baseUrl}`);
|
|
34
|
+
return isOfficialGatewayHost(u.hostname) || isLocalDevHost(u.hostname);
|
|
35
|
+
} catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param allowLocalLab when true (Metro debug client only), localhost/LAN OK.
|
|
42
|
+
*/
|
|
43
|
+
function isAllowedGatewayUrl(baseUrl, allowLocalLab) {
|
|
44
|
+
try {
|
|
45
|
+
const u = new URL(baseUrl.includes('://') ? baseUrl : `https://${baseUrl}`);
|
|
46
|
+
if (isOfficialGatewayHost(u.hostname)) return {
|
|
47
|
+
ok: true
|
|
48
|
+
};
|
|
49
|
+
if (allowLocalLab && isLocalDevHost(u.hostname)) return {
|
|
50
|
+
ok: true
|
|
51
|
+
};
|
|
52
|
+
if (allowLocalLab) {
|
|
53
|
+
const ipv4 = /^\d{1,3}(\.\d{1,3}){3}$/.test(u.hostname);
|
|
54
|
+
if (ipv4) return {
|
|
55
|
+
ok: true
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
ok: false,
|
|
60
|
+
reason: allowLocalLab ? `unsupported gateway host: ${u.hostname}` : `unsupported gateway host: ${u.hostname}`
|
|
61
|
+
};
|
|
62
|
+
} catch {
|
|
63
|
+
return {
|
|
64
|
+
ok: false,
|
|
65
|
+
reason: 'invalid gateway.baseUrl'
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=trust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OFFICIAL_HOST_SUFFIXES","isLocalDevHost","hostname","host","toLowerCase","isOfficialGatewayHost","some","h","endsWith","isTrustedEntitlementHost","baseUrl","u","URL","includes","isAllowedGatewayUrl","allowLocalLab","ok","ipv4","test","reason"],"sourceRoot":"../../../src","sources":["commercial/trust.ts"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAMA,sBAAsB,GAAG,CAC7B,wBAAwB,EACxB,yBAAyB,CAC1B;AAEM,SAASC,cAAcA,CAACC,QAAgB,EAAW;EACxD,MAAMC,IAAI,GAAGD,QAAQ,CAACE,WAAW,CAAC,CAAC;EACnC,OACED,IAAI,KAAK,WAAW,IACpBA,IAAI,KAAK,WAAW,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A,EAAE,EAAE,KAAK;MACTG,MAAM,EAAEJ,aAAa,GACjB,6BAA6BJ,CAAC,CAACT,QAAQ,EAAE,GACzC,6BAA6BS,CAAC,CAACT,QAAQ;IAC7C,CAAC;EACH,CAAC,CAAC,MAAM;IACN,OAAO;MAAEc,EAAE,EAAE,KAAK;MAAEG,MAAM,EAAE;IAA0B,CAAC;EACzD;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_SENSITIVE_PATTERNS = void 0;
|
|
7
|
+
exports.isSensitiveGoal = isSensitiveGoal;
|
|
8
|
+
exports.isSensitiveLabel = isSensitiveLabel;
|
|
9
|
+
exports.runConfirmationGate = runConfirmationGate;
|
|
10
|
+
exports.runPreflightConfirm = runPreflightConfirm;
|
|
11
|
+
/**
|
|
12
|
+
* Irreversible / high-risk intents — confirmed once **before** the agent run.
|
|
13
|
+
* Ordinary list deletes are NOT sensitive.
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_SENSITIVE_PATTERNS = exports.DEFAULT_SENSITIVE_PATTERNS = [/转账|转\s*\d|transfer|withdraw|send\s*(usdt|usdc|eth|btc)?/i, /授权|approve|export\s*(key|seed|mnemonic)|私钥|助记词/i, /删除(钱包|账户|账号|密钥)|永久删除|注销账户|销毁/i, /delete\s*(wallet|account|key|seed)|destroy\s*account/i, /confirm\s*(transfer|payment)|确认(转账|支付|授权)/i];
|
|
16
|
+
function isSensitiveLabel(label, policy) {
|
|
17
|
+
if (!label) return false;
|
|
18
|
+
const patterns = policy?.sensitivePatterns?.length ? policy.sensitivePatterns : DEFAULT_SENSITIVE_PATTERNS;
|
|
19
|
+
return patterns.some(re => re.test(label));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Goal looks like a high-risk operation → preflight confirm. */
|
|
23
|
+
function isSensitiveGoal(goal, policy) {
|
|
24
|
+
return isSensitiveLabel(goal, policy);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Mid-step gate (legacy). Prefer preflight; during unattended runs this should no-op.
|
|
29
|
+
*/
|
|
30
|
+
async function runConfirmationGate(ctx, policy, onConfirm) {
|
|
31
|
+
const mode = policy?.mode ?? 'preflight';
|
|
32
|
+
if (mode === 'off' || mode === 'preflight') {
|
|
33
|
+
// Preflight already asked (or disabled). Never block mid-execution.
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
const requireConfirm = policy?.requireUserConfirm !== false;
|
|
37
|
+
if (!requireConfirm) return true;
|
|
38
|
+
const label = ctx.label ?? ctx.action;
|
|
39
|
+
if (!isSensitiveLabel(label, policy) && !isSensitiveLabel(ctx.action, policy)) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
if (!onConfirm) return false;
|
|
43
|
+
return onConfirm(ctx);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Ask once before the agent loop. Returns false if user declines.
|
|
48
|
+
*/
|
|
49
|
+
async function runPreflightConfirm(goal, policy, onConfirm) {
|
|
50
|
+
const mode = policy?.mode ?? 'preflight';
|
|
51
|
+
if (mode === 'off') return true;
|
|
52
|
+
if (mode !== 'preflight' && mode !== 'inline') return true;
|
|
53
|
+
const requireConfirm = policy?.requireUserConfirm !== false;
|
|
54
|
+
if (!requireConfirm) return true;
|
|
55
|
+
if (!isSensitiveGoal(goal, policy)) return true;
|
|
56
|
+
if (!onConfirm) return false;
|
|
57
|
+
return onConfirm({
|
|
58
|
+
action: 'preflight',
|
|
59
|
+
label: goal
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_SENSITIVE_PATTERNS","exports","isSensitiveLabel","label","policy","patterns","sensitivePatterns","length","some","re","test","isSensitiveGoal","goal","runConfirmationGate","ctx","onConfirm","mode","requireConfirm","requireUserConfirm","action","runPreflightConfirm"],"sourceRoot":"../../../src","sources":["confirmation/gate.ts"],"mappings":";;;;;;;;;;AAEA;AACA;AACA;AACA;AACO,MAAMA,0BAAoC,GAAAC,OAAA,CAAAD,0BAAA,GAAG,CAClD,0DAA0D,EAC1D,iDAAiD,EACjD,+BAA+B,EAC/B,uDAAuD,EACvD,4CAA4C,CAC7C;AAEM,SAASE,gBAAgBA,CAC9BC,KAAyB,EACzBC,MAA2B,EAClB;EACT,IAAI,CAACD,KAAK,EAAE,OAAO,KAAK;EACxB,MAAME,QAAQ,GAAGD,MAAM,EAAEE,iBAAiB,EAAEC,MAAM,GAC9CH,MAAM,CAACE,iBAAiB,GACxBN,0BAA0B;EAC9B,OAAOK,QAAQ,CAACG,IAAI,CAAEC,EAAE,IAAKA,EAAE,CAACC,IAAI,CAACP,KAAK,CAAC,CAAC;AAC9C;;AAEA;AACO,SAASQ,eAAeA,CAC7BC,IAAY,EACZR,MAA2B,EAClB;EACT,OAAOF,gBAAgB,CAACU,IAAI,EAAER,MAAM,CAAC;AACvC;;AAEA;AACA;AACA;AACO,eAAeS,mBAAmBA,CACvCC,GAA4B,EAC5BV,MAAsC,EACtCW,SAA8D,EAC5C;EAClB,MAAMC,IAAI,GAAGZ,MAAM,EAAEY,IAAI,IAAI,WAAW;EACxC,IAAIA,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAK,WAAW,EAAE;IAC1C;IACA,OAAO,IAAI;EACb;EAEA,MAAMC,cAAc,GAAGb,MAAM,EAAEc,kBAAkB,KAAK,KAAK;EAC3D,IAAI,CAACD,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAMd,KAAK,GAAGW,GAAG,CAACX,KAAK,IAAIW,GAAG,CAACK,MAAM;EACrC,IAAI,CAACjB,gBAAgB,CAACC,KAAK,EAAEC,MAAM,CAAC,IAAI,CAACF,gBAAgB,CAACY,GAAG,CAACK,MAAM,EAAEf,MAAM,CAAC,EAAE;IAC7E,OAAO,IAAI;EACb;EAEA,IAAI,CAACW,SAAS,EAAE,OAAO,KAAK;EAC5B,OAAOA,SAAS,CAACD,GAAG,CAAC;AACvB;;AAEA;AACA;AACA;AACO,eAAeM,mBAAmBA,CACvCR,IAAY,EACZR,MAAsC,EACtCW,SAA8D,EAC5C;EAClB,MAAMC,IAAI,GAAGZ,MAAM,EAAEY,IAAI,IAAI,WAAW;EACxC,IAAIA,IAAI,KAAK,KAAK,EAAE,OAAO,IAAI;EAC/B,IAAIA,IAAI,KAAK,WAAW,IAAIA,IAAI,KAAK,QAAQ,EAAE,OAAO,IAAI;EAE1D,MAAMC,cAAc,GAAGb,MAAM,EAAEc,kBAAkB,KAAK,KAAK;EAC3D,IAAI,CAACD,cAAc,EAAE,OAAO,IAAI;EAChC,IAAI,CAACN,eAAe,CAACC,IAAI,EAAER,MAAM,CAAC,EAAE,OAAO,IAAI;EAE/C,IAAI,CAACW,SAAS,EAAE,OAAO,KAAK;EAE5B,OAAOA,SAAS,CAAC;IACfI,MAAM,EAAE,WAAW;IACnBhB,KAAK,EAAES;EACT,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CursorOverlay = CursorOverlay;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _controller = require("./controller.js");
|
|
10
|
+
var _useTaskStore = require("../task/useTaskStore.js");
|
|
11
|
+
var _TaskStore = require("../task/TaskStore.js");
|
|
12
|
+
var _KokoOverlayLayer = require("../ui/KokoOverlayLayer.js");
|
|
13
|
+
var _hostOverlay = require("../ui/hostOverlay.js");
|
|
14
|
+
var _useOverlayOrigin = require("../ui/useOverlayOrigin.js");
|
|
15
|
+
var _PointerHand = require("./PointerHand.js");
|
|
16
|
+
var _pointer = require("./pointer.js");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
var cache;
|
|
19
|
+
function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
|
|
20
|
+
/**
|
|
21
|
+
* Native-looking mouse pointer while the agent acts.
|
|
22
|
+
*
|
|
23
|
+
* Uses KokoHostOverlay (FullWindowOverlay on iOS when available) so the
|
|
24
|
+
* cursor stays above react-native-screens Settings / stack modals.
|
|
25
|
+
*
|
|
26
|
+
* Only mount while the cursor is actually visible — an empty FullWindowOverlay
|
|
27
|
+
* stacked under KokoObserver can steal the top presentation and hide the
|
|
28
|
+
* progress pill during host.run-only assist paths.
|
|
29
|
+
*/
|
|
30
|
+
function CursorOverlay() {
|
|
31
|
+
const [state, setState] = (0, _react.useState)(_controller.CursorController.getState());
|
|
32
|
+
const {
|
|
33
|
+
tasks,
|
|
34
|
+
activeTaskId,
|
|
35
|
+
ui
|
|
36
|
+
} = (0, _useTaskStore.useTaskStore)();
|
|
37
|
+
const running = tasks.some(t => t.id === activeTaskId && t.status === 'running');
|
|
38
|
+
const anim = (0, _react.useRef)(new _reactNative.Animated.ValueXY({
|
|
39
|
+
x: state.x,
|
|
40
|
+
y: state.y
|
|
41
|
+
})).current;
|
|
42
|
+
const press = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
43
|
+
const opacity = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
44
|
+
const chromeEpoch = ui.chromeEpoch ?? 0;
|
|
45
|
+
const {
|
|
46
|
+
ref: layerRef,
|
|
47
|
+
origin,
|
|
48
|
+
measure
|
|
49
|
+
} = (0, _useOverlayOrigin.useOverlayOrigin)();
|
|
50
|
+
(0, _react.useEffect)(() => _controller.CursorController.subscribe(setState), []);
|
|
51
|
+
(0, _react.useEffect)(() => {
|
|
52
|
+
if (!running && state.visible) {
|
|
53
|
+
_controller.CursorController.hide();
|
|
54
|
+
}
|
|
55
|
+
}, [running, state.visible]);
|
|
56
|
+
(0, _react.useEffect)(() => {
|
|
57
|
+
if (running && state.visible) {
|
|
58
|
+
_TaskStore.TaskStore.liftChrome();
|
|
59
|
+
}
|
|
60
|
+
}, [running, state.visible, state.x, state.y]);
|
|
61
|
+
(0, _react.useEffect)(() => {
|
|
62
|
+
const duration = Math.max(0, state.moveDurationMs ?? 0);
|
|
63
|
+
const to = {
|
|
64
|
+
x: state.x - origin.x - _pointer.CURSOR_TIP_X,
|
|
65
|
+
y: state.y - origin.y - _pointer.CURSOR_TIP_Y
|
|
66
|
+
};
|
|
67
|
+
if (duration <= 0) {
|
|
68
|
+
anim.stopAnimation();
|
|
69
|
+
anim.setValue(to);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
_reactNative.Animated.timing(anim, {
|
|
73
|
+
toValue: to,
|
|
74
|
+
duration,
|
|
75
|
+
// Reduce native animation work while Fabric registers views during navigation.
|
|
76
|
+
useNativeDriver: false
|
|
77
|
+
}).start();
|
|
78
|
+
}, [state.x, state.y, state.moveDurationMs, origin.x, origin.y, anim]);
|
|
79
|
+
(0, _react.useEffect)(() => {
|
|
80
|
+
_reactNative.Animated.spring(press, {
|
|
81
|
+
toValue: state.pressing ? 1 : 0,
|
|
82
|
+
useNativeDriver: false,
|
|
83
|
+
friction: 6
|
|
84
|
+
}).start();
|
|
85
|
+
}, [state.pressing, press]);
|
|
86
|
+
const show = running && state.visible;
|
|
87
|
+
(0, _react.useEffect)(() => {
|
|
88
|
+
if (show) {
|
|
89
|
+
opacity.stopAnimation();
|
|
90
|
+
opacity.setValue(1);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
_reactNative.Animated.timing(opacity, {
|
|
94
|
+
toValue: 0,
|
|
95
|
+
duration: 80,
|
|
96
|
+
useNativeDriver: false
|
|
97
|
+
}).start();
|
|
98
|
+
}, [show, opacity]);
|
|
99
|
+
if (!show) return null;
|
|
100
|
+
const scale = press.interpolate({
|
|
101
|
+
inputRange: [0, 1],
|
|
102
|
+
outputRange: [1, 0.88]
|
|
103
|
+
});
|
|
104
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_hostOverlay.KokoHostOverlay, {
|
|
105
|
+
liftToken: chromeEpoch,
|
|
106
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
107
|
+
ref: layerRef,
|
|
108
|
+
onLayout: measure,
|
|
109
|
+
testID: _KokoOverlayLayer.KOKO_CURSOR_TEST_ID,
|
|
110
|
+
nativeID: _KokoOverlayLayer.KOKO_CURSOR_TEST_ID,
|
|
111
|
+
collapsable: false,
|
|
112
|
+
pointerEvents: "none",
|
|
113
|
+
style: styles.layer,
|
|
114
|
+
accessibilityElementsHidden: true,
|
|
115
|
+
importantForAccessibility: "no-hide-descendants",
|
|
116
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
117
|
+
style: [styles.cursor, {
|
|
118
|
+
opacity,
|
|
119
|
+
transform: [...anim.getTranslateTransform(), {
|
|
120
|
+
scale
|
|
121
|
+
}]
|
|
122
|
+
}],
|
|
123
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PointerHand.PointerHand, {})
|
|
124
|
+
})
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const styles = _reactNative.StyleSheet.create({
|
|
129
|
+
layer: {
|
|
130
|
+
..._reactNative.StyleSheet.absoluteFillObject,
|
|
131
|
+
backgroundColor: 'transparent'
|
|
132
|
+
},
|
|
133
|
+
cursor: {
|
|
134
|
+
position: 'absolute',
|
|
135
|
+
width: _pointer.CURSOR_W,
|
|
136
|
+
height: _pointer.CURSOR_H,
|
|
137
|
+
left: 0,
|
|
138
|
+
top: 0
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
//# sourceMappingURL=CursorOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_controller","_useTaskStore","_TaskStore","_KokoOverlayLayer","_hostOverlay","_useOverlayOrigin","_PointerHand","_pointer","_jsxRuntime","cache","e","t","__esModule","r","c","a","Object","defineProperty","n","__proto__","default","WeakMap","has","get","set","hasOwnProperty","call","getOwnPropertyDescriptor","CursorOverlay","state","setState","useState","CursorController","getState","tasks","activeTaskId","ui","useTaskStore","running","some","id","status","anim","useRef","Animated","ValueXY","x","y","current","press","Value","opacity","chromeEpoch","ref","layerRef","origin","measure","useOverlayOrigin","useEffect","subscribe","visible","hide","TaskStore","liftChrome","duration","Math","max","moveDurationMs","to","CURSOR_TIP_X","CURSOR_TIP_Y","stopAnimation","setValue","timing","toValue","useNativeDriver","start","spring","pressing","friction","show","scale","interpolate","inputRange","outputRange","jsx","KokoHostOverlay","liftToken","children","View","onLayout","testID","KOKO_CURSOR_TEST_ID","nativeID","collapsable","pointerEvents","style","styles","layer","accessibilityElementsHidden","importantForAccessibility","cursor","transform","getTranslateTransform","PointerHand","StyleSheet","create","absoluteFillObject","backgroundColor","position","width","CURSOR_W","height","CURSOR_H","left","top"],"sourceRoot":"../../../src","sources":["cursor/CursorOverlay.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA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5D,IAAI,CAAC6D,qBAAqB,CAAC,CAAC,EAAE;YAAEtB;UAAM,CAAC;QACxD,CAAC,CACD;QAAAO,QAAA,eAEF,IAAAhF,WAAA,CAAA6E,GAAA,EAAC/E,YAAA,CAAAkG,WAAW,IAAE;MAAC,CACF;IAAC,CACZ;EAAC,CACQ,CAAC;AAEtB;AAEA,MAAMP,MAAM,GAAGQ,uBAAU,CAACC,MAAM,CAAC;EAC/BR,KAAK,EAAE;IACL,GAAGO,uBAAU,CAACE,kBAAkB;IAChCC,eAAe,EAAE;EACnB,CAAC;EACDP,MAAM,EAAE;IACNQ,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAEC,iBAAQ;IACfC,MAAM,EAAEC,iBAAQ;IAChBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PointerHand = PointerHand;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _pointer = require("./pointer.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/**
|
|
13
|
+
* The agent's pointer: a hand with the index finger extended.
|
|
14
|
+
*
|
|
15
|
+
* Drawn from views rather than an image. The SDK's assets sit outside the
|
|
16
|
+
* host's Metro project root, and a host that rewrites asset paths (monorepos
|
|
17
|
+
* commonly do) can leave the request unresolvable — the pointer then silently
|
|
18
|
+
* does not render, which is the one thing the user watches to know the agent
|
|
19
|
+
* is acting. Views cannot fail that way, and they stay sharp at any density.
|
|
20
|
+
*
|
|
21
|
+
* Two passes: dark shapes inflated to form the outline, then the white fill
|
|
22
|
+
* over them. Overlaps within a pass are invisible, so the union reads as one
|
|
23
|
+
* silhouette with no internal seams.
|
|
24
|
+
*/
|
|
25
|
+
function PointerHand() {
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
27
|
+
style: styles.hand,
|
|
28
|
+
pointerEvents: "none",
|
|
29
|
+
children: [renderLayer(_pointer.HAND_STROKE, '#131313'), renderLayer(0, '#FFFFFF')]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function renderLayer(inflate, color) {
|
|
33
|
+
return _pointer.HAND_SHAPES.map(([x, y, w, h, r], i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
34
|
+
style: {
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
left: (x - inflate) * _pointer.HAND_UNIT,
|
|
37
|
+
top: (y - inflate) * _pointer.HAND_UNIT,
|
|
38
|
+
width: (w + inflate * 2) * _pointer.HAND_UNIT,
|
|
39
|
+
height: (h + inflate * 2) * _pointer.HAND_UNIT,
|
|
40
|
+
borderRadius: (r + inflate) * _pointer.HAND_UNIT,
|
|
41
|
+
backgroundColor: color
|
|
42
|
+
}
|
|
43
|
+
}, `${color}-${i}`));
|
|
44
|
+
}
|
|
45
|
+
const styles = _reactNative.StyleSheet.create({
|
|
46
|
+
hand: {
|
|
47
|
+
width: _pointer.CURSOR_W,
|
|
48
|
+
height: _pointer.CURSOR_H
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=PointerHand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_pointer","_jsxRuntime","e","__esModule","default","PointerHand","jsxs","View","style","styles","hand","pointerEvents","children","renderLayer","HAND_STROKE","inflate","color","HAND_SHAPES","map","x","y","w","h","r","i","jsx","position","left","HAND_UNIT","top","width","height","borderRadius","backgroundColor","StyleSheet","create","CURSOR_W","CURSOR_H"],"sourceRoot":"../../../src","sources":["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AIa,kBAAS;MACvCK,eAAe,EAAEjB;IACnB;EAAE,GATG,GAAGA,KAAK,IAAIQ,CAAC,EAUnB,CACF,CAAC;AACJ;AAEA,MAAMf,MAAM,GAAGyB,uBAAU,CAACC,MAAM,CAAC;EAC/BzB,IAAI,EAAE;IACJoB,KAAK,EAAEM,iBAAQ;IACfL,MAAM,EAAEM;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CursorController = void 0;
|
|
7
|
+
const DEFAULT = {
|
|
8
|
+
visible: false,
|
|
9
|
+
x: 0,
|
|
10
|
+
y: 0,
|
|
11
|
+
pressing: false,
|
|
12
|
+
moveDurationMs: 0
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Imperative cursor controller used by KokoAgent; CursorOverlay subscribes.
|
|
17
|
+
*/
|
|
18
|
+
class CursorControllerImpl {
|
|
19
|
+
state = {
|
|
20
|
+
...DEFAULT
|
|
21
|
+
};
|
|
22
|
+
listeners = new Set();
|
|
23
|
+
subscribe(listener) {
|
|
24
|
+
this.listeners.add(listener);
|
|
25
|
+
listener(this.state);
|
|
26
|
+
return () => this.listeners.delete(listener);
|
|
27
|
+
}
|
|
28
|
+
getState() {
|
|
29
|
+
return this.state;
|
|
30
|
+
}
|
|
31
|
+
emit() {
|
|
32
|
+
for (const l of this.listeners) l(this.state);
|
|
33
|
+
}
|
|
34
|
+
showAt(x, y, moveDurationMs = 0) {
|
|
35
|
+
this.state = {
|
|
36
|
+
...this.state,
|
|
37
|
+
visible: true,
|
|
38
|
+
x,
|
|
39
|
+
y,
|
|
40
|
+
moveDurationMs
|
|
41
|
+
};
|
|
42
|
+
this.emit();
|
|
43
|
+
}
|
|
44
|
+
hide() {
|
|
45
|
+
this.state = {
|
|
46
|
+
...DEFAULT
|
|
47
|
+
};
|
|
48
|
+
this.emit();
|
|
49
|
+
}
|
|
50
|
+
setPressing(pressing) {
|
|
51
|
+
this.state = {
|
|
52
|
+
...this.state,
|
|
53
|
+
pressing
|
|
54
|
+
};
|
|
55
|
+
this.emit();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Start moving toward the target immediately, then resolve when the
|
|
60
|
+
* visual move should have finished — so tap happens after the cursor arrives.
|
|
61
|
+
*/
|
|
62
|
+
async moveTo(x, y, durationMs) {
|
|
63
|
+
const ms = Math.max(0, Math.floor(durationMs));
|
|
64
|
+
|
|
65
|
+
// First appearance: snap near target so we don't fly in from (0,0).
|
|
66
|
+
// Wait long enough for CursorOverlay's transparent Modal to present
|
|
67
|
+
// (hosts with native-stack often need >100ms; 32ms left it invisible).
|
|
68
|
+
if (!this.state.visible) {
|
|
69
|
+
this.showAt(x, y, 0);
|
|
70
|
+
await sleep(140);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const dx = x - this.state.x;
|
|
74
|
+
const dy = y - this.state.y;
|
|
75
|
+
const dist = Math.hypot(dx, dy);
|
|
76
|
+
// Tiny hops: snap; longer moves: animate, then wait for arrival.
|
|
77
|
+
if (dist < 8 || ms === 0) {
|
|
78
|
+
this.showAt(x, y, 0);
|
|
79
|
+
await sleep(24);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.showAt(x, y, ms);
|
|
83
|
+
// Allow React to start Animated.timing, then wait for arrival.
|
|
84
|
+
await sleep(ms + 24);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function sleep(ms) {
|
|
88
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
89
|
+
}
|
|
90
|
+
const CursorController = exports.CursorController = new CursorControllerImpl();
|
|
91
|
+
//# sourceMappingURL=controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT","visible","x","y","pressing","moveDurationMs","CursorControllerImpl","state","listeners","Set","subscribe","listener","add","delete","getState","emit","l","showAt","hide","setPressing","moveTo","durationMs","ms","Math","max","floor","sleep","dx","dy","dist","hypot","Promise","resolve","setTimeout","CursorController","exports"],"sourceRoot":"../../../src","sources":["cursor/controller.ts"],"mappings":";;;;;;AAWA,MAAMA,OAAoB,GAAG;EAC3BC,OAAO,EAAE,KAAK;EACdC,CAAC,EAAE,CAAC;EACJC,CAAC,EAAE,CAAC;EACJC,QAAQ,EAAE,KAAK;EACfC,cAAc,EAAE;AAClB,CAAC;;AAED;AACA;AACA;AACA,MAAMC,oBAAoB,CAAC;EACjBC,KAAK,GAAgB;IAAE,GAAGP;EAAQ,CAAC;EACnCQ,SAAS,GAAG,IAAIC,GAAG,CAAiB,CAAC;EAE7CC,SAASA,CAACC,QAAwB,EAAc;IAC9C,IAAI,CAACH,SAAS,CAACI,GAAG,CAACD,QAAQ,CAAC;IAC5BA,QAAQ,CAAC,IAAI,CAACJ,KAAK,CAAC;IACpB,OAAO,MAAM,IAAI,CAACC,SAAS,CAACK,MAAM,CAACF,QAAQ,CAAC;EAC9C;EAEAG,QAAQA,CAAA,EAAgB;IACtB,OAAO,IAAI,CAACP,KAAK;EACnB;EAEQQ,IAAIA,CAAA,EAAG;IACb,KAAK,MAAMC,CAAC,IAAI,IAAI,CAACR,SAAS,EAAEQ,CAAC,CAAC,IAAI,CAACT,KAAK,CAAC;EAC/C;EAEAU,MAAMA,CAACf,CAAS,EAAEC,CAAS,EAAEE,cAAc,GAAG,CAAC,EAAE;IAC/C,IAAI,CAACE,KAAK,GAAG;MACX,GAAG,IAAI,CAACA,KAAK;MACbN,OAAO,EAAE,IAAI;MACbC,CAAC;MACDC,CAAC;MACDE;IACF,CAAC;IACD,IAAI,CAACU,IAAI,CAAC,CAAC;EACb;EAEAG,IAAIA,CAAA,EAAG;IACL,IAAI,CAACX,KAAK,GAAG;MAAE,GAAGP;IAAQ,CAAC;IAC3B,IAAI,CAACe,IAAI,CAAC,CA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MAAMY,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAI5B,oBAAoB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.HAND_UNIT = exports.HAND_STROKE = exports.HAND_SHAPES = exports.CURSOR_W = exports.CURSOR_TIP_Y = exports.CURSOR_TIP_X = exports.CURSOR_H = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Geometry for the agent's on-screen pointer.
|
|
9
|
+
*
|
|
10
|
+
* Two overlays draw it (KokoObserver when the progress chrome is mounted,
|
|
11
|
+
* CursorOverlay otherwise), so this lives in one place: a hotspot that
|
|
12
|
+
* disagreed between them would put the pointer somewhere the tap did not go.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Design grid the hand is laid out on. */
|
|
16
|
+
const GRID_W = 34;
|
|
17
|
+
const GRID_H = 44;
|
|
18
|
+
|
|
19
|
+
/** Keep the grid ratio so the drawing is not squashed. */
|
|
20
|
+
const CURSOR_W = exports.CURSOR_W = 26;
|
|
21
|
+
const CURSOR_H = exports.CURSOR_H = Math.round(CURSOR_W * GRID_H / GRID_W);
|
|
22
|
+
|
|
23
|
+
/** Points per grid unit. */
|
|
24
|
+
const HAND_UNIT = exports.HAND_UNIT = CURSOR_W / GRID_W;
|
|
25
|
+
|
|
26
|
+
/** Outline weight, in grid units. */
|
|
27
|
+
const HAND_STROKE = exports.HAND_STROKE = 1.6;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The hand as a union of rounded bars: `[x, y, width, height, radius]` in grid
|
|
31
|
+
* units. Order is back to front, though within a layer it does not matter.
|
|
32
|
+
*/
|
|
33
|
+
const HAND_SHAPES = exports.HAND_SHAPES = [[10, 1.5, 7, 24.5, 3.5],
|
|
34
|
+
// index finger, extended — its tip is the hotspot
|
|
35
|
+
[16.5, 17, 6.5, 13, 3.2],
|
|
36
|
+
// middle, folded
|
|
37
|
+
[21.5, 19, 6.5, 12, 3.2],
|
|
38
|
+
// ring, folded
|
|
39
|
+
[26, 21.5, 5.5, 10.5, 2.7],
|
|
40
|
+
// little, folded
|
|
41
|
+
[7, 24, 24, 18, 6.5],
|
|
42
|
+
// palm
|
|
43
|
+
[2.5, 27, 9.5, 7, 3.5] // thumb, across the side of the palm
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
/** The index fingertip — this is what lands on the tap coordinate. */
|
|
47
|
+
const CURSOR_TIP_X = exports.CURSOR_TIP_X = 13.5 * HAND_UNIT;
|
|
48
|
+
const CURSOR_TIP_Y = exports.CURSOR_TIP_Y = 0.6 * HAND_UNIT;
|
|
49
|
+
//# sourceMappingURL=pointer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GRID_W","GRID_H","CURSOR_W","exports","CURSOR_H","Math","round","HAND_UNIT","HAND_STROKE","HAND_SHAPES","CURSOR_TIP_X","CURSOR_TIP_Y"],"sourceRoot":"../../../src","sources":["cursor/pointer.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMA,MAAM,GAAG,EAAE;AACjB,MAAMC,MAAM,GAAG,EAAE;;AAEjB;AACO,MAAMC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,EAAE;AACnB,MAAME,QAAQ,GAAAD,OAAA,CAAAC,QAAA,GAAGC,IAAI,CAACC,KAAK,CAAEJ,QAAQ,GAAGD,MAAM,GAAID,MAAM,CAAC;;AAEhE;AACO,MAAMO,SAAS,GAAAJ,OAAA,CAAAI,SAAA,GAAGL,QAAQ,GAAGF,MAAM;;AAE1C;AACO,MAAMQ,WAAW,GAAAL,OAAA,CAAAK,WAAA,GAAG,GAAG;;AAE9B;AACA;AACA;AACA;AACO,MAAMC,WAEZ,GAAAN,OAAA,CAAAM,WAAA,GAAG,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