@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.
Files changed (622) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/CODE_OF_CONDUCT.md +3 -0
  3. package/CONTRIBUTING.md +9 -0
  4. package/LICENSE +21 -0
  5. package/README.md +65 -0
  6. package/README.zh-CN.md +50 -0
  7. package/SECURITY.md +5 -0
  8. package/android/build.gradle +40 -0
  9. package/android/src/main/AndroidManifest.xml +2 -0
  10. package/android/src/main/java/cn/intentcomputing/kokoagentsdk/KokoAgentSdkModule.java +1356 -0
  11. package/android/src/main/java/cn/intentcomputing/kokoagentsdk/KokoAgentSdkPackage.java +23 -0
  12. package/docs/INTEGRATION.md +168 -0
  13. package/docs/INTEGRATION.zh-CN.md +140 -0
  14. package/docs/PRIVACY.md +11 -0
  15. package/docs/PRIVACY.zh-CN.md +11 -0
  16. package/docs/PUBLISH.md +11 -0
  17. package/docs/PUBLISH.zh-CN.md +11 -0
  18. package/ios/KokoAgentSdk/KokoAgentSdk.h +5 -0
  19. package/ios/KokoAgentSdk/KokoAgentSdk.m +2464 -0
  20. package/ios/KokoAgentSdk/KokoOcrBounds.h +20 -0
  21. package/ios/KokoAgentSdk/KokoScrollBounds.h +21 -0
  22. package/koko-agent-sdk.podspec +23 -0
  23. package/lib/commonjs/KokoAgent.js +1427 -0
  24. package/lib/commonjs/KokoAgent.js.map +1 -0
  25. package/lib/commonjs/assist/OnDeviceAssist.js +94 -0
  26. package/lib/commonjs/assist/OnDeviceAssist.js.map +1 -0
  27. package/lib/commonjs/assist/intentClassify.js +100 -0
  28. package/lib/commonjs/assist/intentClassify.js.map +1 -0
  29. package/lib/commonjs/assist/nodeRank.js +120 -0
  30. package/lib/commonjs/assist/nodeRank.js.map +1 -0
  31. package/lib/commonjs/assist/ocrTarget.js +135 -0
  32. package/lib/commonjs/assist/ocrTarget.js.map +1 -0
  33. package/lib/commonjs/assist/webVisualChange.js +29 -0
  34. package/lib/commonjs/assist/webVisualChange.js.map +1 -0
  35. package/lib/commonjs/client/ActionOutcomeUnknownError.js +28 -0
  36. package/lib/commonjs/client/ActionOutcomeUnknownError.js.map +1 -0
  37. package/lib/commonjs/client/AgentSession.js +858 -0
  38. package/lib/commonjs/client/AgentSession.js.map +1 -0
  39. package/lib/commonjs/client/GatewayClient.js +302 -0
  40. package/lib/commonjs/client/GatewayClient.js.map +1 -0
  41. package/lib/commonjs/client/OperationReplayGuard.js +62 -0
  42. package/lib/commonjs/client/OperationReplayGuard.js.map +1 -0
  43. package/lib/commonjs/client/RunCheckpoint.js +139 -0
  44. package/lib/commonjs/client/RunCheckpoint.js.map +1 -0
  45. package/lib/commonjs/client/loopDetect.js +184 -0
  46. package/lib/commonjs/client/loopDetect.js.map +1 -0
  47. package/lib/commonjs/client/recentSearch.js +50 -0
  48. package/lib/commonjs/client/recentSearch.js.map +1 -0
  49. package/lib/commonjs/client/walletChoiceGuard.js +18 -0
  50. package/lib/commonjs/client/walletChoiceGuard.js.map +1 -0
  51. package/lib/commonjs/client/webResultCategory.js +38 -0
  52. package/lib/commonjs/client/webResultCategory.js.map +1 -0
  53. package/lib/commonjs/commercial/AccountStore.js +78 -0
  54. package/lib/commonjs/commercial/AccountStore.js.map +1 -0
  55. package/lib/commonjs/commercial/AgentDebug.js +104 -0
  56. package/lib/commonjs/commercial/AgentDebug.js.map +1 -0
  57. package/lib/commonjs/commercial/ExecutionGuard.js +53 -0
  58. package/lib/commonjs/commercial/ExecutionGuard.js.map +1 -0
  59. package/lib/commonjs/commercial/UsageBus.js +42 -0
  60. package/lib/commonjs/commercial/UsageBus.js.map +1 -0
  61. package/lib/commonjs/commercial/branding.js +69 -0
  62. package/lib/commonjs/commercial/branding.js.map +1 -0
  63. package/lib/commonjs/commercial/devMode.js +52 -0
  64. package/lib/commonjs/commercial/devMode.js.map +1 -0
  65. package/lib/commonjs/commercial/trust.js +69 -0
  66. package/lib/commonjs/commercial/trust.js.map +1 -0
  67. package/lib/commonjs/confirmation/gate.js +62 -0
  68. package/lib/commonjs/confirmation/gate.js.map +1 -0
  69. package/lib/commonjs/cursor/CursorOverlay.js +141 -0
  70. package/lib/commonjs/cursor/CursorOverlay.js.map +1 -0
  71. package/lib/commonjs/cursor/PointerHand.js +51 -0
  72. package/lib/commonjs/cursor/PointerHand.js.map +1 -0
  73. package/lib/commonjs/cursor/controller.js +91 -0
  74. package/lib/commonjs/cursor/controller.js.map +1 -0
  75. package/lib/commonjs/cursor/pointer.js +49 -0
  76. package/lib/commonjs/cursor/pointer.js.map +1 -0
  77. package/lib/commonjs/debug/KokoRemoteSmoke.js +611 -0
  78. package/lib/commonjs/debug/KokoRemoteSmoke.js.map +1 -0
  79. package/lib/commonjs/explore/ExplorationGraph.js +418 -0
  80. package/lib/commonjs/explore/ExplorationGraph.js.map +1 -0
  81. package/lib/commonjs/explore/bootstrapExplore.js +59 -0
  82. package/lib/commonjs/explore/bootstrapExplore.js.map +1 -0
  83. package/lib/commonjs/host/HostActions.js +266 -0
  84. package/lib/commonjs/host/HostActions.js.map +1 -0
  85. package/lib/commonjs/i18n/index.js +169 -0
  86. package/lib/commonjs/i18n/index.js.map +1 -0
  87. package/lib/commonjs/i18n/runtimeMessages.js +184 -0
  88. package/lib/commonjs/i18n/runtimeMessages.js.map +1 -0
  89. package/lib/commonjs/index.js +640 -0
  90. package/lib/commonjs/index.js.map +1 -0
  91. package/lib/commonjs/native/NativeBridge.js +132 -0
  92. package/lib/commonjs/native/NativeBridge.js.map +1 -0
  93. package/lib/commonjs/native/navigationLabel.js +16 -0
  94. package/lib/commonjs/native/navigationLabel.js.map +1 -0
  95. package/lib/commonjs/native/normalizeViewTree.js +28 -0
  96. package/lib/commonjs/native/normalizeViewTree.js.map +1 -0
  97. package/lib/commonjs/native/pruneOffscreen.js +76 -0
  98. package/lib/commonjs/native/pruneOffscreen.js.map +1 -0
  99. package/lib/commonjs/native/scrollViewport.js +69 -0
  100. package/lib/commonjs/native/scrollViewport.js.map +1 -0
  101. package/lib/commonjs/package.json +1 -0
  102. package/lib/commonjs/privacy/redact.js +108 -0
  103. package/lib/commonjs/privacy/redact.js.map +1 -0
  104. package/lib/commonjs/privacy/screenEvidence.js +59 -0
  105. package/lib/commonjs/privacy/screenEvidence.js.map +1 -0
  106. package/lib/commonjs/privacy/screenModel.js +404 -0
  107. package/lib/commonjs/privacy/screenModel.js.map +1 -0
  108. package/lib/commonjs/privacy/sensitiveScreen.js +58 -0
  109. package/lib/commonjs/privacy/sensitiveScreen.js.map +1 -0
  110. package/lib/commonjs/privacy/userGate.js +213 -0
  111. package/lib/commonjs/privacy/userGate.js.map +1 -0
  112. package/lib/commonjs/protocol/actions.js +112 -0
  113. package/lib/commonjs/protocol/actions.js.map +1 -0
  114. package/lib/commonjs/provider/HostAppearanceStore.js +111 -0
  115. package/lib/commonjs/provider/HostAppearanceStore.js.map +1 -0
  116. package/lib/commonjs/provider/KokoProvider.js +81 -0
  117. package/lib/commonjs/provider/KokoProvider.js.map +1 -0
  118. package/lib/commonjs/provider/KokoUiContext.js +102 -0
  119. package/lib/commonjs/provider/KokoUiContext.js.map +1 -0
  120. package/lib/commonjs/selector/match.js +378 -0
  121. package/lib/commonjs/selector/match.js.map +1 -0
  122. package/lib/commonjs/task/TaskStore.js +361 -0
  123. package/lib/commonjs/task/TaskStore.js.map +1 -0
  124. package/lib/commonjs/task/types.js +2 -0
  125. package/lib/commonjs/task/types.js.map +1 -0
  126. package/lib/commonjs/task/useTaskStore.js +14 -0
  127. package/lib/commonjs/task/useTaskStore.js.map +1 -0
  128. package/lib/commonjs/types.js +2 -0
  129. package/lib/commonjs/types.js.map +1 -0
  130. package/lib/commonjs/ui/KokoChatSheet.js +885 -0
  131. package/lib/commonjs/ui/KokoChatSheet.js.map +1 -0
  132. package/lib/commonjs/ui/KokoComposer.js +161 -0
  133. package/lib/commonjs/ui/KokoComposer.js.map +1 -0
  134. package/lib/commonjs/ui/KokoDialogHost.js +254 -0
  135. package/lib/commonjs/ui/KokoDialogHost.js.map +1 -0
  136. package/lib/commonjs/ui/KokoEntryButton.js +81 -0
  137. package/lib/commonjs/ui/KokoEntryButton.js.map +1 -0
  138. package/lib/commonjs/ui/KokoObserver.js +522 -0
  139. package/lib/commonjs/ui/KokoObserver.js.map +1 -0
  140. package/lib/commonjs/ui/KokoOverlayLayer.js +45 -0
  141. package/lib/commonjs/ui/KokoOverlayLayer.js.map +1 -0
  142. package/lib/commonjs/ui/KokoSubtitle.js +95 -0
  143. package/lib/commonjs/ui/KokoSubtitle.js.map +1 -0
  144. package/lib/commonjs/ui/KokoTaskPanel.js +322 -0
  145. package/lib/commonjs/ui/KokoTaskPanel.js.map +1 -0
  146. package/lib/commonjs/ui/hostOverlay.js +126 -0
  147. package/lib/commonjs/ui/hostOverlay.js.map +1 -0
  148. package/lib/commonjs/ui/icons.js +132 -0
  149. package/lib/commonjs/ui/icons.js.map +1 -0
  150. package/lib/commonjs/ui/progressChrome.js +66 -0
  151. package/lib/commonjs/ui/progressChrome.js.map +1 -0
  152. package/lib/commonjs/ui/safeArea.js +96 -0
  153. package/lib/commonjs/ui/safeArea.js.map +1 -0
  154. package/lib/commonjs/ui/useOverlayOrigin.js +40 -0
  155. package/lib/commonjs/ui/useOverlayOrigin.js.map +1 -0
  156. package/lib/module/KokoAgent.js +1418 -0
  157. package/lib/module/KokoAgent.js.map +1 -0
  158. package/lib/module/assist/OnDeviceAssist.js +89 -0
  159. package/lib/module/assist/OnDeviceAssist.js.map +1 -0
  160. package/lib/module/assist/intentClassify.js +95 -0
  161. package/lib/module/assist/intentClassify.js.map +1 -0
  162. package/lib/module/assist/nodeRank.js +115 -0
  163. package/lib/module/assist/nodeRank.js.map +1 -0
  164. package/lib/module/assist/ocrTarget.js +123 -0
  165. package/lib/module/assist/ocrTarget.js.map +1 -0
  166. package/lib/module/assist/webVisualChange.js +24 -0
  167. package/lib/module/assist/webVisualChange.js.map +1 -0
  168. package/lib/module/client/ActionOutcomeUnknownError.js +23 -0
  169. package/lib/module/client/ActionOutcomeUnknownError.js.map +1 -0
  170. package/lib/module/client/AgentSession.js +854 -0
  171. package/lib/module/client/AgentSession.js.map +1 -0
  172. package/lib/module/client/GatewayClient.js +293 -0
  173. package/lib/module/client/GatewayClient.js.map +1 -0
  174. package/lib/module/client/OperationReplayGuard.js +58 -0
  175. package/lib/module/client/OperationReplayGuard.js.map +1 -0
  176. package/lib/module/client/RunCheckpoint.js +135 -0
  177. package/lib/module/client/RunCheckpoint.js.map +1 -0
  178. package/lib/module/client/loopDetect.js +177 -0
  179. package/lib/module/client/loopDetect.js.map +1 -0
  180. package/lib/module/client/recentSearch.js +46 -0
  181. package/lib/module/client/recentSearch.js.map +1 -0
  182. package/lib/module/client/walletChoiceGuard.js +14 -0
  183. package/lib/module/client/walletChoiceGuard.js.map +1 -0
  184. package/lib/module/client/webResultCategory.js +34 -0
  185. package/lib/module/client/webResultCategory.js.map +1 -0
  186. package/lib/module/commercial/AccountStore.js +75 -0
  187. package/lib/module/commercial/AccountStore.js.map +1 -0
  188. package/lib/module/commercial/AgentDebug.js +99 -0
  189. package/lib/module/commercial/AgentDebug.js.map +1 -0
  190. package/lib/module/commercial/ExecutionGuard.js +49 -0
  191. package/lib/module/commercial/ExecutionGuard.js.map +1 -0
  192. package/lib/module/commercial/UsageBus.js +38 -0
  193. package/lib/module/commercial/UsageBus.js.map +1 -0
  194. package/lib/module/commercial/branding.js +63 -0
  195. package/lib/module/commercial/branding.js.map +1 -0
  196. package/lib/module/commercial/devMode.js +45 -0
  197. package/lib/module/commercial/devMode.js.map +1 -0
  198. package/lib/module/commercial/trust.js +62 -0
  199. package/lib/module/commercial/trust.js.map +1 -0
  200. package/lib/module/confirmation/gate.js +54 -0
  201. package/lib/module/confirmation/gate.js.map +1 -0
  202. package/lib/module/cursor/CursorOverlay.js +136 -0
  203. package/lib/module/cursor/CursorOverlay.js.map +1 -0
  204. package/lib/module/cursor/PointerHand.js +47 -0
  205. package/lib/module/cursor/PointerHand.js.map +1 -0
  206. package/lib/module/cursor/controller.js +87 -0
  207. package/lib/module/cursor/controller.js.map +1 -0
  208. package/lib/module/cursor/pointer.js +45 -0
  209. package/lib/module/cursor/pointer.js.map +1 -0
  210. package/lib/module/debug/KokoRemoteSmoke.js +608 -0
  211. package/lib/module/debug/KokoRemoteSmoke.js.map +1 -0
  212. package/lib/module/explore/ExplorationGraph.js +406 -0
  213. package/lib/module/explore/ExplorationGraph.js.map +1 -0
  214. package/lib/module/explore/bootstrapExplore.js +55 -0
  215. package/lib/module/explore/bootstrapExplore.js.map +1 -0
  216. package/lib/module/host/HostActions.js +255 -0
  217. package/lib/module/host/HostActions.js.map +1 -0
  218. package/lib/module/i18n/index.js +159 -0
  219. package/lib/module/i18n/index.js.map +1 -0
  220. package/lib/module/i18n/runtimeMessages.js +180 -0
  221. package/lib/module/i18n/runtimeMessages.js.map +1 -0
  222. package/lib/module/index.js +44 -0
  223. package/lib/module/index.js.map +1 -0
  224. package/lib/module/native/NativeBridge.js +128 -0
  225. package/lib/module/native/NativeBridge.js.map +1 -0
  226. package/lib/module/native/navigationLabel.js +12 -0
  227. package/lib/module/native/navigationLabel.js.map +1 -0
  228. package/lib/module/native/normalizeViewTree.js +25 -0
  229. package/lib/module/native/normalizeViewTree.js.map +1 -0
  230. package/lib/module/native/pruneOffscreen.js +72 -0
  231. package/lib/module/native/pruneOffscreen.js.map +1 -0
  232. package/lib/module/native/scrollViewport.js +63 -0
  233. package/lib/module/native/scrollViewport.js.map +1 -0
  234. package/lib/module/package.json +1 -0
  235. package/lib/module/privacy/redact.js +103 -0
  236. package/lib/module/privacy/redact.js.map +1 -0
  237. package/lib/module/privacy/screenEvidence.js +50 -0
  238. package/lib/module/privacy/screenEvidence.js.map +1 -0
  239. package/lib/module/privacy/screenModel.js +397 -0
  240. package/lib/module/privacy/screenModel.js.map +1 -0
  241. package/lib/module/privacy/sensitiveScreen.js +52 -0
  242. package/lib/module/privacy/sensitiveScreen.js.map +1 -0
  243. package/lib/module/privacy/userGate.js +202 -0
  244. package/lib/module/privacy/userGate.js.map +1 -0
  245. package/lib/module/protocol/actions.js +108 -0
  246. package/lib/module/protocol/actions.js.map +1 -0
  247. package/lib/module/provider/HostAppearanceStore.js +101 -0
  248. package/lib/module/provider/HostAppearanceStore.js.map +1 -0
  249. package/lib/module/provider/KokoProvider.js +74 -0
  250. package/lib/module/provider/KokoProvider.js.map +1 -0
  251. package/lib/module/provider/KokoUiContext.js +96 -0
  252. package/lib/module/provider/KokoUiContext.js.map +1 -0
  253. package/lib/module/selector/match.js +366 -0
  254. package/lib/module/selector/match.js.map +1 -0
  255. package/lib/module/task/TaskStore.js +356 -0
  256. package/lib/module/task/TaskStore.js.map +1 -0
  257. package/lib/module/task/types.js +2 -0
  258. package/lib/module/task/types.js.map +1 -0
  259. package/lib/module/task/useTaskStore.js +10 -0
  260. package/lib/module/task/useTaskStore.js.map +1 -0
  261. package/lib/module/types.js +2 -0
  262. package/lib/module/types.js.map +1 -0
  263. package/lib/module/ui/KokoChatSheet.js +879 -0
  264. package/lib/module/ui/KokoChatSheet.js.map +1 -0
  265. package/lib/module/ui/KokoComposer.js +155 -0
  266. package/lib/module/ui/KokoComposer.js.map +1 -0
  267. package/lib/module/ui/KokoDialogHost.js +247 -0
  268. package/lib/module/ui/KokoDialogHost.js.map +1 -0
  269. package/lib/module/ui/KokoEntryButton.js +74 -0
  270. package/lib/module/ui/KokoEntryButton.js.map +1 -0
  271. package/lib/module/ui/KokoObserver.js +516 -0
  272. package/lib/module/ui/KokoObserver.js.map +1 -0
  273. package/lib/module/ui/KokoOverlayLayer.js +39 -0
  274. package/lib/module/ui/KokoOverlayLayer.js.map +1 -0
  275. package/lib/module/ui/KokoSubtitle.js +90 -0
  276. package/lib/module/ui/KokoSubtitle.js.map +1 -0
  277. package/lib/module/ui/KokoTaskPanel.js +316 -0
  278. package/lib/module/ui/KokoTaskPanel.js.map +1 -0
  279. package/lib/module/ui/hostOverlay.js +120 -0
  280. package/lib/module/ui/hostOverlay.js.map +1 -0
  281. package/lib/module/ui/icons.js +124 -0
  282. package/lib/module/ui/icons.js.map +1 -0
  283. package/lib/module/ui/progressChrome.js +58 -0
  284. package/lib/module/ui/progressChrome.js.map +1 -0
  285. package/lib/module/ui/safeArea.js +92 -0
  286. package/lib/module/ui/safeArea.js.map +1 -0
  287. package/lib/module/ui/useOverlayOrigin.js +36 -0
  288. package/lib/module/ui/useOverlayOrigin.js.map +1 -0
  289. package/lib/typescript/commonjs/KokoAgent.d.ts +167 -0
  290. package/lib/typescript/commonjs/KokoAgent.d.ts.map +1 -0
  291. package/lib/typescript/commonjs/assist/OnDeviceAssist.d.ts +31 -0
  292. package/lib/typescript/commonjs/assist/OnDeviceAssist.d.ts.map +1 -0
  293. package/lib/typescript/commonjs/assist/intentClassify.d.ts +18 -0
  294. package/lib/typescript/commonjs/assist/intentClassify.d.ts.map +1 -0
  295. package/lib/typescript/commonjs/assist/nodeRank.d.ts +32 -0
  296. package/lib/typescript/commonjs/assist/nodeRank.d.ts.map +1 -0
  297. package/lib/typescript/commonjs/assist/ocrTarget.d.ts +25 -0
  298. package/lib/typescript/commonjs/assist/ocrTarget.d.ts.map +1 -0
  299. package/lib/typescript/commonjs/assist/webVisualChange.d.ts +6 -0
  300. package/lib/typescript/commonjs/assist/webVisualChange.d.ts.map +1 -0
  301. package/lib/typescript/commonjs/client/ActionOutcomeUnknownError.d.ts +13 -0
  302. package/lib/typescript/commonjs/client/ActionOutcomeUnknownError.d.ts.map +1 -0
  303. package/lib/typescript/commonjs/client/AgentSession.d.ts +56 -0
  304. package/lib/typescript/commonjs/client/AgentSession.d.ts.map +1 -0
  305. package/lib/typescript/commonjs/client/GatewayClient.d.ts +149 -0
  306. package/lib/typescript/commonjs/client/GatewayClient.d.ts.map +1 -0
  307. package/lib/typescript/commonjs/client/OperationReplayGuard.d.ts +13 -0
  308. package/lib/typescript/commonjs/client/OperationReplayGuard.d.ts.map +1 -0
  309. package/lib/typescript/commonjs/client/RunCheckpoint.d.ts +57 -0
  310. package/lib/typescript/commonjs/client/RunCheckpoint.d.ts.map +1 -0
  311. package/lib/typescript/commonjs/client/loopDetect.d.ts +15 -0
  312. package/lib/typescript/commonjs/client/loopDetect.d.ts.map +1 -0
  313. package/lib/typescript/commonjs/client/recentSearch.d.ts +5 -0
  314. package/lib/typescript/commonjs/client/recentSearch.d.ts.map +1 -0
  315. package/lib/typescript/commonjs/client/walletChoiceGuard.d.ts +4 -0
  316. package/lib/typescript/commonjs/client/walletChoiceGuard.d.ts.map +1 -0
  317. package/lib/typescript/commonjs/client/webResultCategory.d.ts +5 -0
  318. package/lib/typescript/commonjs/client/webResultCategory.d.ts.map +1 -0
  319. package/lib/typescript/commonjs/commercial/AccountStore.d.ts +17 -0
  320. package/lib/typescript/commonjs/commercial/AccountStore.d.ts.map +1 -0
  321. package/lib/typescript/commonjs/commercial/AgentDebug.d.ts +25 -0
  322. package/lib/typescript/commonjs/commercial/AgentDebug.d.ts.map +1 -0
  323. package/lib/typescript/commonjs/commercial/ExecutionGuard.d.ts +18 -0
  324. package/lib/typescript/commonjs/commercial/ExecutionGuard.d.ts.map +1 -0
  325. package/lib/typescript/commonjs/commercial/UsageBus.d.ts +18 -0
  326. package/lib/typescript/commonjs/commercial/UsageBus.d.ts.map +1 -0
  327. package/lib/typescript/commonjs/commercial/branding.d.ts +25 -0
  328. package/lib/typescript/commonjs/commercial/branding.d.ts.map +1 -0
  329. package/lib/typescript/commonjs/commercial/devMode.d.ts +26 -0
  330. package/lib/typescript/commonjs/commercial/devMode.d.ts.map +1 -0
  331. package/lib/typescript/commonjs/commercial/trust.d.ts +21 -0
  332. package/lib/typescript/commonjs/commercial/trust.d.ts.map +1 -0
  333. package/lib/typescript/commonjs/confirmation/gate.d.ts +18 -0
  334. package/lib/typescript/commonjs/confirmation/gate.d.ts.map +1 -0
  335. package/lib/typescript/commonjs/cursor/CursorOverlay.d.ts +13 -0
  336. package/lib/typescript/commonjs/cursor/CursorOverlay.d.ts.map +1 -0
  337. package/lib/typescript/commonjs/cursor/PointerHand.d.ts +16 -0
  338. package/lib/typescript/commonjs/cursor/PointerHand.d.ts.map +1 -0
  339. package/lib/typescript/commonjs/cursor/controller.d.ts +30 -0
  340. package/lib/typescript/commonjs/cursor/controller.d.ts.map +1 -0
  341. package/lib/typescript/commonjs/cursor/pointer.d.ts +23 -0
  342. package/lib/typescript/commonjs/cursor/pointer.d.ts.map +1 -0
  343. package/lib/typescript/commonjs/debug/KokoRemoteSmoke.d.ts +96 -0
  344. package/lib/typescript/commonjs/debug/KokoRemoteSmoke.d.ts.map +1 -0
  345. package/lib/typescript/commonjs/explore/ExplorationGraph.d.ts +96 -0
  346. package/lib/typescript/commonjs/explore/ExplorationGraph.d.ts.map +1 -0
  347. package/lib/typescript/commonjs/explore/bootstrapExplore.d.ts +40 -0
  348. package/lib/typescript/commonjs/explore/bootstrapExplore.d.ts.map +1 -0
  349. package/lib/typescript/commonjs/host/HostActions.d.ts +101 -0
  350. package/lib/typescript/commonjs/host/HostActions.d.ts.map +1 -0
  351. package/lib/typescript/commonjs/i18n/index.d.ts +20 -0
  352. package/lib/typescript/commonjs/i18n/index.d.ts.map +1 -0
  353. package/lib/typescript/commonjs/i18n/runtimeMessages.d.ts +178 -0
  354. package/lib/typescript/commonjs/i18n/runtimeMessages.d.ts.map +1 -0
  355. package/lib/typescript/commonjs/index.d.ts +66 -0
  356. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  357. package/lib/typescript/commonjs/native/NativeBridge.d.ts +70 -0
  358. package/lib/typescript/commonjs/native/NativeBridge.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/native/navigationLabel.d.ts +4 -0
  360. package/lib/typescript/commonjs/native/navigationLabel.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/native/normalizeViewTree.d.ts +4 -0
  362. package/lib/typescript/commonjs/native/normalizeViewTree.d.ts.map +1 -0
  363. package/lib/typescript/commonjs/native/pruneOffscreen.d.ts +3 -0
  364. package/lib/typescript/commonjs/native/pruneOffscreen.d.ts.map +1 -0
  365. package/lib/typescript/commonjs/native/scrollViewport.d.ts +13 -0
  366. package/lib/typescript/commonjs/native/scrollViewport.d.ts.map +1 -0
  367. package/lib/typescript/commonjs/package.json +1 -0
  368. package/lib/typescript/commonjs/privacy/redact.d.ts +9 -0
  369. package/lib/typescript/commonjs/privacy/redact.d.ts.map +1 -0
  370. package/lib/typescript/commonjs/privacy/screenEvidence.d.ts +14 -0
  371. package/lib/typescript/commonjs/privacy/screenEvidence.d.ts.map +1 -0
  372. package/lib/typescript/commonjs/privacy/screenModel.d.ts +26 -0
  373. package/lib/typescript/commonjs/privacy/screenModel.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/privacy/sensitiveScreen.d.ts +8 -0
  375. package/lib/typescript/commonjs/privacy/sensitiveScreen.d.ts.map +1 -0
  376. package/lib/typescript/commonjs/privacy/userGate.d.ts +58 -0
  377. package/lib/typescript/commonjs/privacy/userGate.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/protocol/actions.d.ts +7 -0
  379. package/lib/typescript/commonjs/protocol/actions.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/provider/HostAppearanceStore.d.ts +64 -0
  381. package/lib/typescript/commonjs/provider/HostAppearanceStore.d.ts.map +1 -0
  382. package/lib/typescript/commonjs/provider/KokoProvider.d.ts +39 -0
  383. package/lib/typescript/commonjs/provider/KokoProvider.d.ts.map +1 -0
  384. package/lib/typescript/commonjs/provider/KokoUiContext.d.ts +22 -0
  385. package/lib/typescript/commonjs/provider/KokoUiContext.d.ts.map +1 -0
  386. package/lib/typescript/commonjs/selector/match.d.ts +27 -0
  387. package/lib/typescript/commonjs/selector/match.d.ts.map +1 -0
  388. package/lib/typescript/commonjs/task/TaskStore.d.ts +65 -0
  389. package/lib/typescript/commonjs/task/TaskStore.d.ts.map +1 -0
  390. package/lib/typescript/commonjs/task/types.d.ts +66 -0
  391. package/lib/typescript/commonjs/task/types.d.ts.map +1 -0
  392. package/lib/typescript/commonjs/task/useTaskStore.d.ts +3 -0
  393. package/lib/typescript/commonjs/task/useTaskStore.d.ts.map +1 -0
  394. package/lib/typescript/commonjs/types.d.ts +372 -0
  395. package/lib/typescript/commonjs/types.d.ts.map +1 -0
  396. package/lib/typescript/commonjs/ui/KokoChatSheet.d.ts +8 -0
  397. package/lib/typescript/commonjs/ui/KokoChatSheet.d.ts.map +1 -0
  398. package/lib/typescript/commonjs/ui/KokoComposer.d.ts +13 -0
  399. package/lib/typescript/commonjs/ui/KokoComposer.d.ts.map +1 -0
  400. package/lib/typescript/commonjs/ui/KokoDialogHost.d.ts +32 -0
  401. package/lib/typescript/commonjs/ui/KokoDialogHost.d.ts.map +1 -0
  402. package/lib/typescript/commonjs/ui/KokoEntryButton.d.ts +18 -0
  403. package/lib/typescript/commonjs/ui/KokoEntryButton.d.ts.map +1 -0
  404. package/lib/typescript/commonjs/ui/KokoObserver.d.ts +13 -0
  405. package/lib/typescript/commonjs/ui/KokoObserver.d.ts.map +1 -0
  406. package/lib/typescript/commonjs/ui/KokoOverlayLayer.d.ts +35 -0
  407. package/lib/typescript/commonjs/ui/KokoOverlayLayer.d.ts.map +1 -0
  408. package/lib/typescript/commonjs/ui/KokoSubtitle.d.ts +7 -0
  409. package/lib/typescript/commonjs/ui/KokoSubtitle.d.ts.map +1 -0
  410. package/lib/typescript/commonjs/ui/KokoTaskPanel.d.ts +7 -0
  411. package/lib/typescript/commonjs/ui/KokoTaskPanel.d.ts.map +1 -0
  412. package/lib/typescript/commonjs/ui/hostOverlay.d.ts +28 -0
  413. package/lib/typescript/commonjs/ui/hostOverlay.d.ts.map +1 -0
  414. package/lib/typescript/commonjs/ui/icons.d.ts +26 -0
  415. package/lib/typescript/commonjs/ui/icons.d.ts.map +1 -0
  416. package/lib/typescript/commonjs/ui/progressChrome.d.ts +21 -0
  417. package/lib/typescript/commonjs/ui/progressChrome.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/ui/safeArea.d.ts +12 -0
  419. package/lib/typescript/commonjs/ui/safeArea.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/ui/useOverlayOrigin.d.ts +22 -0
  421. package/lib/typescript/commonjs/ui/useOverlayOrigin.d.ts.map +1 -0
  422. package/lib/typescript/module/KokoAgent.d.ts +167 -0
  423. package/lib/typescript/module/KokoAgent.d.ts.map +1 -0
  424. package/lib/typescript/module/assist/OnDeviceAssist.d.ts +31 -0
  425. package/lib/typescript/module/assist/OnDeviceAssist.d.ts.map +1 -0
  426. package/lib/typescript/module/assist/intentClassify.d.ts +18 -0
  427. package/lib/typescript/module/assist/intentClassify.d.ts.map +1 -0
  428. package/lib/typescript/module/assist/nodeRank.d.ts +32 -0
  429. package/lib/typescript/module/assist/nodeRank.d.ts.map +1 -0
  430. package/lib/typescript/module/assist/ocrTarget.d.ts +25 -0
  431. package/lib/typescript/module/assist/ocrTarget.d.ts.map +1 -0
  432. package/lib/typescript/module/assist/webVisualChange.d.ts +6 -0
  433. package/lib/typescript/module/assist/webVisualChange.d.ts.map +1 -0
  434. package/lib/typescript/module/client/ActionOutcomeUnknownError.d.ts +13 -0
  435. package/lib/typescript/module/client/ActionOutcomeUnknownError.d.ts.map +1 -0
  436. package/lib/typescript/module/client/AgentSession.d.ts +56 -0
  437. package/lib/typescript/module/client/AgentSession.d.ts.map +1 -0
  438. package/lib/typescript/module/client/GatewayClient.d.ts +149 -0
  439. package/lib/typescript/module/client/GatewayClient.d.ts.map +1 -0
  440. package/lib/typescript/module/client/OperationReplayGuard.d.ts +13 -0
  441. package/lib/typescript/module/client/OperationReplayGuard.d.ts.map +1 -0
  442. package/lib/typescript/module/client/RunCheckpoint.d.ts +57 -0
  443. package/lib/typescript/module/client/RunCheckpoint.d.ts.map +1 -0
  444. package/lib/typescript/module/client/loopDetect.d.ts +15 -0
  445. package/lib/typescript/module/client/loopDetect.d.ts.map +1 -0
  446. package/lib/typescript/module/client/recentSearch.d.ts +5 -0
  447. package/lib/typescript/module/client/recentSearch.d.ts.map +1 -0
  448. package/lib/typescript/module/client/walletChoiceGuard.d.ts +4 -0
  449. package/lib/typescript/module/client/walletChoiceGuard.d.ts.map +1 -0
  450. package/lib/typescript/module/client/webResultCategory.d.ts +5 -0
  451. package/lib/typescript/module/client/webResultCategory.d.ts.map +1 -0
  452. package/lib/typescript/module/commercial/AccountStore.d.ts +17 -0
  453. package/lib/typescript/module/commercial/AccountStore.d.ts.map +1 -0
  454. package/lib/typescript/module/commercial/AgentDebug.d.ts +25 -0
  455. package/lib/typescript/module/commercial/AgentDebug.d.ts.map +1 -0
  456. package/lib/typescript/module/commercial/ExecutionGuard.d.ts +18 -0
  457. package/lib/typescript/module/commercial/ExecutionGuard.d.ts.map +1 -0
  458. package/lib/typescript/module/commercial/UsageBus.d.ts +18 -0
  459. package/lib/typescript/module/commercial/UsageBus.d.ts.map +1 -0
  460. package/lib/typescript/module/commercial/branding.d.ts +25 -0
  461. package/lib/typescript/module/commercial/branding.d.ts.map +1 -0
  462. package/lib/typescript/module/commercial/devMode.d.ts +26 -0
  463. package/lib/typescript/module/commercial/devMode.d.ts.map +1 -0
  464. package/lib/typescript/module/commercial/trust.d.ts +21 -0
  465. package/lib/typescript/module/commercial/trust.d.ts.map +1 -0
  466. package/lib/typescript/module/confirmation/gate.d.ts +18 -0
  467. package/lib/typescript/module/confirmation/gate.d.ts.map +1 -0
  468. package/lib/typescript/module/cursor/CursorOverlay.d.ts +13 -0
  469. package/lib/typescript/module/cursor/CursorOverlay.d.ts.map +1 -0
  470. package/lib/typescript/module/cursor/PointerHand.d.ts +16 -0
  471. package/lib/typescript/module/cursor/PointerHand.d.ts.map +1 -0
  472. package/lib/typescript/module/cursor/controller.d.ts +30 -0
  473. package/lib/typescript/module/cursor/controller.d.ts.map +1 -0
  474. package/lib/typescript/module/cursor/pointer.d.ts +23 -0
  475. package/lib/typescript/module/cursor/pointer.d.ts.map +1 -0
  476. package/lib/typescript/module/debug/KokoRemoteSmoke.d.ts +96 -0
  477. package/lib/typescript/module/debug/KokoRemoteSmoke.d.ts.map +1 -0
  478. package/lib/typescript/module/explore/ExplorationGraph.d.ts +96 -0
  479. package/lib/typescript/module/explore/ExplorationGraph.d.ts.map +1 -0
  480. package/lib/typescript/module/explore/bootstrapExplore.d.ts +40 -0
  481. package/lib/typescript/module/explore/bootstrapExplore.d.ts.map +1 -0
  482. package/lib/typescript/module/host/HostActions.d.ts +101 -0
  483. package/lib/typescript/module/host/HostActions.d.ts.map +1 -0
  484. package/lib/typescript/module/i18n/index.d.ts +20 -0
  485. package/lib/typescript/module/i18n/index.d.ts.map +1 -0
  486. package/lib/typescript/module/i18n/runtimeMessages.d.ts +178 -0
  487. package/lib/typescript/module/i18n/runtimeMessages.d.ts.map +1 -0
  488. package/lib/typescript/module/index.d.ts +66 -0
  489. package/lib/typescript/module/index.d.ts.map +1 -0
  490. package/lib/typescript/module/native/NativeBridge.d.ts +70 -0
  491. package/lib/typescript/module/native/NativeBridge.d.ts.map +1 -0
  492. package/lib/typescript/module/native/navigationLabel.d.ts +4 -0
  493. package/lib/typescript/module/native/navigationLabel.d.ts.map +1 -0
  494. package/lib/typescript/module/native/normalizeViewTree.d.ts +4 -0
  495. package/lib/typescript/module/native/normalizeViewTree.d.ts.map +1 -0
  496. package/lib/typescript/module/native/pruneOffscreen.d.ts +3 -0
  497. package/lib/typescript/module/native/pruneOffscreen.d.ts.map +1 -0
  498. package/lib/typescript/module/native/scrollViewport.d.ts +13 -0
  499. package/lib/typescript/module/native/scrollViewport.d.ts.map +1 -0
  500. package/lib/typescript/module/package.json +1 -0
  501. package/lib/typescript/module/privacy/redact.d.ts +9 -0
  502. package/lib/typescript/module/privacy/redact.d.ts.map +1 -0
  503. package/lib/typescript/module/privacy/screenEvidence.d.ts +14 -0
  504. package/lib/typescript/module/privacy/screenEvidence.d.ts.map +1 -0
  505. package/lib/typescript/module/privacy/screenModel.d.ts +26 -0
  506. package/lib/typescript/module/privacy/screenModel.d.ts.map +1 -0
  507. package/lib/typescript/module/privacy/sensitiveScreen.d.ts +8 -0
  508. package/lib/typescript/module/privacy/sensitiveScreen.d.ts.map +1 -0
  509. package/lib/typescript/module/privacy/userGate.d.ts +58 -0
  510. package/lib/typescript/module/privacy/userGate.d.ts.map +1 -0
  511. package/lib/typescript/module/protocol/actions.d.ts +7 -0
  512. package/lib/typescript/module/protocol/actions.d.ts.map +1 -0
  513. package/lib/typescript/module/provider/HostAppearanceStore.d.ts +64 -0
  514. package/lib/typescript/module/provider/HostAppearanceStore.d.ts.map +1 -0
  515. package/lib/typescript/module/provider/KokoProvider.d.ts +39 -0
  516. package/lib/typescript/module/provider/KokoProvider.d.ts.map +1 -0
  517. package/lib/typescript/module/provider/KokoUiContext.d.ts +22 -0
  518. package/lib/typescript/module/provider/KokoUiContext.d.ts.map +1 -0
  519. package/lib/typescript/module/selector/match.d.ts +27 -0
  520. package/lib/typescript/module/selector/match.d.ts.map +1 -0
  521. package/lib/typescript/module/task/TaskStore.d.ts +65 -0
  522. package/lib/typescript/module/task/TaskStore.d.ts.map +1 -0
  523. package/lib/typescript/module/task/types.d.ts +66 -0
  524. package/lib/typescript/module/task/types.d.ts.map +1 -0
  525. package/lib/typescript/module/task/useTaskStore.d.ts +3 -0
  526. package/lib/typescript/module/task/useTaskStore.d.ts.map +1 -0
  527. package/lib/typescript/module/types.d.ts +372 -0
  528. package/lib/typescript/module/types.d.ts.map +1 -0
  529. package/lib/typescript/module/ui/KokoChatSheet.d.ts +8 -0
  530. package/lib/typescript/module/ui/KokoChatSheet.d.ts.map +1 -0
  531. package/lib/typescript/module/ui/KokoComposer.d.ts +13 -0
  532. package/lib/typescript/module/ui/KokoComposer.d.ts.map +1 -0
  533. package/lib/typescript/module/ui/KokoDialogHost.d.ts +32 -0
  534. package/lib/typescript/module/ui/KokoDialogHost.d.ts.map +1 -0
  535. package/lib/typescript/module/ui/KokoEntryButton.d.ts +18 -0
  536. package/lib/typescript/module/ui/KokoEntryButton.d.ts.map +1 -0
  537. package/lib/typescript/module/ui/KokoObserver.d.ts +13 -0
  538. package/lib/typescript/module/ui/KokoObserver.d.ts.map +1 -0
  539. package/lib/typescript/module/ui/KokoOverlayLayer.d.ts +35 -0
  540. package/lib/typescript/module/ui/KokoOverlayLayer.d.ts.map +1 -0
  541. package/lib/typescript/module/ui/KokoSubtitle.d.ts +7 -0
  542. package/lib/typescript/module/ui/KokoSubtitle.d.ts.map +1 -0
  543. package/lib/typescript/module/ui/KokoTaskPanel.d.ts +7 -0
  544. package/lib/typescript/module/ui/KokoTaskPanel.d.ts.map +1 -0
  545. package/lib/typescript/module/ui/hostOverlay.d.ts +28 -0
  546. package/lib/typescript/module/ui/hostOverlay.d.ts.map +1 -0
  547. package/lib/typescript/module/ui/icons.d.ts +26 -0
  548. package/lib/typescript/module/ui/icons.d.ts.map +1 -0
  549. package/lib/typescript/module/ui/progressChrome.d.ts +21 -0
  550. package/lib/typescript/module/ui/progressChrome.d.ts.map +1 -0
  551. package/lib/typescript/module/ui/safeArea.d.ts +12 -0
  552. package/lib/typescript/module/ui/safeArea.d.ts.map +1 -0
  553. package/lib/typescript/module/ui/useOverlayOrigin.d.ts +22 -0
  554. package/lib/typescript/module/ui/useOverlayOrigin.d.ts.map +1 -0
  555. package/package.json +153 -0
  556. package/react-native.config.js +12 -0
  557. package/src/KokoAgent.ts +1415 -0
  558. package/src/assist/OnDeviceAssist.ts +133 -0
  559. package/src/assist/intentClassify.ts +122 -0
  560. package/src/assist/nodeRank.ts +167 -0
  561. package/src/assist/ocrTarget.ts +146 -0
  562. package/src/assist/webVisualChange.ts +24 -0
  563. package/src/client/ActionOutcomeUnknownError.ts +18 -0
  564. package/src/client/AgentSession.ts +952 -0
  565. package/src/client/GatewayClient.ts +439 -0
  566. package/src/client/OperationReplayGuard.ts +61 -0
  567. package/src/client/RunCheckpoint.ts +154 -0
  568. package/src/client/loopDetect.ts +213 -0
  569. package/src/client/recentSearch.ts +47 -0
  570. package/src/client/walletChoiceGuard.ts +15 -0
  571. package/src/client/webResultCategory.ts +28 -0
  572. package/src/commercial/AccountStore.ts +85 -0
  573. package/src/commercial/AgentDebug.ts +142 -0
  574. package/src/commercial/ExecutionGuard.ts +67 -0
  575. package/src/commercial/UsageBus.ts +44 -0
  576. package/src/commercial/branding.ts +97 -0
  577. package/src/commercial/devMode.ts +48 -0
  578. package/src/commercial/trust.ts +67 -0
  579. package/src/confirmation/gate.ts +82 -0
  580. package/src/cursor/CursorOverlay.tsx +138 -0
  581. package/src/cursor/PointerHand.tsx +49 -0
  582. package/src/cursor/controller.ts +98 -0
  583. package/src/cursor/pointer.ts +40 -0
  584. package/src/debug/KokoRemoteSmoke.tsx +561 -0
  585. package/src/explore/ExplorationGraph.ts +518 -0
  586. package/src/explore/bootstrapExplore.ts +89 -0
  587. package/src/host/HostActions.ts +349 -0
  588. package/src/i18n/index.ts +229 -0
  589. package/src/i18n/runtimeMessages.ts +180 -0
  590. package/src/index.ts +203 -0
  591. package/src/native/NativeBridge.ts +207 -0
  592. package/src/native/navigationLabel.ts +11 -0
  593. package/src/native/normalizeViewTree.ts +16 -0
  594. package/src/native/pruneOffscreen.ts +72 -0
  595. package/src/native/scrollViewport.ts +51 -0
  596. package/src/privacy/redact.ts +115 -0
  597. package/src/privacy/screenEvidence.ts +55 -0
  598. package/src/privacy/screenModel.ts +504 -0
  599. package/src/privacy/sensitiveScreen.ts +55 -0
  600. package/src/privacy/userGate.ts +233 -0
  601. package/src/protocol/actions.ts +66 -0
  602. package/src/provider/HostAppearanceStore.ts +148 -0
  603. package/src/provider/KokoProvider.tsx +118 -0
  604. package/src/provider/KokoUiContext.tsx +162 -0
  605. package/src/selector/match.ts +417 -0
  606. package/src/task/TaskStore.ts +387 -0
  607. package/src/task/types.ts +82 -0
  608. package/src/task/useTaskStore.ts +9 -0
  609. package/src/types.ts +318 -0
  610. package/src/ui/KokoChatSheet.tsx +930 -0
  611. package/src/ui/KokoComposer.tsx +174 -0
  612. package/src/ui/KokoDialogHost.tsx +249 -0
  613. package/src/ui/KokoEntryButton.tsx +74 -0
  614. package/src/ui/KokoObserver.tsx +587 -0
  615. package/src/ui/KokoOverlayLayer.tsx +53 -0
  616. package/src/ui/KokoSubtitle.tsx +80 -0
  617. package/src/ui/KokoTaskPanel.tsx +299 -0
  618. package/src/ui/hostOverlay.tsx +148 -0
  619. package/src/ui/icons.tsx +145 -0
  620. package/src/ui/progressChrome.ts +73 -0
  621. package/src/ui/safeArea.ts +95 -0
  622. package/src/ui/useOverlayOrigin.ts +29 -0
