@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,23 @@
|
|
|
1
|
+
package cn.intentcomputing.kokoagentsdk;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.facebook.react.ReactPackage;
|
|
5
|
+
import com.facebook.react.bridge.NativeModule;
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
8
|
+
import java.util.Collections;
|
|
9
|
+
import java.util.List;
|
|
10
|
+
|
|
11
|
+
public class KokoAgentSdkPackage implements ReactPackage {
|
|
12
|
+
@NonNull
|
|
13
|
+
@Override
|
|
14
|
+
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
|
|
15
|
+
return Collections.<NativeModule>singletonList(new KokoAgentSdkModule(reactContext));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@NonNull
|
|
19
|
+
@Override
|
|
20
|
+
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
|
|
21
|
+
return Collections.emptyList();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Integration guide · `@intentcomputing/koko-agent-sdk`
|
|
2
|
+
|
|
3
|
+
For React Native host apps. After installing the package you must link native code and rebuild once — the same flow as other RN libraries with native modules.
|
|
4
|
+
|
|
5
|
+
> 中文版:[INTEGRATION.zh-CN.md](./INTEGRATION.zh-CN.md)
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- React Native ≥ 0.73 (or Expo Dev Client / `expo prebuild` — **not Expo Go**)
|
|
10
|
+
- iOS deployment target ≥ 15; ability to run `pod install`
|
|
11
|
+
- An **app token** from Intent Computing (`gateway.token` — not a DeepSeek / OpenAI key)
|
|
12
|
+
|
|
13
|
+
## Checklist
|
|
14
|
+
|
|
15
|
+
1. Install the npm package
|
|
16
|
+
2. iOS: `pod install` (Android usually autolinks)
|
|
17
|
+
3. **Rebuild native** (Debug or Release)
|
|
18
|
+
4. Wrap the root tree with `KokoProvider` and set `token`
|
|
19
|
+
5. Launch and send a natural-language goal
|
|
20
|
+
|
|
21
|
+
JS-only config changes can hot-reload via Metro. **First integration or any native SDK change requires a native rebuild.**
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 1. Install
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @intentcomputing/koko-agent-sdk
|
|
29
|
+
# or
|
|
30
|
+
yarn add @intentcomputing/koko-agent-sdk
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Yarn workspaces example:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn workspace @your/mobile add @intentcomputing/koko-agent-sdk
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 2. Link native code
|
|
40
|
+
|
|
41
|
+
**iOS**
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cd ios && pod install && cd ..
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Android**
|
|
48
|
+
React Native autolinking picks up `android/`. No manual Package registration unless autolinking is disabled.
|
|
49
|
+
|
|
50
|
+
## 3. Rebuild the host app
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx react-native run-ios
|
|
54
|
+
npx react-native run-android
|
|
55
|
+
# or Xcode / Android Studio / expo run:ios|android
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Without a rebuild, `dump` / `tap` will fail because the native module is missing.
|
|
59
|
+
|
|
60
|
+
## 4. Root provider
|
|
61
|
+
|
|
62
|
+
Wrap at the app root (or outermost navigation shell):
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { KokoProvider } from '@intentcomputing/koko-agent-sdk';
|
|
66
|
+
|
|
67
|
+
export default function App() {
|
|
68
|
+
return (
|
|
69
|
+
<KokoProvider
|
|
70
|
+
config={{
|
|
71
|
+
gateway: {
|
|
72
|
+
token: 'YOUR_APP_TOKEN',
|
|
73
|
+
// Default: https://sdk.intentcomputing.net
|
|
74
|
+
// China: https://sdk.intentcomputing.cn
|
|
75
|
+
// baseUrl: 'https://sdk.intentcomputing.cn',
|
|
76
|
+
},
|
|
77
|
+
// locale: 'en', // default
|
|
78
|
+
// locale: 'zh',
|
|
79
|
+
// branding: { name, tagline, placeholder, primaryColor, icon },
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<Home />
|
|
83
|
+
</KokoProvider>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`KokoProvider` will:
|
|
89
|
+
|
|
90
|
+
- Initialize the agent with `gateway.token`
|
|
91
|
+
- Mount cursor, progress, and chat sheet (optional — see below)
|
|
92
|
+
|
|
93
|
+
Open chat from host UI:
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
import { getKokoAgent } from '@intentcomputing/koko-agent-sdk';
|
|
97
|
+
|
|
98
|
+
getKokoAgent().openChat();
|
|
99
|
+
// or getKokoAgent().runGoal('Open settings');
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Optional props / config
|
|
103
|
+
|
|
104
|
+
| Key | Purpose | Default |
|
|
105
|
+
|--|--|--|
|
|
106
|
+
| `cursor` | Action cursor overlay | `true` |
|
|
107
|
+
| `observer` | Progress + chat host | `true` |
|
|
108
|
+
| `dialogs` | Confirm / ask-user dialogs | `true` |
|
|
109
|
+
| `config.locale` | `en` \| `zh` | **`en`** |
|
|
110
|
+
| `config.branding` | Name, placeholder, accent | SDK defaults |
|
|
111
|
+
| `config.webWalletAliases` | Public labels under which the host's own injected wallet appears in web wallet choosers; declare only verified aliases | None |
|
|
112
|
+
| `config.debug` | Verbose logs | On in Metro development builds unless explicitly `false`; off in release builds |
|
|
113
|
+
|
|
114
|
+
## 5. Contract for React Native hosts
|
|
115
|
+
|
|
116
|
+
The SDK observes the current native view tree and verifies actions against the live screen. It does not assume a wallet layout, fixed tab names, header coordinates or a particular navigation library. Provide the following semantics so navigation and private boundaries remain reliable across custom components and locales.
|
|
117
|
+
|
|
118
|
+
- **Appearance:** initialize `config.locale`, `config.theme` and `config.branding` at the SDK entry. When host preferences change, call `setKokoAppearance({ locale: hostLocale, theme: hostTheme })`; report the host's actual `light`/`dark` theme. SDK chrome currently uses the opposite theme for contrast. Built-in UI supports English and Chinese; branding remains subject to the app's entitlement.
|
|
119
|
+
- **Controls:** use meaningful `accessibilityLabel`, button/tab roles and stable, unique `testID` values, including icon-only Back/Close controls. Keep disabled and selected state accurate. A menu offering “Export private key” is ordinary navigation; its label alone is not proof that a private value is displayed. Offscreen targets require revealing the actual scrollable region before a tap.
|
|
120
|
+
- **Private surfaces:** set `secureTextEntry` on credential fields. Before displaying passwords, PIN/OTP/CVV, recovery phrases, private keys or their verification choices, declare a host gate with `setAppUserGate`. Also mark the containing private surface with an explicit ID such as `privacy-sensitive-mnemonic` or `privacy-sensitive-private-key`. Clear the gate only after all private surfaces have been left. Never put secret values in gate labels, test IDs, accessibility labels, task text or logs. The user completes these steps locally; ordinary navigation copy may be sent to the gateway. Text heuristics are a fallback and cannot establish privacy boundaries in every language or custom widget.
|
|
121
|
+
- **Host callbacks:** `registerHostActions` is optional. Register callbacks only for controls that are currently mounted and visible, give each control a unique identity, and unregister on blur, unmount or loss of visibility. Match the same user-visible action; do not use callbacks as hidden routes around scrolling, disabled controls or private gates. A callback resolving is not evidence that the requested task succeeded.
|
|
122
|
+
- **Loading and completion:** expose loading/error copy and meaningful selected/value state in the native tree. Keep the user on an observable loading state until a result is known, then expose a stable result or destination. Tasks wait and re-observe changes; repeated labels, an invoked callback or a matching page title do not by themselves prove completion.
|
|
123
|
+
- **Exploration:** `bootstrapExplore` now observes only the current public screen and records public control labels as local hints. It performs no taps, swipes, typing, host callbacks, LogBox changes or task replacement, and requires existing dump permission. Private/gated and unreadable screens return failure without recording a new node. The result always has `steps: 0`; legacy crawl options (`mode`, step/screen limits, priority/skip patterns and action-progress callbacks) are retained as deprecated API fields and are ignored. Normal tasks never automatically replay an exploration route.
|
|
124
|
+
|
|
125
|
+
Runtime appearance example:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { setKokoAppearance } from '@intentcomputing/koko-agent-sdk';
|
|
129
|
+
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
setKokoAppearance({ locale: hostLocale, theme: hostTheme });
|
|
132
|
+
}, [hostLocale, hostTheme]);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
For custom private UIs, declare the gate before navigation or reveal and keep it active through verification. Use `clearAppUserGate()` once the host confirms a public destination. Secure fields, explicit private markers and host gates protect the upload boundary; do not rely on a screen's title or number of buttons as the integration contract.
|
|
136
|
+
|
|
137
|
+
## 6. Verify
|
|
138
|
+
|
|
139
|
+
1. Launch the app and use your host button wired to `openKokoChat()`. The provider does not create a host entry button.
|
|
140
|
+
2. Send a verifiable goal; you should see dump → tap with a visible cursor.
|
|
141
|
+
3. Check that requests use the selected official gateway and a token bound to this app. Do not bundle an LLM API key. Validate privacy gates and outbound payloads using synthetic data.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## FAQ
|
|
146
|
+
|
|
147
|
+
**npm + config only, no native rebuild?**
|
|
148
|
+
No. This SDK ships iOS/Android native modules (same class as Reanimated, Sentry RN, Keychain, etc.).
|
|
149
|
+
|
|
150
|
+
**Must it wrap the root?**
|
|
151
|
+
Recommended. It is the init + UI mount point. You may use `initKokoAgent` and custom UI instead.
|
|
152
|
+
|
|
153
|
+
**Expo Go?**
|
|
154
|
+
Not supported. Use a Dev Client, bare RN, or a production host binary.
|
|
155
|
+
|
|
156
|
+
**Linking an unpublished local checkout?**
|
|
157
|
+
Use `portal:` / `file:`. If the package lives **outside** the monorepo, Metro may need `watchFolders` + `extraNodeModules` (usually unnecessary after npm publish).
|
|
158
|
+
|
|
159
|
+
**Where does the token come from?**
|
|
160
|
+
Intent Computing console / commercial onboarding — not a model-vendor API key.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Related
|
|
165
|
+
|
|
166
|
+
- Package overview: [../README.md](../README.md)
|
|
167
|
+
- npm publish: [PUBLISH.md](./PUBLISH.md)
|
|
168
|
+
- 中文接入指南: [INTEGRATION.zh-CN.md](./INTEGRATION.zh-CN.md)
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# 接入指南 · @intentcomputing/koko-agent-sdk
|
|
2
|
+
|
|
3
|
+
> Canonical English guide: [INTEGRATION.md](./INTEGRATION.md)
|
|
4
|
+
|
|
5
|
+
面向 React Native 宿主 App。装完依赖后需链原生并重编一次,与常见带 native 模块的 RN 库相同。
|
|
6
|
+
|
|
7
|
+
## 前置条件
|
|
8
|
+
|
|
9
|
+
- React Native ≥ 0.73(或 Expo Dev Client / `expo prebuild`,**不支持 Expo Go**)
|
|
10
|
+
- iOS 部署目标 ≥ 15;需本机可 `pod install`
|
|
11
|
+
- 从 Intent Computing 拿到 **应用 token**(`gateway.token`,不是 DeepSeek / OpenAI Key)
|
|
12
|
+
|
|
13
|
+
## 步骤一览
|
|
14
|
+
|
|
15
|
+
1. 安装 npm 包
|
|
16
|
+
2. iOS `pod install`(Android 一般靠 autolinking)
|
|
17
|
+
3. **重新编译原生**(Debug / Release 均可)
|
|
18
|
+
4. 根组件包一层 `KokoProvider` 并配置 token
|
|
19
|
+
5. 将 `openKokoChat()` 对接宿主入口,再发自然语言任务
|
|
20
|
+
|
|
21
|
+
之后若只改 JS 配置或升级包的纯 JS 部分,Metro 热更新即可;**SDK 含原生改动或首次接入,必须再编原生。**
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 1. 安装
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @intentcomputing/koko-agent-sdk
|
|
29
|
+
# 或
|
|
30
|
+
yarn add @intentcomputing/koko-agent-sdk
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Yarn monorepo 示例:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn workspace @your/mobile add @intentcomputing/koko-agent-sdk
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 2. 链接原生
|
|
40
|
+
|
|
41
|
+
**iOS**
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cd ios && pod install && cd ..
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Android**
|
|
48
|
+
RN autolinking 会拉取 `android/`;除非关闭了 autolinking,否则无需手写 Package。
|
|
49
|
+
|
|
50
|
+
## 3. 编译宿主 App
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx react-native run-ios
|
|
54
|
+
npx react-native run-android
|
|
55
|
+
# 或 Xcode / Android Studio / expo run:ios|android
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
未编进原生模块时,`dump` / `tap` 会失败。
|
|
59
|
+
|
|
60
|
+
## 4. 根组件接入
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { KokoProvider } from '@intentcomputing/koko-agent-sdk';
|
|
64
|
+
|
|
65
|
+
export default function App() {
|
|
66
|
+
return (
|
|
67
|
+
<KokoProvider
|
|
68
|
+
config={{
|
|
69
|
+
gateway: {
|
|
70
|
+
token: 'YOUR_APP_TOKEN',
|
|
71
|
+
// 默认 https://sdk.intentcomputing.net(OpenAI)
|
|
72
|
+
// 国内:https://sdk.intentcomputing.cn(DeepSeek)
|
|
73
|
+
baseUrl: 'https://sdk.intentcomputing.cn',
|
|
74
|
+
},
|
|
75
|
+
locale: 'zh', // SDK UI 默认英文;中文请显式设置
|
|
76
|
+
// branding: { name, tagline, placeholder, primaryColor, icon },
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
<Home />
|
|
80
|
+
</KokoProvider>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
宿主也可主动打开会话:
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { getKokoAgent } from '@intentcomputing/koko-agent-sdk';
|
|
89
|
+
|
|
90
|
+
getKokoAgent().openChat();
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 可选开关
|
|
94
|
+
|
|
95
|
+
| prop / config | 含义 | 默认 |
|
|
96
|
+
|--|--|--|
|
|
97
|
+
| `cursor` | 操作光标 | `true` |
|
|
98
|
+
| `observer` | 进度条 + 对话宿主 | `true` |
|
|
99
|
+
| `dialogs` | 确认 / 追问弹窗 | `true` |
|
|
100
|
+
| `config.locale` | `en` / `zh` | **`en`** |
|
|
101
|
+
| `config.branding` | 名称、占位文案、主色等 | SDK 默认 |
|
|
102
|
+
| `config.webWalletAliases` | 宿主确认属于自身注入钱包的公开选项名称 | 无 |
|
|
103
|
+
| `config.debug` | 调试日志 | Metro 开发构建默认开启,正式构建默认关闭 |
|
|
104
|
+
|
|
105
|
+
### 宿主接入约定
|
|
106
|
+
|
|
107
|
+
- 语言或主题改变时调用 `setKokoAppearance({ locale, theme })`;品牌配置需应用具备对应权益。
|
|
108
|
+
- 为按钮(包括纯图标按钮)提供有意义的无障碍名称、角色及稳定标识,保证禁用、选中和滚动状态真实可见。
|
|
109
|
+
- 在密码、助记词、私钥及验证页面出现前调用 `setAppUserGate` 并标记敏感页面,用户完成操作并离开后再调用 `clearAppUserGate`。使用虚构数据验证日志与上行请求;详见[隐私说明](PRIVACY.zh-CN.md)。
|
|
110
|
+
- iOS 内嵌网页可使用本地 OCR 和 JS 点击,但真实手势、跨框架内容及无标签控件存在限制;钱包连接和断开流程尚未完成端到端验收。
|
|
111
|
+
|
|
112
|
+
## 5. 验收
|
|
113
|
+
|
|
114
|
+
1. 启动 App,通过接有 `openKokoChat()` 的宿主按钮打开助手;Provider 不会自动创建宿主入口。
|
|
115
|
+
2. 输入可核验目标,应看到 dump → tap 与光标。
|
|
116
|
+
3. 请求打到官网网关(或 `baseUrl`),App 内无任何 LLM API Key。
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 常见问题
|
|
121
|
+
|
|
122
|
+
**只用 npm + 配置、不重编原生?**
|
|
123
|
+
不行。本 SDK 含 iOS/Android 原生模块。
|
|
124
|
+
|
|
125
|
+
**必须包在根组件?**
|
|
126
|
+
推荐。也可自行 `initKokoAgent` 并自建 UI。
|
|
127
|
+
|
|
128
|
+
**Expo Go?**
|
|
129
|
+
不支持。
|
|
130
|
+
|
|
131
|
+
**本地未发布源码?**
|
|
132
|
+
可用 `portal:` / `file:`;包在 monorepo 外时可能需 Metro `watchFolders`(npm 发布后通常不需要)。
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 相关
|
|
137
|
+
|
|
138
|
+
- 英文总览:[../README.md](../README.md)
|
|
139
|
+
- 中文总览:[../README.zh-CN.md](../README.zh-CN.md)
|
|
140
|
+
- 发布:[PUBLISH.zh-CN.md](./PUBLISH.zh-CN.md)
|
package/docs/PRIVACY.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Privacy and sensitive screens
|
|
2
|
+
|
|
3
|
+
The host is responsible for protecting credentials and wallet secrets. Before a password, private key, recovery phrase, import, backup, or verification screen is displayed, mark the containing surface with a stable `testID` such as `privacy-sensitive-recovery-phrase` or `privacy-sensitive-private-key`. Use `secureTextEntry` for password fields. Never put secret values in labels, IDs, task text, screenshots, or logs.
|
|
4
|
+
|
|
5
|
+
For a sensitive flow, call `setAppUserGate` before content appears and `clearAppUserGate` only after the sensitive surface has been removed. Use a generic prompt that contains no secret. The user completes the step in the host app. See the [integration guide](INTEGRATION.md) for the API.
|
|
6
|
+
|
|
7
|
+
The SDK uses screen heuristics and client/server redaction as additional defenses, not as substitutes for host markers and gates. For ordinary planning, the SDK can send a redacted screen model, task text, and operation history to the configured gateway and its model provider. Do not assume that unmarked custom surfaces, WebViews, or an accessibility tree are automatically safe. Validate outgoing requests and logs using synthetic data before shipping.
|
|
8
|
+
|
|
9
|
+
Local OCR helps locate visible text; only selected goal-derived labels and an allowlist of public wallet names are eligible as planner hints. Host wallet provider capability checks are local. A user must personally handle credentials, wallet authorizations, and signatures. Never use a production recovery phrase or private key as test data.
|
|
10
|
+
|
|
11
|
+
Report suspected vulnerabilities privately as described in [SECURITY.md](../SECURITY.md).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# 本地隐私步骤与可见目标
|
|
2
|
+
|
|
3
|
+
助记词展示、备份、验证、导入,以及私钥和密码输入必须由用户在宿主内完成。SDK 在这些页面暂停任务,不代选助记词、不代填密码,不把页面树、OCR、页面摘要或截图发送给模型。离开隐私页后才恢复;点击“已完成”不能绕过仍在展示的隐私页。
|
|
4
|
+
|
|
5
|
+
宿主应为敏感内容容器加固定标记,例如 `testID="privacy-sensitive-recovery-phrase"` 或 `testID="privacy-sensitive-private-key"`。不要把实际单词、私钥或密码拼进 `testID`、无障碍标签或日志。密码输入框应启用 `secureTextEntry`。这些标记应覆盖导入、展示与验证的所有状态。
|
|
6
|
+
|
|
7
|
+
对于原生树不能可靠识别的页面,宿主还可以在页面聚焦时调用 `setAppUserGate({ kind: 'recovery_phrase', label: '请在本机完成助记词验证' })`,离开后调用 `clearAppUserGate()`;私钥使用 `kind: 'private_key'`。在页面内容出现前设置,在内容移除后清除,避免后台仍挂载的路由干扰当前页。页面标题启发式识别只是兜底,不能替代宿主显式标记。标签中只放通用提示。
|
|
8
|
+
|
|
9
|
+
发送层重新检查当前原生页面,丢弃调用方传入的原始 OCR、摘要和截图字段,从同一份脱敏树生成上传内容。进入隐私步骤时清空规划历史;网关也拒绝已识别的隐私页。调试时仅使用虚构数据验证请求拦截,不用真实秘密测试脱敏。
|
|
10
|
+
|
|
11
|
+
点击只针对当前可见目标。目标缺失时,SDK 只在原生确认可纵向滚动的容器内执行可见滑动,每次重新读取页面,找到目标后才单次点击。列表不再变化或达到搜索上限时停止并报告未找到,避免连续猜点。
|
package/docs/PUBLISH.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Publishing the SDK
|
|
2
|
+
|
|
3
|
+
This guide is for package maintainers. Consumers should follow the [integration guide](INTEGRATION.md). The hosted gateway is maintained and deployed separately; it is not published in the npm package or public SDK repository.
|
|
4
|
+
|
|
5
|
+
1. Check the changelog, package metadata, version, and supported platforms. npm versions are immutable; choose a new semantic version for each release.
|
|
6
|
+
2. Run `npm ci`, `npm test -- --runInBand --watchman=false`, and `npm run build`. Verify native changes in representative hosts.
|
|
7
|
+
3. Inspect `npm pack --dry-run` and the resulting tarball. Never include environment files, credentials, host app data, build caches, or private code.
|
|
8
|
+
4. Authenticate to `https://registry.npmjs.org/` using an account with publishing rights. npm may require two-factor authentication for publication. Keep tokens out of the repository.
|
|
9
|
+
5. Publish with `npm publish --access public --registry https://registry.npmjs.org/`. Verify the version, dist-tag, and artifact integrity in the registry, allowing for cache propagation.
|
|
10
|
+
|
|
11
|
+
If the registry reports a staged release, a maintainer must review and approve it before it is publicly installable. Follow [npm's staged publishing documentation](https://docs.npmjs.com/staged-publishing/).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# 发布 SDK
|
|
2
|
+
|
|
3
|
+
本文面向包维护者;接入请看[接入指南](INTEGRATION.zh-CN.md)。网关服务独立维护和部署,不包含在 npm 包或公开 SDK 仓库中。
|
|
4
|
+
|
|
5
|
+
1. 检查变更记录、包信息、版本和支持的平台。npm 版本不可覆盖,每次发布使用新的语义化版本。
|
|
6
|
+
2. 执行 `npm ci`、`npm test -- --runInBand --watchman=false` 和 `npm run build`;原生代码变更需在代表性宿主中验证。
|
|
7
|
+
3. 检查 `npm pack --dry-run` 和实际 tarball;不得包含环境文件、凭证、宿主数据、构建缓存或私有代码。
|
|
8
|
+
4. 通过 `https://registry.npmjs.org/` 使用有发布权限的账号登录;npm 可能要求双重验证。不要把令牌提交到仓库。
|
|
9
|
+
5. 执行 `npm publish --access public --registry https://registry.npmjs.org/`,再核实仓库版本、dist-tag 和包完整性,并考虑缓存传播延迟。
|
|
10
|
+
|
|
11
|
+
若 npm 显示暂存发布,需由维护者审查并批准后才能公开安装,具体见 [npm 暂存发布文档](https://docs.npmjs.com/staged-publishing/)。
|