@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,"file":"safeArea.d.ts","sourceRoot":"","sources":["../../../../src/ui/safeArea.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAsDF;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,cAAc,CA6B1D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { View } from 'react-native';
|
|
2
|
+
export type OverlayOrigin = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Where the overlay layer itself sits inside the window.
|
|
8
|
+
*
|
|
9
|
+
* Agent coordinates are window-absolute: that is what the native dump reports
|
|
10
|
+
* and where a synthetic touch is dispatched. The cursor, though, is laid out
|
|
11
|
+
* inside the host's React tree, and hosts routinely pad their root for the
|
|
12
|
+
* status bar — so a fingertip drawn at the tap coordinate lands a status bar
|
|
13
|
+
* lower than the touch it is meant to represent. Measuring the layer's own
|
|
14
|
+
* origin and subtracting it keeps the two in the same space, and costs nothing
|
|
15
|
+
* for hosts that do not pad (the origin is then zero).
|
|
16
|
+
*/
|
|
17
|
+
export declare function useOverlayOrigin(): {
|
|
18
|
+
ref: import("react").RefObject<View>;
|
|
19
|
+
origin: OverlayOrigin;
|
|
20
|
+
measure: () => void;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useOverlayOrigin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOverlayOrigin.d.ts","sourceRoot":"","sources":["../../../../src/ui/useOverlayOrigin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,aAAa,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB;;;;EAY/B"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { TaskStore, type TaskStoreImpl } from './task/TaskStore';
|
|
2
|
+
import { AgentSession, type AgentSessionOptions } from './client/AgentSession';
|
|
3
|
+
import { type LocalizedText } from './i18n';
|
|
4
|
+
import type { AgentAction, AgentActionResult, DumpOptions, KokoAgentConfig, PinchOptions, Point, Selector, SensitiveConfirmContext, SwipeOptions, TapOptions, TypeOptions, ViewNode } from './types';
|
|
5
|
+
export type TapTarget = {
|
|
6
|
+
selector?: Selector;
|
|
7
|
+
nodeId?: string;
|
|
8
|
+
point?: Point;
|
|
9
|
+
options?: TapOptions;
|
|
10
|
+
/** Used by confirmation gate + subtitle. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Internal: preserve input-field targeting while focusing a type action. */
|
|
13
|
+
inputTarget?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type TypeTarget = {
|
|
16
|
+
selector?: Selector;
|
|
17
|
+
nodeId?: string;
|
|
18
|
+
options?: TypeOptions;
|
|
19
|
+
label?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Koko Agent SDK runtime — dump / find / tap / swipe / pinch / type + cursor + confirm gate + task log.
|
|
23
|
+
*/
|
|
24
|
+
export declare class KokoAgent {
|
|
25
|
+
private config;
|
|
26
|
+
private lastTree;
|
|
27
|
+
private planningTree;
|
|
28
|
+
private readonly ocrTargets;
|
|
29
|
+
private nextOcrTargetId;
|
|
30
|
+
/** Labels already confirmed in the current runGoal — avoid repeat dialogs on retry. */
|
|
31
|
+
private confirmedSensitive;
|
|
32
|
+
/** Last tap used a host `run` callback (tab/CTA) — skip false tap_noop. */
|
|
33
|
+
lastTapViaHost: {
|
|
34
|
+
kind?: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
} | null;
|
|
37
|
+
/** Current NL goal; direct SDK callers may opt into visible scroll search. */
|
|
38
|
+
activeGoal?: string;
|
|
39
|
+
constructor(config?: KokoAgentConfig);
|
|
40
|
+
configure(patch: Partial<KokoAgentConfig>): void;
|
|
41
|
+
getConfig(): KokoAgentConfig;
|
|
42
|
+
private message;
|
|
43
|
+
private text;
|
|
44
|
+
isNativeReady(): boolean;
|
|
45
|
+
/** Start a user-facing task (shows subtitle + appears in panel). */
|
|
46
|
+
startTask(title: string): import(".").Task;
|
|
47
|
+
finishTask(status?: 'success' | 'failed' | 'cancelled', summary?: LocalizedText): void;
|
|
48
|
+
/** Manually append an observer log node (for cloud agent narration). */
|
|
49
|
+
log(kind: Parameters<typeof TaskStore.appendNode>[0]['kind'], title: LocalizedText, detail?: string): import(".").TaskNode | null;
|
|
50
|
+
/** Open a cloud-backed agent session (official gateway; LLM vendor is server-side). */
|
|
51
|
+
createSession(opts: AgentSessionOptions): AgentSession;
|
|
52
|
+
/**
|
|
53
|
+
* One-shot: talk to official gateway → local dump/find/tap until done.
|
|
54
|
+
* Users never supply model API keys. Token comes from opts or KokoProvider config.gateway.
|
|
55
|
+
*/
|
|
56
|
+
private activeSession;
|
|
57
|
+
private executionEpoch;
|
|
58
|
+
private claimingCheckpoint;
|
|
59
|
+
/** @internal Sessions created through createSession share runGoal's owner. */
|
|
60
|
+
acquireSession(session: AgentSession): boolean;
|
|
61
|
+
/** @internal Release only an owner acquired by a direct session.run(). */
|
|
62
|
+
releaseSession(session: AgentSession): void;
|
|
63
|
+
/** @internal Invalidates gestures already waiting on confirmation/animation. */
|
|
64
|
+
cancelPendingActions(): void;
|
|
65
|
+
private assertExecutionCurrent;
|
|
66
|
+
runGoal(goal: string, opts?: Partial<AgentSessionOptions> & {
|
|
67
|
+
resumes?: number;
|
|
68
|
+
}): Promise<import(".").AgentRunResult>;
|
|
69
|
+
/**
|
|
70
|
+
* Pick up a run that a JS-context restart interrupted, if any.
|
|
71
|
+
*
|
|
72
|
+
* Called once per init by KokoProvider. Resolves to the resumed goal, or null
|
|
73
|
+
* when there was nothing fresh to resume. The planner decides what is left to
|
|
74
|
+
* do from the screen the App came back on — if the goal already happened, it
|
|
75
|
+
* answers `done` without touching anything.
|
|
76
|
+
*/
|
|
77
|
+
resumeInterruptedRun(): Promise<string | null>;
|
|
78
|
+
/**
|
|
79
|
+
* On-device exploration crawl — builds a local screen/transition graph
|
|
80
|
+
* without a host feature tree. Safe-ish (skips sensitive labels). Call
|
|
81
|
+
* after SDK init / on a debug build; then runGoal can reuse the graph.
|
|
82
|
+
*/
|
|
83
|
+
bootstrapExplore(opts?: import('./explore/bootstrapExplore').BootstrapExploreOptions): Promise<import(".").BootstrapExploreResult>;
|
|
84
|
+
/** Snapshot of the on-device exploration graph (nodes/edges). */
|
|
85
|
+
getExplorationGraph(): import(".").ExplorationGraphSnapshot;
|
|
86
|
+
clearExplorationGraph(): void;
|
|
87
|
+
/** Refresh plan / quota / entitlements from gateway. */
|
|
88
|
+
refreshAccount(): Promise<import("./types").KokoAccountSnapshot | null>;
|
|
89
|
+
getAccount(): import("./types").KokoAccountSnapshot | null;
|
|
90
|
+
/** Stop the in-flight runGoal / session, if any. */
|
|
91
|
+
stop(): void;
|
|
92
|
+
/** Open chat sheet (history + NL input) from host UI. */
|
|
93
|
+
openChat(taskId?: string | null): void;
|
|
94
|
+
closeChat(): void;
|
|
95
|
+
getTaskStore(): TaskStoreImpl;
|
|
96
|
+
dump(options?: DumpOptions): Promise<ViewNode>;
|
|
97
|
+
/**
|
|
98
|
+
* Screenshot the host app. By default hides Koko overlay layers
|
|
99
|
+
* (progress / cursor / sheet) so the image matches what dump sees.
|
|
100
|
+
*/
|
|
101
|
+
screenshot(options?: {
|
|
102
|
+
hideOverlays?: boolean;
|
|
103
|
+
}): Promise<import(".").ScreenshotResult>;
|
|
104
|
+
getLastTree(): ViewNode | null;
|
|
105
|
+
/** @internal Return a locally observed OCR label for validating a planned action. */
|
|
106
|
+
observedOcrLabel(nodeId: string | undefined): string | undefined;
|
|
107
|
+
/** @internal Pin the screen whose node ids the planner is about to see. */
|
|
108
|
+
setPlanningTree(tree: ViewNode | null): void;
|
|
109
|
+
find(selector: Selector, tree?: ViewNode): Promise<ViewNode | null>;
|
|
110
|
+
findAll(selector: Selector, tree?: ViewNode): Promise<ViewNode[]>;
|
|
111
|
+
tap(target: TapTarget): Promise<void>;
|
|
112
|
+
/** Animation and confirmations may outlive the layout that was planned. */
|
|
113
|
+
private assertTapTargetCurrent;
|
|
114
|
+
/** Refresh node metadata after scroll-based target resolution. */
|
|
115
|
+
private ensureSafeTapPoint;
|
|
116
|
+
/** Reveal by visible swipes, only inside a natively confirmed scrollable list. */
|
|
117
|
+
private revealVisibleTarget;
|
|
118
|
+
swipe(from: Point, to: Point, options?: SwipeOptions): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Two-finger pinch at center. scale>1 zoom in, scale<1 zoom out.
|
|
121
|
+
*/
|
|
122
|
+
pinch(center: Point, scale: number, options?: PinchOptions): Promise<void>;
|
|
123
|
+
type(text: string, target?: TypeTarget): Promise<void>;
|
|
124
|
+
requestConfirm(ctx: SensitiveConfirmContext): Promise<boolean>;
|
|
125
|
+
hideCursor(): void;
|
|
126
|
+
/** Run one agent protocol tool call. */
|
|
127
|
+
runAction(action: AgentAction): Promise<AgentActionResult>;
|
|
128
|
+
private track;
|
|
129
|
+
private done;
|
|
130
|
+
private fail;
|
|
131
|
+
private resolvePoint;
|
|
132
|
+
private validatedNativeNode;
|
|
133
|
+
private currentOcrPoint;
|
|
134
|
+
/**
|
|
135
|
+
* A coordinate tap has no node to sanity-check it against, so an invented
|
|
136
|
+
* point would dispatch into nowhere and only surface later as tap_noop.
|
|
137
|
+
* Fail loudly instead.
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* A tree that bottoms out exactly at the cap was almost certainly cut short,
|
|
141
|
+
* and the part that gets cut is the page body — the agent is then left with
|
|
142
|
+
* the shallow chrome and reports the control as missing. Surface it rather
|
|
143
|
+
* than letting it read as an empty screen.
|
|
144
|
+
*/
|
|
145
|
+
private warnIfDepthCapped;
|
|
146
|
+
/**
|
|
147
|
+
* Cheap screen fingerprint used to tell real navigation from a dead action.
|
|
148
|
+
* The "before" side can reuse the tree the session just dumped for this step:
|
|
149
|
+
* an extra full walk per tap is work the JS thread does not have to spare
|
|
150
|
+
* while a task is running.
|
|
151
|
+
*/
|
|
152
|
+
private snapshotLine;
|
|
153
|
+
private pointWithinWindow;
|
|
154
|
+
/** Resolve the view node for a tap target (for toggle/adjustable routing). */
|
|
155
|
+
/**
|
|
156
|
+
* Where to point while a host action runs.
|
|
157
|
+
*
|
|
158
|
+
* Best effort by design: the whole reason this path exists is that the dump
|
|
159
|
+
* sometimes cannot see the control, so a miss here is normal and must not
|
|
160
|
+
* turn a working host action into a failed step.
|
|
161
|
+
*/
|
|
162
|
+
private hostActionPoint;
|
|
163
|
+
private resolveNode;
|
|
164
|
+
}
|
|
165
|
+
export declare function getKokoAgent(): KokoAgent;
|
|
166
|
+
export declare function initKokoAgent(config?: KokoAgentConfig): KokoAgent;
|
|
167
|
+
//# sourceMappingURL=KokoAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KokoAgent.d.ts","sourceRoot":"","sources":["../../../src/KokoAgent.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAU/E,OAAO,EAA4F,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEtI,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,uBAAuB,EACvB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACT,MAAM,SAAS,CAAC;AAEjB,MAAM,M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G;IACH,OAAO,CAAC,iBAAiB;IAazB;;;;;OAKG;YACW,YAAY;YAWZ,iBAAiB;IAoB/B,8EAA8E;IAC9E;;;;;;OAMG;YACW,eAAe;YAYf,WAAW;CA2B1B;AA0LD,wBAAgB,YAAY,IAAI,SAAS,CAGxC;AAED,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,CAGjE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ViewNode } from '../types';
|
|
2
|
+
import { type AssistIntent } from './intentClassify';
|
|
3
|
+
import { type RankedNode } from './nodeRank';
|
|
4
|
+
export type OnDeviceAssistResult = {
|
|
5
|
+
intent: AssistIntent;
|
|
6
|
+
confidence: number;
|
|
7
|
+
tokens: string[];
|
|
8
|
+
ocrTokens: string[];
|
|
9
|
+
/** Goal-derived labels verified against local OCR, never raw page text. */
|
|
10
|
+
goalOcrLabels?: string[];
|
|
11
|
+
/** Only allowlisted public wallet product names, verified locally. */
|
|
12
|
+
walletChoices?: string[];
|
|
13
|
+
ranked: RankedNode[];
|
|
14
|
+
/** Compact planner block (empty when nothing useful). */
|
|
15
|
+
modelText: string;
|
|
16
|
+
backend: string;
|
|
17
|
+
};
|
|
18
|
+
export type BuildAssistOptions = {
|
|
19
|
+
/** Skip Vision OCR (tests / hosts without camera-style capture). Default false. */
|
|
20
|
+
skipOcr?: boolean;
|
|
21
|
+
/** Cap OCR tokens merged into ranking. */
|
|
22
|
+
maxOcrTokens?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* On-device assist: JS intent + node rank, optional native OCR.
|
|
26
|
+
* Enriches the cloud planner `ui_screen_model` — does not replace the LLM.
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildOnDeviceAssist(goal: string, tree: ViewNode | null | undefined, opts?: BuildAssistOptions): Promise<OnDeviceAssistResult>;
|
|
29
|
+
/** Sync path for unit tests / hosts that already have OCR tokens. */
|
|
30
|
+
export declare function buildOnDeviceAssistSync(goal: string, tree: ViewNode | null | undefined, ocrTokens?: string[], backend?: string): OnDeviceAssistResult;
|
|
31
|
+
//# sourceMappingURL=OnDeviceAssist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnDeviceAssist.d.ts","sourceRoot":"","sources":["../../../../src/assist/OnDeviceAssist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAsB,KAAK,YAAY,EAAqB,MAAM,kBAAkB,CAAC;AAE5F,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,mFAAmF;IACnF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,EACjC,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAuD/B;AAED,qEAAqE;AACrE,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,EACjC,SAAS,GAAE,MAAM,EAAO,EACxB,OAAO,SAAO,GACb,oBAAoB,CA4BtB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On-device goal intent classification (structural, host-agnostic).
|
|
3
|
+
* Complements Core ML / Vision OCR — no package IDs or product copy.
|
|
4
|
+
*/
|
|
5
|
+
export type AssistIntent = 'tap' | 'type' | 'scroll' | 'back' | 'search' | 'settings' | 'unknown';
|
|
6
|
+
export type IntentResult = {
|
|
7
|
+
intent: AssistIntent;
|
|
8
|
+
confidence: number;
|
|
9
|
+
/** Tokens useful for node ranking (from the goal itself). */
|
|
10
|
+
tokens: string[];
|
|
11
|
+
};
|
|
12
|
+
/** Extract short goal tokens for ranking (CJK chunks + latin words). */
|
|
13
|
+
export declare function goalTokens(goal: string): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Cheap on-device intent — runs everywhere (JS). iOS Vision OCR enriches tokens separately.
|
|
16
|
+
*/
|
|
17
|
+
export declare function classifyGoalIntent(goal: string): IntentResult;
|
|
18
|
+
//# sourceMappingURL=intentClassify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intentClassify.d.ts","sourceRoot":"","sources":["../../../../src/assist/intentClassify.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,YAAY,GACpB,KAAK,GACL,MAAM,GACN,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,UAAU,GACV,SAAS,CAAC;AAEd,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiCF,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAejD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAgD7D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ViewNode } from '../types';
|
|
2
|
+
import type { AssistIntent } from './intentClassify';
|
|
3
|
+
export type RankedNode = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
score: number;
|
|
7
|
+
clickable: boolean;
|
|
8
|
+
kindHint: 'button' | 'field' | 'scroll' | 'other';
|
|
9
|
+
};
|
|
10
|
+
export type OcrTextHit = {
|
|
11
|
+
text: string;
|
|
12
|
+
confidence: number;
|
|
13
|
+
frame?: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Rank dump nodes for an on-device assist pass (goal tokens + OCR tokens + intent).
|
|
22
|
+
*/
|
|
23
|
+
export declare function rankNodesForGoal(tree: ViewNode, opts: {
|
|
24
|
+
intent: AssistIntent;
|
|
25
|
+
tokens: string[];
|
|
26
|
+
/** Extra tokens from Vision OCR (iOS). */
|
|
27
|
+
ocrTokens?: string[];
|
|
28
|
+
limit?: number;
|
|
29
|
+
}): RankedNode[];
|
|
30
|
+
/** Compact block for the cloud planner screen model. */
|
|
31
|
+
export declare function assistHintsModelText(intent: AssistIntent, confidence: number, ranked: RankedNode[], ocrTokens: string[], backend: string, ocrTexts?: OcrTextHit[]): string;
|
|
32
|
+
//# sourceMappingURL=nodeRank.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeRank.d.ts","sourceRoot":"","sources":["../../../../src/assist/nodeRank.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE,CAAC;AAqCF;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE;IACJ,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACA,UAAU,EAAE,CA0Dd;AAED,wDAAwD;AACxD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAAE,EACpB,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,UAAU,EAAO,GAC1B,MAAM,CAiCR"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Point, Frame, ViewNode } from '../types';
|
|
2
|
+
export type PositionedOcrText = {
|
|
3
|
+
text: string;
|
|
4
|
+
confidence: number;
|
|
5
|
+
frame?: Frame;
|
|
6
|
+
};
|
|
7
|
+
/** Visible web regions let a short translated action stay scoped to the page. */
|
|
8
|
+
export declare function visibleWebViewFrames(root: ViewNode): Frame[];
|
|
9
|
+
export declare function ocrHitInFrames(hit: PositionedOcrText, frames: Frame[]): boolean;
|
|
10
|
+
/** Candidate labels are derived only from the user's goal, never screen text. */
|
|
11
|
+
export declare function goalOcrCandidates(goal: string): string[];
|
|
12
|
+
export declare function verifiedGoalOcrLabels(goal: string, root: ViewNode | null | undefined, texts: PositionedOcrText[]): string[];
|
|
13
|
+
export declare const PUBLIC_WALLET_CHOICES: readonly ["WalletConnect", "MetaMask", "Coinbase Wallet", "Uniswap Mobile", "Uniswap Wallet", "Binance Wallet", "Trust Wallet", "Phantom", "OKX Wallet", "Rabby Wallet", "OneKey", "UKey", "UKey Wallet", "Solflare"];
|
|
14
|
+
export declare function walletConnectionAllowed(goal: string): boolean;
|
|
15
|
+
export declare function verifiedWalletChoices(goal: string, root: ViewNode | null | undefined, texts: PositionedOcrText[]): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Resolve text that is visible in a WebView/Canvas but absent from the native
|
|
18
|
+
* accessibility tree. The frame comes from native OCR and is already in the
|
|
19
|
+
* same window-absolute logical coordinate space used by dispatchTap.
|
|
20
|
+
*/
|
|
21
|
+
export declare function findOcrTextPoint(texts: PositionedOcrText[], wanted: string): Point | null;
|
|
22
|
+
export declare function findOcrTextHit(texts: PositionedOcrText[], wanted: string, options?: {
|
|
23
|
+
translatedWebRegions?: Frame[];
|
|
24
|
+
}): PositionedOcrText | null;
|
|
25
|
+
//# sourceMappingURL=ocrTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ocrTarget.d.ts","sourceRoot":"","sources":["../../../../src/assist/ocrTarget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAQF,iFAAiF;AACjF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,CAe5D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAI/E;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAsBxD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAQ3H;AAGD,eAAO,MAAM,qBAAqB,uNAGxB,CAAC;AAEX,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAI7D;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAS3H;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,iBAAiB,EAAE,EAC1B,MAAM,EAAE,MAAM,GACb,KAAK,GAAG,IAAI,CAMd;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,iBAAiB,EAAE,EAC1B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IAAE,oBAAoB,CAAC,EAAE,KAAK,EAAE,CAAA;CAAO,GAC/C,iBAAiB,GAAG,IAAI,CA6B1B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PositionedOcrText } from './ocrTarget';
|
|
2
|
+
import type { ViewNode } from '../types';
|
|
3
|
+
/** Local-only text sets: callers may report only whether content changed. */
|
|
4
|
+
export declare function webVisualLabels(root: ViewNode | null, hits: PositionedOcrText[]): Set<string> | null;
|
|
5
|
+
export declare function webVisualChanged(before: Set<string> | null, after: Set<string> | null): boolean;
|
|
6
|
+
//# sourceMappingURL=webVisualChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webVisualChange.d.ts","sourceRoot":"","sources":["../../../../src/assist/webVisualChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAYpG;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,OAAO,CAK/F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type LocalizedText } from '../i18n';
|
|
2
|
+
/** A dispatched action may have committed; replay would risk a duplicate. */
|
|
3
|
+
export declare class ActionOutcomeUnknownError extends Error {
|
|
4
|
+
readonly detail: string;
|
|
5
|
+
readonly localizedMessage: import("../i18n").LocalizedMessage;
|
|
6
|
+
constructor(detail: string);
|
|
7
|
+
}
|
|
8
|
+
/** Validation rejected a target before an action was dispatched. Replan safely. */
|
|
9
|
+
export declare class ActionValidationError extends Error {
|
|
10
|
+
readonly localizedMessage: LocalizedText;
|
|
11
|
+
constructor(localizedMessage: LocalizedText);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ActionOutcomeUnknownError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionOutcomeUnknownError.d.ts","sourceRoot":"","sources":["../../../../src/client/ActionOutcomeUnknownError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAEnE,6EAA6E;AAC7E,qBAAa,yBAA0B,SAAQ,KAAK;IAEtC,QAAQ,CAAC,MAAM,EAAE,MAAM;IADnC,QAAQ,CAAC,gBAAgB,qCAAuC;gBAC3C,MAAM,EAAE,MAAM;CAIpC;AAED,mFAAmF;AACnF,qBAAa,qBAAsB,SAAQ,KAAK;IAClC,QAAQ,CAAC,gBAAgB,EAAE,aAAa;gBAA/B,gBAAgB,EAAE,aAAa;CAIrD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { KokoAgent } from '../KokoAgent';
|
|
2
|
+
import { type GatewayConfig } from './GatewayClient';
|
|
3
|
+
export type AskUserHandler = (question: string) => Promise<string | null>;
|
|
4
|
+
export type AgentSessionOptions = GatewayConfig & {
|
|
5
|
+
locale?: string;
|
|
6
|
+
localRetries?: number;
|
|
7
|
+
onAskUser?: AskUserHandler;
|
|
8
|
+
onNarration?: (text: string) => void;
|
|
9
|
+
userGateTimeoutMs?: number;
|
|
10
|
+
/** Picked up after a JS-context restart killed the original run. */
|
|
11
|
+
resumedFromReload?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type AgentRunResult = {
|
|
14
|
+
success: boolean;
|
|
15
|
+
summary: string;
|
|
16
|
+
steps: number;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Cursor-like session with:
|
|
21
|
+
* - Preflight risk confirm (before loop)
|
|
22
|
+
* - Unattended execution (stop only)
|
|
23
|
+
* - Pause when App shows password/PIN/OTP until user finishes
|
|
24
|
+
*/
|
|
25
|
+
export declare class AgentSession {
|
|
26
|
+
private readonly agent;
|
|
27
|
+
private readonly gateway;
|
|
28
|
+
private readonly opts;
|
|
29
|
+
private sessionId;
|
|
30
|
+
private history;
|
|
31
|
+
private stopped;
|
|
32
|
+
private running;
|
|
33
|
+
private readonly operationReplayGuard;
|
|
34
|
+
constructor(agent: KokoAgent, opts: AgentSessionOptions);
|
|
35
|
+
stop(): void;
|
|
36
|
+
private uiLocale;
|
|
37
|
+
private text;
|
|
38
|
+
private message;
|
|
39
|
+
private assertRunning;
|
|
40
|
+
run(goal: string): Promise<AgentRunResult>;
|
|
41
|
+
private runInternal;
|
|
42
|
+
private pushHistory;
|
|
43
|
+
/** Retry transient upstream / network failures so a completed UI goal is not
|
|
44
|
+
* marked failed just because the next planning round could not reach the LLM. */
|
|
45
|
+
private nextWithRetry;
|
|
46
|
+
private safeDump;
|
|
47
|
+
private webVisualLabels;
|
|
48
|
+
/**
|
|
49
|
+
* When the App presents credentials or recovery material, wait locally.
|
|
50
|
+
* Koko does not collect secrets — user types in the App UI.
|
|
51
|
+
*/
|
|
52
|
+
private waitForAppUserGateIfNeeded;
|
|
53
|
+
private executeWithRetry;
|
|
54
|
+
private executeOnce;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=AgentSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentSession.d.ts","sourceRoot":"","sources":["../../../../src/client/AgentSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiB9C,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAmCzB,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE1E,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAY;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsB;IAC3C,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA8B;gBAEvD,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,mBAAmB;IASvD,IAAI;IAKJ,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,aAAa;IAIf,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;YAYlC,WAAW;IA0gBzB,OAAO,CAAC,WAAW;IASnB;qFACiF;YACnE,aAAa;YAkCb,QAAQ;YAkBR,eAAe;IAU7B;;;OAGG;YACW,0BAA0B;YA2F1B,gBAAgB;YA+BhB,WAAW;CAmE1B"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { AgentAction, Point, Selector } from '../types';
|
|
2
|
+
import type { KokoAccountSnapshot, KokoPlanId } from '../types';
|
|
3
|
+
import type { ViewNode } from '../types';
|
|
4
|
+
export type GatewayConfig = {
|
|
5
|
+
/**
|
|
6
|
+
* Official gateway origin. Defaults to https://sdk.intentcomputing.net
|
|
7
|
+
* Localhost only in Metro debug clients (lab dogfood), not customer self-host.
|
|
8
|
+
*/
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
/**
|
|
11
|
+
* App / member token from your product backend or dashboard.
|
|
12
|
+
* Never an LLM API key — users never see model keys.
|
|
13
|
+
*/
|
|
14
|
+
token: string;
|
|
15
|
+
/**
|
|
16
|
+
* Host App ID (iOS bundle id / Android package name).
|
|
17
|
+
* Defaults to the native module's hostAppId. Must match the App ID bound to the token.
|
|
18
|
+
*/
|
|
19
|
+
appId?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function resolveGatewayBaseUrl(cfg: GatewayConfig): string;
|
|
22
|
+
export type AgentHistoryItem = {
|
|
23
|
+
tool: string;
|
|
24
|
+
args?: Record<string, unknown>;
|
|
25
|
+
result: string;
|
|
26
|
+
ok?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type GatewayNextRequest = {
|
|
29
|
+
session_id?: string;
|
|
30
|
+
goal: string;
|
|
31
|
+
ui_tree?: unknown;
|
|
32
|
+
ui_outline?: string;
|
|
33
|
+
ui_screen_model?: string;
|
|
34
|
+
/** Local-only evidence; gateway serializes only labels derived from goal. */
|
|
35
|
+
local_ocr_goal_labels?: string[];
|
|
36
|
+
local_ocr_wallet_choices?: string[];
|
|
37
|
+
local_web_wallet_aliases?: string[];
|
|
38
|
+
history: AgentHistoryItem[];
|
|
39
|
+
locale?: string;
|
|
40
|
+
user_reply?: string;
|
|
41
|
+
platform?: 'ios' | 'android' | 'unknown';
|
|
42
|
+
};
|
|
43
|
+
/** Build hints from the same redacted tree that crosses the upload boundary. */
|
|
44
|
+
export declare function safePlannerModel(tree: ViewNode, goal: string, localOcrGoalLabels?: string[], localWalletChoices?: string[], hostWalletAliases?: string[]): string;
|
|
45
|
+
export type GatewayAction = {
|
|
46
|
+
tool: 'dump';
|
|
47
|
+
args?: {
|
|
48
|
+
reason?: string;
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
tool: 'find';
|
|
52
|
+
args: {
|
|
53
|
+
match: Array<Record<string, unknown>>;
|
|
54
|
+
index?: number;
|
|
55
|
+
};
|
|
56
|
+
} | {
|
|
57
|
+
tool: 'tap';
|
|
58
|
+
args: {
|
|
59
|
+
selector?: Selector;
|
|
60
|
+
nodeId?: string;
|
|
61
|
+
/** Last-resort window point when the control is visible but not in the tree. */
|
|
62
|
+
point?: Point;
|
|
63
|
+
label?: string;
|
|
64
|
+
};
|
|
65
|
+
} | {
|
|
66
|
+
tool: 'swipe';
|
|
67
|
+
args: {
|
|
68
|
+
from: Point;
|
|
69
|
+
to: Point;
|
|
70
|
+
label?: string;
|
|
71
|
+
};
|
|
72
|
+
} | {
|
|
73
|
+
tool: 'pinch';
|
|
74
|
+
args: {
|
|
75
|
+
center: Point;
|
|
76
|
+
scale: number;
|
|
77
|
+
label?: string;
|
|
78
|
+
};
|
|
79
|
+
} | {
|
|
80
|
+
tool: 'type';
|
|
81
|
+
args: {
|
|
82
|
+
text: string;
|
|
83
|
+
selector?: Selector;
|
|
84
|
+
nodeId?: string;
|
|
85
|
+
clear?: boolean;
|
|
86
|
+
label?: string;
|
|
87
|
+
};
|
|
88
|
+
} | {
|
|
89
|
+
tool: 'ask_user';
|
|
90
|
+
args: {
|
|
91
|
+
question: string;
|
|
92
|
+
};
|
|
93
|
+
} | {
|
|
94
|
+
tool: 'done';
|
|
95
|
+
args: {
|
|
96
|
+
success: boolean;
|
|
97
|
+
summary: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export type GatewayNextResponse = {
|
|
101
|
+
ok: true;
|
|
102
|
+
session_id: string;
|
|
103
|
+
narration: string | null;
|
|
104
|
+
action: GatewayAction;
|
|
105
|
+
provider: string;
|
|
106
|
+
model: string;
|
|
107
|
+
step: number;
|
|
108
|
+
region: string;
|
|
109
|
+
execution_permit: string;
|
|
110
|
+
};
|
|
111
|
+
export type GatewaySessionResponse = {
|
|
112
|
+
ok: true;
|
|
113
|
+
session_id: string;
|
|
114
|
+
execution_permit: string;
|
|
115
|
+
};
|
|
116
|
+
export declare class GatewayError extends Error {
|
|
117
|
+
readonly code: string;
|
|
118
|
+
readonly status: number;
|
|
119
|
+
readonly quota?: KokoAccountSnapshot['quota'];
|
|
120
|
+
readonly plan?: KokoPlanId;
|
|
121
|
+
constructor(message: string, opts: {
|
|
122
|
+
code: string;
|
|
123
|
+
status: number;
|
|
124
|
+
quota?: KokoAccountSnapshot['quota'];
|
|
125
|
+
plan?: KokoPlanId;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
export declare class GatewayClient {
|
|
129
|
+
private readonly baseUrl;
|
|
130
|
+
private readonly token;
|
|
131
|
+
private readonly appId;
|
|
132
|
+
constructor(cfg: GatewayConfig);
|
|
133
|
+
getBaseUrl(): string;
|
|
134
|
+
getAppId(): string;
|
|
135
|
+
private authHeaders;
|
|
136
|
+
private parseError;
|
|
137
|
+
health(): Promise<Record<string, unknown>>;
|
|
138
|
+
/** Open session + initial execution permit (before first dump). */
|
|
139
|
+
beginSession(sessionId?: string): Promise<GatewaySessionResponse>;
|
|
140
|
+
me(): Promise<KokoAccountSnapshot>;
|
|
141
|
+
usage(limit?: number): Promise<{
|
|
142
|
+
quota: KokoAccountSnapshot['quota'];
|
|
143
|
+
plan: KokoPlanId;
|
|
144
|
+
events: unknown[];
|
|
145
|
+
}>;
|
|
146
|
+
next(body: GatewayNextRequest): Promise<GatewayNextResponse>;
|
|
147
|
+
}
|
|
148
|
+
export declare function toLocalAgentAction(action: GatewayAction): AgentAction | null;
|
|
149
|
+
//# sourceMappingURL=GatewayClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GatewayClient.d.ts","sourceRoot":"","sources":["../../../../src/client/GatewayClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAoB,UAAU,EAAE,MAAM,UAAU,CAAC;AAYlF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,EAAE,MAAM,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AC;IAMhD,mEAAmE;IAC7D,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAqBjE,EAAE,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAwClC,KAAK,CAAC,KAAK,SAAK,GAAG,OAAO,CAAC;QAC/B,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,EAAE,UAAU,CAAC;QACjB,MAAM,EAAE,OAAO,EAAE,CAAC;KACnB,CAAC;IAyBI,IAAI,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA6DnE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI,CA+C5E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GatewayAction } from './GatewayClient';
|
|
2
|
+
import type { ViewNode } from '../types';
|
|
3
|
+
/** Keep only hashes of prior public operation entries across privacy purges. */
|
|
4
|
+
export declare class OperationReplayGuard {
|
|
5
|
+
private attempts;
|
|
6
|
+
hasHandoff: boolean;
|
|
7
|
+
reset(): void;
|
|
8
|
+
markHandoff(): void;
|
|
9
|
+
private key;
|
|
10
|
+
record(action: GatewayAction, tree: ViewNode | null): void;
|
|
11
|
+
blocks(action: GatewayAction, tree: ViewNode | null): boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=OperationReplayGuard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationReplayGuard.d.ts","sourceRoot":"","sources":["../../../../src/client/OperationReplayGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAazC,gFAAgF;AAChF,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAqB;IACrC,UAAU,UAAS;IAEnB,KAAK;IACL,WAAW;IAEX,OAAO,CAAC,GAAG;IA6BX,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI;IAKnD,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO;CAI9D"}
|