@@ -0,0 +1,266 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.HostActionsStore = exports.HOST_ACTION_TIMEOUT_MS = void 0;
7
+ exports.canRunHostActionForNode = canRunHostActionForNode;
8
+ exports.clearHostActions = clearHostActions;
9
+ exports.filterVisibleHostActions = filterVisibleHostActions;
10
+ exports.hostActionsModelText = hostActionsModelText;
11
+ exports.registerHostActions = registerHostActions;
12
+ exports.runHostAction = runHostAction;
13
+ exports.setHostActions = setHostActions;
14
+ exports.unregisterHostAction = unregisterHostAction;
15
+ var _match = require("../selector/match.js");
16
+ /**
17
+ * Optional host-declared actions — the low-friction way for complex Apps
18
+ * (OneKey / Tamagui) when native dump cannot see icons without a11y/testID.
19
+ *
20
+ * Hosts register controls only while mounted and visible. Callbacks supplement
21
+ * native controls; registration does not establish visibility or identity.
22
+ *
23
+ * IMPORTANT: host ids are NOT dump nodeIds. Never emit `id=host:…` in the
24
+ * screen model — planners will tap them and fail with "nodeId not found".
25
+ *
26
+ * Optional `run`: after a unique current native control is bound, a callback
27
+ * may execute its behavior instead of dispatching a geometric touch.
28
+ */
29
+
30
+ /**
31
+ * Host action matching: also consider optional aliases (e.g. prior-locale tab copy).
32
+ */
33
+
34
+ class HostActionsStoreImpl {
35
+ actions = [];
36
+ listeners = new Set();
37
+
38
+ /** Replace the whole catalog (typical: once at app start). */
39
+ setActions(actions) {
40
+ this.actions = sanitize(actions);
41
+ this.emit();
42
+ }
43
+
44
+ /** Append / upsert by id. */
45
+ registerActions(actions) {
46
+ const map = new Map(this.actions.map(a => [a.id, a]));
47
+ for (const a of sanitize(actions)) map.set(a.id, a);
48
+ this.actions = [...map.values()];
49
+ this.emit();
50
+ }
51
+
52
+ /** Drop a previously registered action (e.g. EmptyWallet unmount). */
53
+ unregisterAction(id) {
54
+ const key = String(id ?? '').replace(/^host:/, '').trim();
55
+ if (!key) return;
56
+ const next = this.actions.filter(a => a.id !== key);
57
+ if (next.length === this.actions.length) return;
58
+ this.actions = next;
59
+ this.emit();
60
+ }
61
+ clear() {
62
+ this.actions = [];
63
+ this.emit();
64
+ }
65
+ getActions() {
66
+ return this.actions.slice();
67
+ }
68
+ getById(id) {
69
+ const key = id.replace(/^host:/, '').trim();
70
+ return this.actions.find(a => a.id === key);
71
+ }
72
+
73
+ /** Match by label / text / testID (planner taps by copy, not host id). */
74
+ findForTap(needle) {
75
+ const testID = (needle.testID || '').trim();
76
+ if (testID) {
77
+ const matches = this.actions.filter(a => a.testID === testID);
78
+ // An explicit native identity must not fall back to a different callback.
79
+ return matches.length === 1 ? matches[0] : undefined;
80
+ }
81
+ const raw = (needle.text || needle.label || '').trim();
82
+ if (!raw) return undefined;
83
+ // Also match 「发现」 inside narration like「打开「发现」标签页」.
84
+ const quoted = raw.match(/「([^」]+)」/)?.[1]?.trim();
85
+ const needles = quoted && quoted !== raw ? [raw, quoted] : [raw];
86
+ const hits = this.actions.filter(a => {
87
+ const candidates = [a.label, a.text, ...(a.aliases ?? [])].filter(Boolean);
88
+ return needles.some(label => candidates.some(c => (0, _match.textMatches)(c, label, true)));
89
+ });
90
+ // Repeated row labels need the native selector/geometry or a unique testID.
91
+ // Picking the first callback silently targets a different item.
92
+ return hits.length === 1 ? hits[0] : undefined;
93
+ }
94
+ subscribe(listener) {
95
+ this.listeners.add(listener);
96
+ listener(this.getActions());
97
+ return () => this.listeners.delete(listener);
98
+ }
99
+ emit() {
100
+ const snap = this.getActions();
101
+ for (const l of this.listeners) l(snap);
102
+ }
103
+ }
104
+ function sanitize(actions) {
105
+ const out = [];
106
+ for (const a of actions) {
107
+ const id = String(a?.id ?? '').trim();
108
+ const label = String(a?.label ?? '').trim();
109
+ if (!id || !label) continue;
110
+ const kind = a.kind ?? 'button';
111
+ const hasRun = typeof a.run === 'function';
112
+ // Tabs stay registered; button CTAs with run are one-shot by default.
113
+ const oneshot = typeof a.oneshot === 'boolean' ? a.oneshot : hasRun && kind !== 'tab';
114
+ out.push({
115
+ id: id.slice(0, 80),
116
+ label: label.slice(0, 80),
117
+ kind,
118
+ testID: a.testID?.trim().slice(0, 120) || undefined,
119
+ text: a.text?.trim().slice(0, 80) || undefined,
120
+ aliases: Array.isArray(a.aliases) ? a.aliases.map(s => String(s ?? '').trim().slice(0, 80)).filter(Boolean).slice(0, 8) : undefined,
121
+ route: a.route?.trim().slice(0, 120) || undefined,
122
+ // Keep host callback by reference — not serializable, intentional.
123
+ run: hasRun ? a.run : undefined,
124
+ oneshot
125
+ });
126
+ }
127
+ return out.slice(0, 80);
128
+ }
129
+ function hostNeedle(a) {
130
+ return (a.text || a.label || '').trim();
131
+ }
132
+
133
+ /**
134
+ * A unique callback catalog entry is not a unique native control. Bind it to
135
+ * the node already chosen by the full selector (including index/nearText),
136
+ * otherwise the caller must preserve that selector and use a native touch.
137
+ */
138
+ function canRunHostActionForNode(action, selected, root) {
139
+ if (!selected || !root || typeof action.run !== 'function') return false;
140
+ const nodes = new Map();
141
+ const parents = new Map();
142
+ const collect = (node, parent) => {
143
+ if (node.visible === false || node.enabled === false) return;
144
+ nodes.set(node.id, node);
145
+ if (parent) parents.set(node.id, parent);
146
+ for (const child of node.children) collect(child, node);
147
+ };
148
+ collect(root);
149
+ const current = nodes.get(selected.id);
150
+ if (!current || current.type !== selected.type || current.text !== selected.text || current.accessibilityLabel !== selected.accessibilityLabel || current.testID !== selected.testID) return false;
151
+ const usable = node => {
152
+ const frame = node.frame;
153
+ const cx = frame.x + frame.width / 2,
154
+ cy = frame.y + frame.height / 2;
155
+ return node.id !== root.id && frame.width > 0 && frame.height > 0 && frame.width * frame.height < root.frame.width * root.frame.height * 0.55 && cx >= root.frame.x && cx <= root.frame.x + root.frame.width && cy >= root.frame.y && cy <= root.frame.y + root.frame.height;
156
+ };
157
+ const owner = node => {
158
+ for (let current = node; current; current = parents.get(current.id)) {
159
+ if (usable(current) && (current.clickable || current.toggle || current.adjustable || /button|tabbaritem|bottomnavigationitem/i.test(current.type))) return current;
160
+ }
161
+ return undefined;
162
+ };
163
+ const targetOwner = owner(current);
164
+ if (action.testID) {
165
+ const matches = [...nodes.values()].filter(node => node.testID === action.testID && usable(node));
166
+ if (matches.length !== 1) return false;
167
+ const anchor = matches[0];
168
+ // A unique explicit testID may identify a non-clickable text leaf, which
169
+ // Fabric commonly nests inside the actual Pressable selected by geometry.
170
+ return anchor.id === current.id || !!targetOwner && owner(anchor)?.id === targetOwner.id;
171
+ }
172
+ if (!targetOwner) return false;
173
+ const needles = [action.text || action.label, ...(action.aliases || [])].filter(Boolean);
174
+ const owners = new Set();
175
+ for (const node of nodes.values()) {
176
+ if (!needles.some(label => (0, _match.textMatches)(node.text, label, true) || (0, _match.textMatches)(node.accessibilityLabel, label, true))) continue;
177
+ const control = owner(node);
178
+ if (control) owners.add(control.id);
179
+ }
180
+ return owners.size === 1 && owners.has(targetOwner.id);
181
+ }
182
+
183
+ /**
184
+ * Callbacks declare behavior, not visibility. Only current visible native
185
+ * evidence enters the model; missing native content can use fresh local OCR.
186
+ */
187
+ function filterVisibleHostActions(actions, root) {
188
+ if (!actions.length) return [];
189
+ if (!root) return [];
190
+ const nodes = (0, _match.flattenTree)(root).filter(n => n.visible !== false && n.enabled !== false);
191
+ const inDump = (a, exact = false) => {
192
+ if (a.testID && nodes.some(n => n.testID === a.testID)) return true;
193
+ const needles = [hostNeedle(a), ...(a.aliases ?? [])].map(s => s.trim()).filter(Boolean);
194
+ if (!needles.length) return false;
195
+ for (const needle of needles) {
196
+ const hit = nodes.some(n => {
197
+ if (exact) {
198
+ return (0, _match.textMatches)(n.text, needle, true) || (0, _match.textMatches)(n.accessibilityLabel, needle, true);
199
+ }
200
+ return (0, _match.textMatches)(n.text, needle) || (0, _match.textMatches)(n.accessibilityLabel, needle);
201
+ });
202
+ if (hit) return true;
203
+ }
204
+ return false;
205
+ };
206
+ return actions.filter(a => {
207
+ // Exact: avoid「钱包」tab matching「创建助记词钱包」onboarding copy.
208
+ if (a.kind === 'tab') return inDump(a, true);
209
+ return inDump(a, true);
210
+ });
211
+ }
212
+
213
+ /**
214
+ * Compact lines merged into ui_screen_model.
215
+ * No fake node ids — tap must use text「…」 / testID, never id=host:….
216
+ */
217
+ function hostActionsModelText(actions) {
218
+ if (!actions.length) return '';
219
+ return actions.map(a => {
220
+ const kind = a.kind ?? 'button';
221
+ const tip = a.testID ? ` testID=${a.testID}` : a.text ? ` text「${a.text}」` : ` text「${a.label}」`;
222
+ const via = typeof a.run === 'function' ? '(host run)' : '(按文案 tap,禁止用 host id)';
223
+ return `- [host:${kind}] 「${a.label}」${tip}${via}`;
224
+ }).join('\n');
225
+ }
226
+ const HostActionsStore = exports.HostActionsStore = new HostActionsStoreImpl();
227
+ function setHostActions(actions) {
228
+ HostActionsStore.setActions(actions);
229
+ }
230
+ function registerHostActions(actions) {
231
+ HostActionsStore.registerActions(actions);
232
+ }
233
+ function unregisterHostAction(id) {
234
+ HostActionsStore.unregisterAction(id);
235
+ }
236
+ function clearHostActions() {
237
+ HostActionsStore.clear();
238
+ }
239
+
240
+ /**
241
+ * Upper bound on a single host action. These callbacks are app code we do not
242
+ * control: one that never settles wedges the whole goal with no step, no log
243
+ * line and no timeout above it. Observed as a goal sitting for minutes without
244
+ * ever reaching the planner.
245
+ */
246
+ const HOST_ACTION_TIMEOUT_MS = exports.HOST_ACTION_TIMEOUT_MS = 8000;
247
+
248
+ /**
249
+ * Await a host callback without letting it hang the agent. Resolves false when
250
+ * it throws or outruns its budget. False means the outcome is unknown: the
251
+ * callback may already have committed work, so callers must not replay a tap.
252
+ */
253
+ async function runHostAction(run, timeoutMs = HOST_ACTION_TIMEOUT_MS) {
254
+ let timer;
255
+ try {
256
+ await Promise.race([Promise.resolve(run()), new Promise((_, reject) => {
257
+ timer = setTimeout(() => reject(new Error(`host action exceeded ${timeoutMs}ms`)), timeoutMs);
258
+ })]);
259
+ return true;
260
+ } catch {
261
+ return false;
262
+ } finally {
263
+ if (timer) clearTimeout(timer);
264
+ }
265
+ }
266
+ //# sourceMappingURL=HostActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_match","require","HostActionsStoreImpl","actions","listeners","Set","setActions","sanitize","emit","registerActions","map","Map","a","id","set","values","unregisterAction","key","String","replace","trim","next","filter","length","clear","getActions","slice","getById","find","findForTap","needle","testID","matches","undefined","raw","text","label","quoted","match","needles","hits","candidates","aliases","Boolean","some","c","textMatches","subscribe","listener","add","delete","snap","l","out","kind","hasRun","run","oneshot","push","Array","isArray","s","route","hostNeedle","canRunHostActionForNode","action","selected","root","nodes","parents","collect","node","parent","visible","enabled","child","children","current","get","type","accessibilityLabel","usable","frame","cx","x","width","cy","y","height","owner","clickable","toggle","adjustable","test","targetOwner","anchor","owners","control","size","has","filterVisibleHostActions","flattenTree","n","inDump","exact","hit","hostActionsModelText","tip","via","join","HostActionsStore","exports","setHostActions","registerHostActions","unregisterHostAction","clearHostActions","HOST_ACTION_TIMEOUT_MS","runHostAction","timeoutMs","timer","Promise","race","resolve","_","reject","setTimeout","Error","clearTimeout"],"sourceRoot":"../../../src","sources":["host/HostActions.ts"],"mappings":";;;;;;;;;;;;;;AAcA,IAAAA,MAAA,GAAAC,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;;AA6BA,MAAMC,oBAAoB,CAAC;EACjBC,OAAO,GAAiB,EAAE;EAC1BC,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;;EAEvC;EACAC,UAAUA,CAACH,OAAqB,EAAE;IAChC,I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G,oBAAoB,CAAC,CAAC;AAEnD,SAAS8G,cAAcA,CAAC7G,OAAqB,EAAE;EACpD2G,gBAAgB,CAACxG,UAAU,CAACH,OAAO,CAAC;AACtC;AAEO,SAAS8G,mBAAmBA,CAAC9G,OAAqB,EAAE;EACzD2G,gBAAgB,CAACrG,eAAe,CAACN,OAAO,CAAC;AAC3C;AAEO,SAAS+G,oBAAoBA,CAACrG,EAAU,EAAE;EAC/CiG,gBAAgB,CAAC9F,gBAAgB,CAACH,EAAE,CAAC;AACvC;AAEO,SAASsG,gBAAgBA,CAAA,EAAG;EACjCL,gBAAgB,CAACtF,KAAK,CAAC,CAAC;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM4F,sBAAsB,GAAAL,OAAA,CAAAK,sBAAA,GAAG,IAAI;;AAE1C;AACA;AACA;AACA;AACA;AACO,eAAeC,aAAaA,CACjC7D,GAA+B,EAC/B8D,SAAiB,GAAGF,sBAAsB,EACxB;EAClB,IAAIG,KAAgD;EACpD,IAAI;IACF,MAAMC,OAAO,CAACC,IAAI,CAAC,CACjBD,OAAO,CAACE,OAAO,CAAClE,GAAG,CAAC,CAAC,CAAC,EACtB,IAAIgE,OAAO,CAAQ,CAACG,CAAC,EAAEC,MAAM,KAAK;MAChCL,KAAK,GAAGM,UAAU,CAChB,MAAMD,MAAM,CAAC,IAAIE,KAAK,CAAC,wBAAwBR,SAAS,IAAI,CAAC,CAAC,EAC9DA,SACF,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IACF,OAAO,IAAI;EACb,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd,CAAC,SAAS;IACR,IAAIC,KAAK,EAAEQ,YAAY,CAACR,KAAK,CAAC;EAChC;AACF","ignoreList":[]}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.currentLocale = currentLocale;
7
+ exports.gatewayLocale = gatewayLocale;
8
+ exports.message = message;
9
+ exports.normalizeLocale = normalizeLocale;
10
+ exports.resolveText = resolveText;
11
+ exports.runtimeText = runtimeText;
12
+ exports.t = t;
13
+ var _runtimeMessages = require("./runtimeMessages.js");
14
+ var _HostAppearanceStore = require("../provider/HostAppearanceStore.js");
15
+ const zh = {
16
+ ..._runtimeMessages.runtimeZh,
17
+ 'brand.defaultName': 'Koko',
18
+ 'brand.defaultTagline': '用自然语言操作当前 App',
19
+ 'brand.defaultPlaceholder': '跟 Koko 说你想做什么…',
20
+ 'brand.defaultMark': 'K',
21
+ 'sheet.recentTasks': '最近任务',
22
+ 'sheet.timeline': '执行记录',
23
+ 'sheet.emptyTasks': '还没有任务,在下方说一句开始',
24
+ 'sheet.emptyNodesTitle': '暂无步骤',
25
+ 'sheet.emptyNodesHint': '发送指令后,这里会显示每一步操作',
26
+ 'sheet.send': '发送',
27
+ 'sheet.closeA11y': '关闭会话',
28
+ 'sheet.stopA11y': '停止当前任务',
29
+ 'sheet.inputA11y': '自然语言指令',
30
+ 'sheet.deleteTaskTitle': '删除任务',
31
+ 'sheet.deleteTaskBody': '删除「{title}」?此操作不可撤销。',
32
+ 'sheet.deleteTask': '删除',
33
+ 'status.running': '进行中',
34
+ 'status.success': '完成',
35
+ 'status.failed': '失败',
36
+ 'status.cancelled': '已取消',
37
+ 'kind.user': '用户',
38
+ 'kind.plan': '规划',
39
+ 'kind.dump': '扫描',
40
+ 'kind.find': '定位',
41
+ 'kind.tap': '点击',
42
+ 'kind.swipe': '滑动',
43
+ 'kind.type': '输入',
44
+ 'kind.confirm': '确认',
45
+ 'kind.info': '信息',
46
+ 'kind.error': '错误',
47
+ 'resume.note': 'App 重载中断了上一次执行,已自动继续',
48
+ 'resume.verifyFirst': '注意:App 在上一次执行中途重载了,这个目标可能已经完成。请先观察当前界面判断目标是否已达成;如已达成,直接返回 done(success=true) 并说明依据,不要重复操作。另外,重载前学到的界面文案可能已失效,请以当前界面为准。',
49
+ 'progress.running': '执行中…',
50
+ 'progress.success': '成功',
51
+ 'progress.failed': '失败',
52
+ 'progress.cancelled': '已取消',
53
+ 'progress.openA11y': '打开会话',
54
+ 'progress.stopA11y': '停止当前任务',
55
+ 'gate.check': '检查状态',
56
+ 'gate.checking': '正在本机检查是否已离开隐私页面…',
57
+ 'gate.stillPrivate': '仍在隐私页面,请在宿主中点击下一步并完成操作;离开此页后自动继续',
58
+ 'gate.unreadable': '暂时无法确认页面状态,请在宿主中完成操作后再检查',
59
+ 'gate.verifyResultFirst': '已将进行中的操作交给用户处理。先核验这次操作的结果,继续剩余步骤;若失败或退回之前的入口/说明页,报告问题并停止,禁止从头重新创建、导入或提交。不能把返回入口当作尚未开始。',
60
+ 'gate.replayStopped': '检测到人工接管后再次进入已发起过的操作,已停止,避免重复创建或提交。请先确认上一次操作的结果。',
61
+ 'dialog.cancel': '取消',
62
+ 'dialog.confirm': '确认',
63
+ 'dialog.continue': '继续',
64
+ 'dialog.askTitle': '需要你的确认',
65
+ 'dialog.askPlaceholder': '输入补充信息',
66
+ 'confirm.preflightTitle': '确认执行此任务?',
67
+ 'confirm.preflightBody': '该操作可能涉及资金或敏感数据:\n「{label}」\n\n确认后将自动执行,过程中可点停止取消。',
68
+ 'confirm.inlineTitle': '需要你的确认',
69
+ 'confirm.inlineBody': '即将执行敏感操作:{label}'
70
+ };
71
+ const en = {
72
+ ..._runtimeMessages.runtimeEn,
73
+ 'brand.defaultName': 'Koko',
74
+ 'brand.defaultTagline': 'Control this app with natural language',
75
+ 'brand.defaultPlaceholder': 'Tell Koko what you want to do…',
76
+ 'brand.defaultMark': 'K',
77
+ 'sheet.recentTasks': 'Recent tasks',
78
+ 'sheet.timeline': 'Activity',
79
+ 'sheet.emptyTasks': 'No tasks yet — type a goal below',
80
+ 'sheet.emptyNodesTitle': 'No steps yet',
81
+ 'sheet.emptyNodesHint': 'After you send a goal, each step shows up here',
82
+ 'sheet.send': 'Send',
83
+ 'sheet.closeA11y': 'Close chat',
84
+ 'sheet.stopA11y': 'Stop current task',
85
+ 'sheet.inputA11y': 'Natural language command',
86
+ 'sheet.deleteTaskTitle': 'Delete task',
87
+ 'sheet.deleteTaskBody': 'Delete “{title}”? This cannot be undone.',
88
+ 'sheet.deleteTask': 'Delete',
89
+ 'status.running': 'Running',
90
+ 'status.success': 'Done',
91
+ 'status.failed': 'Failed',
92
+ 'status.cancelled': 'Cancelled',
93
+ 'kind.user': 'User',
94
+ 'kind.plan': 'Plan',
95
+ 'kind.dump': 'Scan',
96
+ 'kind.find': 'Find',
97
+ 'kind.tap': 'Tap',
98
+ 'kind.swipe': 'Swipe',
99
+ 'kind.type': 'Type',
100
+ 'kind.confirm': 'Confirm',
101
+ 'kind.info': 'Info',
102
+ 'kind.error': 'Error',
103
+ 'resume.note': 'A reload interrupted the previous run; continuing it',
104
+ 'resume.verifyFirst': 'Note: the App reloaded partway through the previous run, so this goal may already be complete. Inspect the current screen first and decide whether it is already satisfied; if it is, return done(success=true) with your evidence and change nothing. Labels learned before the reload may no longer exist — trust the current screen.',
105
+ 'progress.running': 'Working…',
106
+ 'progress.success': 'Done',
107
+ 'progress.failed': 'Failed',
108
+ 'progress.cancelled': 'Cancelled',
109
+ 'progress.openA11y': 'Open chat',
110
+ 'progress.stopA11y': 'Stop current task',
111
+ 'gate.check': 'Check status',
112
+ 'gate.checking': 'Checking locally whether you have left the private screen…',
113
+ 'gate.stillPrivate': 'Still on a private screen. Complete the next steps in the app; the assistant resumes after you leave it.',
114
+ 'gate.unreadable': 'Unable to confirm the screen. Complete the step in the app, then check again.',
115
+ 'gate.verifyResultFirst': 'An in-flight operation was handed to the user. Verify its result and continue remaining steps. If it failed or returned to a previous entry or instruction screen, report the issue and stop. Do not restart creation, import, or submission from the beginning.',
116
+ 'gate.replayStopped': 'Stopped a repeated operation after user handoff to avoid duplicate creation or submission. Check the previous operation result first.',
117
+ 'dialog.cancel': 'Cancel',
118
+ 'dialog.confirm': 'Confirm',
119
+ 'dialog.continue': 'Continue',
120
+ 'dialog.askTitle': 'We need your input',
121
+ 'dialog.askPlaceholder': 'Type a reply',
122
+ 'confirm.preflightTitle': 'Run this task?',
123
+ 'confirm.preflightBody': 'This may involve money or sensitive data:\n「{label}」\n\nAfter you confirm, it runs unattended — tap stop to cancel.',
124
+ 'confirm.inlineTitle': 'Confirmation needed',
125
+ 'confirm.inlineBody': 'About to run a sensitive action: {label}'
126
+ };
127
+ const catalogs = {
128
+ zh,
129
+ en
130
+ };
131
+ function normalizeLocale(locale) {
132
+ if (!locale) return 'en';
133
+ const lower = locale.toLowerCase();
134
+ if (lower.startsWith('zh')) return 'zh';
135
+ if (lower.startsWith('en')) return 'en';
136
+ return 'en';
137
+ }
138
+ function gatewayLocale(locale) {
139
+ return locale === 'zh' ? 'zh-CN' : 'en-US';
140
+ }
141
+ function t(locale, key, vars) {
142
+ const table = catalogs[locale] ?? catalogs.en;
143
+ let out = table[key] ?? catalogs.en[key] ?? key;
144
+ if (vars) {
145
+ for (const [k, v] of Object.entries(vars)) {
146
+ out = out.replace(new RegExp(`\\{${k}\\}`, 'g'), () => String(v));
147
+ }
148
+ }
149
+ return out;
150
+ }
151
+ /** Resolve at use time so an in-flight task follows host language changes. */
152
+ function currentLocale(fallbackLocale) {
153
+ return normalizeLocale(_HostAppearanceStore.HostAppearanceStore.get().locale ?? fallbackLocale);
154
+ }
155
+ function message(key, vars, fallbackLocale) {
156
+ return {
157
+ kokoMessage: true,
158
+ key,
159
+ vars,
160
+ fallbackLocale
161
+ };
162
+ }
163
+ function resolveText(value) {
164
+ return typeof value === 'string' ? value : t(currentLocale(value.fallbackLocale), value.key, value.vars);
165
+ }
166
+ function runtimeText(key, vars, fallbackLocale) {
167
+ return t(currentLocale(fallbackLocale), key, vars);
168
+ }
169
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_runtimeMessages","require","_HostAppearanceStore","zh","runtimeZh","en","runtimeEn","catalogs","normalizeLocale","locale","lower","toLowerCase","startsWith","gatewayLocale","t","key","vars","table","out","k","v","Object","entries","replace","RegExp","String","currentLocale","fallbackLocale","HostAppearanceStore","get","message","kokoMessage","resolveText","value","runtimeText"],"sourceRoot":"../../../src","sources":["i18n/index.ts"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AA0DA,MAAME,EAA8B,GAAG;EACrC,GAAGC,0BAAS;EACZ,mBAAmB,EAAE,MAAM;EAC3B,sBAAsB,EAAE,eAAe;EACvC,0BAA0B,EAAE,gBAAgB;EAC5C,mBAAmB,EAAE,GAAG;EACxB,mBAAmB,EAAE,MAAM;EAC3B,gBAAgB,EAAE,MAAM;EACxB,kBAAkB,EAAE,gBAAgB;EACpC,uBAAuB,EAAE,MAAM;EAC/B,sBAAsB,EAAE,kBAAkB;EAC1C,YAAY,EAAE,IAAI;EAClB,iBAAiB,EAAE,MAAM;EACzB,gBAAgB,EAAE,QAAQ;EAC1B,iBAAiB,EAAE,QAAQ;EAC3B,uBAAuB,EAAE,MAAM;EAC/B,sBAAsB,EAAE,sBAAsB;EAC9C,kBAAkB,EAAE,IAAI;EACxB,gBAAgB,EAAE,KAAK;EACvB,gBAAgB,EAAE,IAAI;EACtB,eAAe,EAAE,IAAI;EACrB,kBAAkB,EAAE,KAAK;EACzB,WAAW,EAAE,IAAI;EACjB,WAAW,EAAE,IAAI;EACjB,WAAW,EAAE,IAAI;EACjB,WAAW,EAAE,IAAI;EACjB,UAAU,EAAE,IAAI;EAChB,YAAY,EAAE,IAAI;EAClB,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;EACpB,WAAW,EAAE,IAAI;EACjB,YAAY,EAAE,IAAI;EAClB,aAAa,EAAE,sBAAsB;EACrC,oBAAoB,EAClB,wHAAwH;EAC1H,kBAAkB,EAAE,MAAM;EAC1B,kBAAkB,EAAE,IAAI;EACxB,iBAAiB,EAAE,IAAI;EACvB,oBAAoB,EAAE,KAAK;EAC3B,mBAAmB,EAAE,MAAM;EAC3B,mBAAm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