@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,930 @@
1
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
+ import {
3
+ ActivityIndicator,
4
+ Alert,
5
+ Animated,
6
+ Dimensions,
7
+ Easing,
8
+ FlatList,
9
+ Image,
10
+ Keyboard,
11
+ Modal,
12
+ Platform,
13
+ Pressable,
14
+ StatusBar,
15
+ StyleSheet,
16
+ Text,
17
+ TextInput,
18
+ View,
19
+ type StatusBarProps,
20
+ type StatusBarStyle,
21
+ } from 'react-native';
22
+ import { useKokoAgent } from '../provider/KokoProvider';
23
+ import { useKokoUi } from '../provider/KokoUiContext';
24
+ import { TaskStore } from '../task/TaskStore';
25
+ import type { Task, TaskNode } from '../task/types';
26
+ import { useTaskStore } from '../task/useTaskStore';
27
+ import type { MessageKey } from '../i18n';
28
+ import { useSafeAreaInsetsOptional } from './safeArea';
29
+ import { IconClose, IconStop } from './icons';
30
+
31
+ const SHEET_BG_FALLBACK = '#121316';
32
+ const DEFAULT_SHEET_HEIGHT_RATIO = 0.6;
33
+ /** Auto-growing composer: default 1 line, cap at 3. */
34
+ const INPUT_FONT_SIZE = 15;
35
+ const INPUT_LINE_HEIGHT = 22;
36
+ const INPUT_MAX_LINES = 3;
37
+ const INPUT_TEXT_MIN = INPUT_LINE_HEIGHT;
38
+ const INPUT_TEXT_MAX = INPUT_LINE_HEIGHT * INPUT_MAX_LINES;
39
+
40
+ /**
41
+ * Estimate height from text + box width.
42
+ * iOS often reports a stuck contentSize when `height` is controlled, so we
43
+ * must not rely on contentSize alone (paste / wrap would never grow).
44
+ */
45
+ function estimateComposerHeight(value: string, widthPt: number): number {
46
+ if (!value) return INPUT_TEXT_MIN;
47
+ const paragraphs = value.split('\n');
48
+ if (widthPt <= 0) {
49
+ return Math.min(
50
+ INPUT_TEXT_MAX,
51
+ Math.max(INPUT_TEXT_MIN, paragraphs.length * INPUT_LINE_HEIGHT),
52
+ );
53
+ }
54
+ // Slightly narrow so we grow a bit early rather than clip.
55
+ const charsPerLine = Math.max(4, Math.floor(widthPt / (INPUT_FONT_SIZE * 0.95)));
56
+ let lines = 0;
57
+ for (const para of paragraphs) {
58
+ const len = Math.max(1, Array.from(para).length);
59
+ lines += Math.ceil(len / charsPerLine);
60
+ }
61
+ lines = Math.min(INPUT_MAX_LINES, Math.max(1, lines));
62
+ return lines * INPUT_LINE_HEIGHT;
63
+ }
64
+
65
+
66
+ type HostStatusBarSnapshot = {
67
+ barStyle: StatusBarStyle;
68
+ backgroundColor?: string;
69
+ };
70
+
71
+ /** Read the host app's current StatusBar appearance before we override it. */
72
+ function snapshotHostStatusBar(): HostStatusBarSnapshot {
73
+ const sb = StatusBar as unknown as {
74
+ _currentValues?: {
75
+ barStyle?: { value?: StatusBarStyle };
76
+ backgroundColor?: { value?: unknown };
77
+ };
78
+ _defaultProps?: {
79
+ barStyle?: { value?: StatusBarStyle };
80
+ backgroundColor?: { value?: unknown };
81
+ };
82
+ };
83
+ const cur = sb._currentValues ?? sb._defaultProps;
84
+ return {
85
+ barStyle: cur?.barStyle?.value ?? 'default',
86
+ backgroundColor:
87
+ cur?.backgroundColor?.value != null
88
+ ? String(cur.backgroundColor.value)
89
+ : undefined,
90
+ };
91
+ }
92
+
93
+ const KIND_KEYS: Record<TaskNode['kind'], MessageKey> = {
94
+ user: 'kind.user',
95
+ plan: 'kind.plan',
96
+ dump: 'kind.dump',
97
+ find: 'kind.find',
98
+ tap: 'kind.tap',
99
+ swipe: 'kind.swipe',
100
+ type: 'kind.type',
101
+ confirm: 'kind.confirm',
102
+ info: 'kind.info',
103
+ error: 'kind.error',
104
+ };
105
+
106
+ function formatTime(ts: number): string {
107
+ const d = new Date(ts);
108
+ return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}:${String(d.getSeconds()).padStart(2, '0')}`;
109
+ }
110
+
111
+ /**
112
+ * Chat sheet: backdrop fades in first, then sheet slides down from the top.
113
+ */
114
+ export function KokoChatSheet({ placeholder }: { placeholder?: string }) {
115
+ const koko = useKokoAgent();
116
+ const { branding, t, colors } = useKokoUi();
117
+ const { tasks, ui, activeTaskId } = useTaskStore();
118
+ const insets = useSafeAreaInsetsOptional();
119
+ const [text, setText] = useState('');
120
+ const [inputHeight, setInputHeight] = useState(INPUT_TEXT_MIN);
121
+ const [inputWidth, setInputWidth] = useState(0);
122
+ const textRef = useRef('');
123
+ const [busy, setBusy] = useState(false);
124
+ const [mounted, setMounted] = useState(false);
125
+
126
+ const backdropOpacity = useRef(new Animated.Value(0)).current;
127
+ // Negative Y = off-screen above; sheet slides down from the top.
128
+ const sheetY = useRef(new Animated.Value(-Dimensions.get('window').height)).current;
129
+ const statusBarEntryRef = useRef<StatusBarProps | null>(null);
130
+ const hostStatusBarRef = useRef<HostStatusBarSnapshot | null>(null);
131
+
132
+ const primaryColor = branding.primaryColor;
133
+ const inputPlaceholder = placeholder ?? branding.placeholder;
134
+
135
+ const statusMeta = useCallback(
136
+ (status: Task['status']): { color: string; label: string } => {
137
+ switch (status) {
138
+ case 'running':
139
+ return { color: '#34D399', label: t('status.running') };
140
+ case 'success':
141
+ return { color: '#60A5FA', label: t('status.success') };
142
+ case 'failed':
143
+ return { color: '#F87171', label: t('status.failed') };
144
+ case 'cancelled':
145
+ return { color: '#A1A1AA', label: t('status.cancelled') };
146
+ default:
147
+ return { color: '#A1A1AA', label: status };
148
+ }
149
+ },
150
+ [t],
151
+ );
152
+
153
+ const applySheetStatusBar = useCallback(() => {
154
+ if (statusBarEntryRef.current) return;
155
+ // Record host app status bar before overriding (for restore / debugging).
156
+ hostStatusBarRef.current = snapshotHostStatusBar();
157
+ statusBarEntryRef.current = StatusBar.pushStackEntry({
158
+ animated: true,
159
+ barStyle: colors.statusBar,
160
+ // Colour only. On Android `translucent` is a window flag on the host
161
+ // activity, not something we paint: flipping it relayouts the whole app
162
+ // out from under the status bar and back again, which reads as the host
163
+ // flinching every time the sheet opens. The Modal already draws under
164
+ // the status bar on its own.
165
+ ...(Platform.OS === 'android' ? { backgroundColor: colors.sheetBg } : null),
166
+ });
167
+ }, [colors.sheetBg, colors.statusBar]);
168
+
169
+ const restoreHostStatusBar = useCallback(() => {
170
+ if (statusBarEntryRef.current) {
171
+ StatusBar.popStackEntry(statusBarEntryRef.current);
172
+ statusBarEntryRef.current = null;
173
+ } else if (hostStatusBarRef.current) {
174
+ // Fallback if stack entry was lost — re-apply recorded host values.
175
+ const prev = hostStatusBarRef.current;
176
+ StatusBar.setBarStyle(prev.barStyle, true);
177
+ if (Platform.OS === 'android' && prev.backgroundColor != null) {
178
+ StatusBar.setBackgroundColor(prev.backgroundColor, true);
179
+ }
180
+ }
181
+ hostStatusBarRef.current = null;
182
+ }, []);
183
+
184
+ // This sheet hangs from the top, so a keyboard never pushes it anywhere —
185
+ // it just eats the bottom of the screen where the composer lives. The only
186
+ // thing that keeps the input reachable is capping how tall the sheet may
187
+ // grow. KeyboardAvoidingView cannot express that: it assumes bottom-anchored
188
+ // content, and on Android the Modal gets its own window that the system
189
+ // never resizes for the IME, so it is a no-op there anyway.
190
+ const [keyboardHeight, setKeyboardHeight] = useState(0);
191
+ const [rootHeight, setRootHeight] = useState(0);
192
+ const [composerFocused, setComposerFocused] = useState(false);
193
+
194
+ useEffect(() => {
195
+ const ios = Platform.OS === 'ios';
196
+ const show = Keyboard.addListener(
197
+ ios ? 'keyboardWillShow' : 'keyboardDidShow',
198
+ (e) => setKeyboardHeight(e.endCoordinates.height),
199
+ );
200
+ const hide = Keyboard.addListener(
201
+ ios ? 'keyboardWillHide' : 'keyboardDidHide',
202
+ () => setKeyboardHeight(0),
203
+ );
204
+ return () => {
205
+ show.remove();
206
+ hide.remove();
207
+ };
208
+ }, []);
209
+
210
+ const selected: Task | null = useMemo(() => {
211
+ const id = ui.selectedTaskId ?? activeTaskId ?? tasks[0]?.id;
212
+ return tasks.find((t) => t.id === id) ?? null;
213
+ }, [tasks, ui.selectedTaskId, activeTaskId]);
214
+
215
+ const running =
216
+ busy || tasks.some((t) => t.id === activeTaskId && t.status === 'running');
217
+
218
+ useEffect(() => {
219
+ if (ui.sheetOpen && !ui.selectedTaskId && tasks[0]) {
220
+ TaskStore.setUi({ selectedTaskId: activeTaskId ?? tasks[0].id });
221
+ }
222
+ }, [ui.sheetOpen, ui.selectedTaskId, tasks, activeTaskId]);
223
+
224
+ const closeAnimated = useCallback(() => {
225
+ const off = -Dimensions.get('window').height;
226
+ Animated.parallel([
227
+ Animated.timing(sheetY, {
228
+ toValue: off,
229
+ duration: 260,
230
+ easing: Easing.in(Easing.cubic),
231
+ useNativeDriver: true,
232
+ }),
233
+ Animated.timing(backdropOpacity, {
234
+ toValue: 0,
235
+ duration: 220,
236
+ delay: 80,
237
+ useNativeDriver: true,
238
+ }),
239
+ ]).start(() => {
240
+ // Always clear sheetOpen — if we only close on finished=true,
241
+ // an interrupted animation leaves sheetOpen stuck true and the
242
+ // sheet can slide back open on remount / Fast Refresh.
243
+ restoreHostStatusBar();
244
+ setMounted(false);
245
+ TaskStore.closeSheet();
246
+ });
247
+ }, [backdropOpacity, sheetY, restoreHostStatusBar]);
248
+
249
+ useEffect(() => {
250
+ if (ui.sheetOpen) {
251
+ setMounted(true);
252
+ applySheetStatusBar();
253
+ sheetY.setValue(-Dimensions.get('window').height);
254
+ backdropOpacity.setValue(0);
255
+ // 1) backdrop fade 2) sheet slides down from top
256
+ Animated.sequence([
257
+ Animated.timing(backdropOpacity, {
258
+ toValue: 1,
259
+ duration: 180,
260
+ easing: Easing.out(Easing.quad),
261
+ useNativeDriver: true,
262
+ }),
263
+ Animated.timing(sheetY, {
264
+ toValue: 0,
265
+ duration: 320,
266
+ easing: Easing.out(Easing.cubic),
267
+ useNativeDriver: true,
268
+ }),
269
+ ]).start();
270
+ } else if (mounted) {
271
+ restoreHostStatusBar();
272
+ setMounted(false);
273
+ backdropOpacity.setValue(0);
274
+ sheetY.setValue(-Dimensions.get('window').height);
275
+ }
276
+ }, [ui.sheetOpen]); // eslint-disable-line react-hooks/exhaustive-deps
277
+
278
+ useEffect(() => () => restoreHostStatusBar(), [restoreHostStatusBar]);
279
+
280
+ const onSend = useCallback(async () => {
281
+ const goal = text.trim();
282
+ if (!goal || running) return;
283
+ setBusy(true);
284
+ setText('');
285
+ textRef.current = '';
286
+ setInputHeight(INPUT_TEXT_MIN);
287
+ // Drop sheet state immediately so a mid-run remount cannot reopen it.
288
+ restoreHostStatusBar();
289
+ setMounted(false);
290
+ TaskStore.closeSheet();
291
+ sheetY.setValue(-Dimensions.get('window').height);
292
+ backdropOpacity.setValue(0);
293
+ // Let host unfreeze + EmptyWallet remount before the first dump.
294
+ await new Promise((r) => setTimeout(r, 500));
295
+ try {
296
+ await koko.runGoal(goal);
297
+ } catch {
298
+ // surfaced in task log
299
+ } finally {
300
+ setBusy(false);
301
+ }
302
+ }, [
303
+ text,
304
+ running,
305
+ koko,
306
+ restoreHostStatusBar,
307
+ sheetY,
308
+ backdropOpacity,
309
+ ]);
310
+
311
+ const onStop = useCallback(() => {
312
+ koko.stop();
313
+ koko.finishTask('cancelled', t('runtime.cancelled'));
314
+ setBusy(false);
315
+ }, [koko, t]);
316
+
317
+ const confirmDeleteTask = useCallback(
318
+ (task: Task) => {
319
+ const title =
320
+ task.title.length > 36 ? `${task.title.slice(0, 36)}…` : task.title;
321
+ Alert.alert(
322
+ t('sheet.deleteTaskTitle'),
323
+ t('sheet.deleteTaskBody', { title }),
324
+ [
325
+ { text: t('dialog.cancel'), style: 'cancel' },
326
+ {
327
+ text: t('sheet.deleteTask'),
328
+ style: 'destructive',
329
+ onPress: () => {
330
+ if (task.status === 'running' && task.id === activeTaskId) {
331
+ koko.stop();
332
+ }
333
+ TaskStore.removeTask(task.id);
334
+ },
335
+ },
336
+ ],
337
+ );
338
+ },
339
+ [t, koko, activeTaskId],
340
+ );
341
+
342
+ if (!mounted && !ui.sheetOpen) return null;
343
+
344
+ const topPad = Math.max(insets.top, Platform.OS === 'ios' ? 44 : 24) + 8;
345
+
346
+ // A host whose activity runs in adjustPan never gets a keyboard frame out of
347
+ // Android, and neither does anything drawn inside a Modal's own window. Both
348
+ // are the host's call, not ours, so when the composer has focus and no frame
349
+ // arrived, assume a keyboard of typical size rather than let it swallow the
350
+ // input.
351
+ const screenH = rootHeight || Dimensions.get('window').height;
352
+ const occluded =
353
+ keyboardHeight > 0
354
+ ? keyboardHeight
355
+ : composerFocused
356
+ ? screenH * 0.45
357
+ : 0;
358
+ // Keep entry, empty and selected-task states at the same default height.
359
+ // Content scrolls inside the sheet; the keyboard may shrink, never grow it.
360
+ const defaultHeight = Math.round(screenH * DEFAULT_SHEET_HEIGHT_RATIO);
361
+ const sheetSize = {
362
+ height: occluded > 0
363
+ ? Math.min(defaultHeight, Math.max(screenH * 0.3, screenH - occluded - 8))
364
+ : defaultHeight,
365
+ };
366
+
367
+ return (
368
+ <Modal
369
+ visible={mounted || ui.sheetOpen}
370
+ animationType="none"
371
+ transparent
372
+ presentationStyle="overFullScreen"
373
+ onRequestClose={closeAnimated}
374
+ statusBarTranslucent
375
+ >
376
+ <View
377
+ testID="koko-agent-overlay"
378
+ nativeID="koko-agent-overlay"
379
+ collapsable={false}
380
+ style={styles.root}
381
+ onLayout={(e) => setRootHeight(e.nativeEvent.layout.height)}
382
+ >
383
+ {/* Full-screen dim — must stay behind the sheet; tap closes. */}
384
+ <Animated.View
385
+ pointerEvents="auto"
386
+ style={[
387
+ styles.backdrop,
388
+ { opacity: backdropOpacity, backgroundColor: colors.overlay },
389
+ ]}
390
+ >
391
+ <Pressable
392
+ style={StyleSheet.absoluteFill}
393
+ onPress={closeAnimated}
394
+ accessibilityRole="button"
395
+ accessibilityLabel={t('sheet.closeA11y')}
396
+ />
397
+ </Animated.View>
398
+
399
+ <View style={styles.sheetWrap} pointerEvents="box-none">
400
+ <Animated.View
401
+ style={[
402
+ styles.sheet,
403
+ sheetSize,
404
+ {
405
+ paddingTop: topPad,
406
+ transform: [{ translateY: sheetY }],
407
+ backgroundColor: colors.sheetBg,
408
+ borderColor: colors.border,
409
+ },
410
+ ]}
411
+ >
412
+ <View style={styles.header}>
413
+ <View style={styles.brandBlock}>
414
+ <View style={[styles.brandMark, { backgroundColor: primaryColor }]}>
415
+ {branding.iconSource ? (
416
+ <Image
417
+ source={branding.iconSource}
418
+ style={styles.brandMarkImage}
419
+ resizeMode="cover"
420
+ />
421
+ ) : (
422
+ <Text style={styles.brandMarkText}>{branding.mark}</Text>
423
+ )}
424
+ </View>
425
+ <View>
426
+ <Text style={[styles.title, { color: colors.text }]}>
427
+ {branding.name}
428
+ </Text>
429
+ <Text style={[styles.subtitle, { color: colors.textSecondary }]}>
430
+ {branding.tagline}
431
+ </Text>
432
+ </View>
433
+ </View>
434
+ <Pressable
435
+ onPress={closeAnimated}
436
+ hitSlop={12}
437
+ style={styles.closeBtn}
438
+ accessibilityRole="button"
439
+ accessibilityLabel={t('sheet.closeA11y')}
440
+ >
441
+ <IconClose size={13} color={colors.textSecondary} />
442
+ </Pressable>
443
+ </View>
444
+
445
+ <Text style={[styles.section, { color: colors.textMuted }]}>
446
+ {t('sheet.recentTasks')}
447
+ </Text>
448
+ <FlatList
449
+ horizontal
450
+ data={tasks}
451
+ keyExtractor={(t) => t.id}
452
+ style={styles.taskStrip}
453
+ contentContainerStyle={styles.taskStripContent}
454
+ showsHorizontalScrollIndicator={false}
455
+ ListEmptyComponent={
456
+ <Text style={[styles.emptyInline, { color: colors.textMuted }]}>
457
+ {t('sheet.emptyTasks')}
458
+ </Text>
459
+ }
460
+ renderItem={({ item }) => {
461
+ const selectedRow = item.id === selected?.id;
462
+ const meta = statusMeta(item.status);
463
+ return (
464
+ <Pressable
465
+ style={[
466
+ styles.taskChip,
467
+ { backgroundColor: colors.chipBg, borderColor: colors.border },
468
+ selectedRow && styles.taskChipOn,
469
+ ]}
470
+ onPress={() => TaskStore.selectTask(item.id)}
471
+ onLongPress={() => confirmDeleteTask(item)}
472
+ delayLongPress={380}
473
+ accessibilityRole="button"
474
+ accessibilityHint={t('sheet.deleteTask')}
475
+ >
476
+ <View style={[styles.dot, { backgroundColor: meta.color }]} />
477
+ <View style={styles.taskChipBody}>
478
+ <Text
479
+ style={[styles.taskChipText, { color: colors.text }]}
480
+ numberOfLines={1}
481
+ >
482
+ {item.title}
483
+ </Text>
484
+ <Text style={[styles.taskChipMeta, { color: meta.color }]}>
485
+ {meta.label}
486
+ </Text>
487
+ </View>
488
+ </Pressable>
489
+ );
490
+ }}
491
+ />
492
+
493
+ <View style={styles.sessionHead}>
494
+ <Text style={[styles.sectionTight, { color: colors.textMuted }]}>
495
+ {t('sheet.timeline')}
496
+ </Text>
497
+ {selected ? (
498
+ <Text
499
+ style={[styles.sessionHint, { color: colors.textSecondary }]}
500
+ numberOfLines={1}
501
+ >
502
+ {selected.title}
503
+ </Text>
504
+ ) : null}
505
+ </View>
506
+
507
+ <FlatList
508
+ style={styles.nodeList}
509
+ data={selected?.nodes ?? []}
510
+ keyExtractor={(n) => n.id}
511
+ contentContainerStyle={
512
+ (selected?.nodes.length ?? 0) === 0 ? styles.nodeListEmpty : undefined
513
+ }
514
+ ListEmptyComponent={
515
+ <View style={styles.emptyBlock}>
516
+ <Text style={[styles.emptyTitle, { color: colors.text }]}>
517
+ {t('sheet.emptyNodesTitle')}
518
+ </Text>
519
+ <Text style={[styles.emptyHint, { color: colors.textMuted }]}>
520
+ {t('sheet.emptyNodesHint')}
521
+ </Text>
522
+ </View>
523
+ }
524
+ renderItem={({ item, index }) => (
525
+ <View style={styles.nodeRow}>
526
+ <View style={styles.timeline}>
527
+ <View
528
+ style={[styles.timelineDot, { backgroundColor: colors.textMuted }]}
529
+ />
530
+ {index < (selected?.nodes.length ?? 1) - 1 ? (
531
+ <View
532
+ style={[styles.timelineLine, { backgroundColor: colors.border }]}
533
+ />
534
+ ) : null}
535
+ </View>
536
+ <View style={styles.nodeBody}>
537
+ <View style={styles.nodeTop}>
538
+ <Text style={[styles.nodeKind, { color: colors.textMuted }]}>
539
+ {t(KIND_KEYS[item.kind])}
540
+ </Text>
541
+ <Text style={[styles.nodeTime, { color: colors.textMuted }]}>
542
+ {formatTime(item.createdAt)}
543
+ </Text>
544
+ </View>
545
+ <Text style={[styles.nodeTitle, { color: colors.text }]}>
546
+ {item.title}
547
+ </Text>
548
+ </View>
549
+ </View>
550
+ )}
551
+ />
552
+
553
+ <View style={styles.composer}>
554
+ <View
555
+ style={[
556
+ styles.inputWrap,
557
+ { backgroundColor: colors.inputBg, borderColor: colors.border },
558
+ ]}
559
+ onLayout={(e) => {
560
+ const w = Math.round(e.nativeEvent.layout.width);
561
+ if (w > 0 && w !== inputWidth) {
562
+ setInputWidth(w);
563
+ setInputHeight(estimateComposerHeight(textRef.current, w));
564
+ }
565
+ }}
566
+ >
567
+ <TextInput
568
+ style={[
569
+ styles.input,
570
+ {
571
+ minHeight: INPUT_TEXT_MIN,
572
+ height: inputHeight,
573
+ maxHeight: INPUT_TEXT_MAX,
574
+ color: colors.text,
575
+ },
576
+ ]}
577
+ value={text}
578
+ onChangeText={(v) => {
579
+ textRef.current = v;
580
+ setText(v);
581
+ setInputHeight(estimateComposerHeight(v, inputWidth));
582
+ }}
583
+ onContentSizeChange={(e) => {
584
+ const v = textRef.current;
585
+ if (!v) {
586
+ setInputHeight(INPUT_TEXT_MIN);
587
+ return;
588
+ }
589
+ const estimated = estimateComposerHeight(v, inputWidth);
590
+ const raw = e.nativeEvent.contentSize.height;
591
+ const fromSize =
592
+ raw > INPUT_LINE_HEIGHT + 8
593
+ ? Math.min(INPUT_TEXT_MAX, Math.max(INPUT_TEXT_MIN, Math.ceil(raw)))
594
+ : INPUT_TEXT_MIN;
595
+ const next = Math.max(estimated, fromSize);
596
+ setInputHeight((prev) => (prev === next ? prev : next));
597
+ }}
598
+ placeholder={inputPlaceholder}
599
+ placeholderTextColor={colors.textMuted}
600
+ editable={!running}
601
+ multiline
602
+ scrollEnabled={inputHeight >= INPUT_TEXT_MAX - 1}
603
+ textAlignVertical="top"
604
+ blurOnSubmit={false}
605
+ onFocus={() => setComposerFocused(true)}
606
+ onBlur={() => setComposerFocused(false)}
607
+ accessibilityLabel={t('sheet.inputA11y')}
608
+ />
609
+ </View>
610
+ {running ? (
611
+ <Pressable
612
+ style={[styles.btn, styles.btnStop, styles.btnIcon]}
613
+ onPress={onStop}
614
+ accessibilityRole="button"
615
+ accessibilityLabel={t('sheet.stopA11y')}
616
+ >
617
+ <IconStop size={12} color="#fff" />
618
+ </Pressable>
619
+ ) : (
620
+ <Pressable
621
+ style={[
622
+ styles.btn,
623
+ styles.btnSend,
624
+ { backgroundColor: primaryColor },
625
+ !text.trim() && styles.btnDisabled,
626
+ ]}
627
+ onPress={onSend}
628
+ disabled={!text.trim()}
629
+ >
630
+ {busy ? (
631
+ <ActivityIndicator color="#fff" />
632
+ ) : (
633
+ <Text style={styles.btnText}>{t('sheet.send')}</Text>
634
+ )}
635
+ </Pressable>
636
+ )}
637
+ </View>
638
+
639
+ <View style={[styles.handle, { backgroundColor: colors.handle }]} />
640
+ </Animated.View>
641
+ </View>
642
+ </View>
643
+ </Modal>
644
+ );
645
+ }
646
+
647
+ const styles = StyleSheet.create({
648
+ root: {
649
+ flex: 1,
650
+ justifyContent: 'flex-start',
651
+ },
652
+ backdrop: {
653
+ ...StyleSheet.absoluteFillObject,
654
+ zIndex: 0,
655
+ },
656
+ sheetWrap: {
657
+ flex: 1,
658
+ justifyContent: 'flex-start',
659
+ zIndex: 1,
660
+ },
661
+ sheet: {
662
+ // Definite height above bounds the flexible, scrolling step list.
663
+ backgroundColor: SHEET_BG_FALLBACK,
664
+ borderBottomLeftRadius: 22,
665
+ borderBottomRightRadius: 22,
666
+ paddingHorizontal: 16,
667
+ paddingBottom: 10,
668
+ borderWidth: StyleSheet.hairlineWidth,
669
+ borderColor: 'rgba(255,255,255,0.08)',
670
+ borderTopWidth: 0,
671
+ },
672
+ handle: {
673
+ alignSelf: 'center',
674
+ width: 40,
675
+ height: 4,
676
+ borderRadius: 2,
677
+ backgroundColor: 'rgba(255,255,255,0.22)',
678
+ marginTop: 12,
679
+ },
680
+ header: {
681
+ flexDirection: 'row',
682
+ alignItems: 'center',
683
+ justifyContent: 'space-between',
684
+ marginBottom: 18,
685
+ },
686
+ brandBlock: {
687
+ flexDirection: 'row',
688
+ alignItems: 'center',
689
+ gap: 12,
690
+ flexShrink: 1,
691
+ },
692
+ brandMark: {
693
+ width: 36,
694
+ height: 36,
695
+ borderRadius: 10,
696
+ backgroundColor: '#0A84FF',
697
+ alignItems: 'center',
698
+ justifyContent: 'center',
699
+ overflow: 'hidden',
700
+ },
701
+ brandMarkImage: {
702
+ width: 36,
703
+ height: 36,
704
+ },
705
+ brandMarkText: {
706
+ color: '#fff',
707
+ fontSize: 17,
708
+ fontWeight: '800',
709
+ },
710
+ title: {
711
+ color: '#F4F4F5',
712
+ fontSize: 18,
713
+ fontWeight: '800',
714
+ letterSpacing: -0.3,
715
+ },
716
+ subtitle: {
717
+ color: 'rgba(255,255,255,0.42)',
718
+ fontSize: 12,
719
+ marginTop: 2,
720
+ },
721
+ closeBtn: {
722
+ width: 32,
723
+ height: 32,
724
+ borderRadius: 10,
725
+ backgroundColor: 'rgba(255,255,255,0.06)',
726
+ alignItems: 'center',
727
+ justifyContent: 'center',
728
+ },
729
+ section: {
730
+ color: 'rgba(255,255,255,0.38)',
731
+ fontSize: 11,
732
+ fontWeight: '700',
733
+ letterSpacing: 0.6,
734
+ textTransform: 'uppercase',
735
+ marginBottom: 10,
736
+ },
737
+ sectionTight: {
738
+ color: 'rgba(255,255,255,0.38)',
739
+ fontSize: 11,
740
+ fontWeight: '700',
741
+ letterSpacing: 0.6,
742
+ textTransform: 'uppercase',
743
+ },
744
+ taskStrip: {
745
+ maxHeight: 64,
746
+ // The sheet shrinks to fit above the keyboard; without this the strip
747
+ // gives way first and clips its chips instead of the step list scrolling.
748
+ flexGrow: 0,
749
+ flexShrink: 0,
750
+ marginBottom: 16,
751
+ },
752
+ taskStripContent: {
753
+ alignItems: 'center',
754
+ paddingRight: 8,
755
+ },
756
+ taskChip: {
757
+ flexDirection: 'row',
758
+ alignItems: 'center',
759
+ paddingHorizontal: 12,
760
+ paddingVertical: 10,
761
+ borderRadius: 14,
762
+ backgroundColor: 'rgba(255,255,255,0.05)',
763
+ marginRight: 8,
764
+ maxWidth: 200,
765
+ borderWidth: StyleSheet.hairlineWidth,
766
+ borderColor: 'rgba(255,255,255,0.06)',
767
+ },
768
+ taskChipOn: {
769
+ backgroundColor: 'rgba(10,132,255,0.18)',
770
+ borderColor: 'rgba(10,132,255,0.35)',
771
+ },
772
+ taskChipBody: {
773
+ flexShrink: 1,
774
+ },
775
+ taskChipText: {
776
+ color: '#F4F4F5',
777
+ fontSize: 13,
778
+ fontWeight: '600',
779
+ },
780
+ taskChipMeta: {
781
+ fontSize: 10,
782
+ fontWeight: '600',
783
+ marginTop: 2,
784
+ },
785
+ emptyInline: {
786
+ color: 'rgba(255,255,255,0.35)',
787
+ fontSize: 13,
788
+ paddingVertical: 12,
789
+ },
790
+ sessionHead: {
791
+ flexDirection: 'row',
792
+ alignItems: 'baseline',
793
+ justifyContent: 'space-between',
794
+ gap: 12,
795
+ marginBottom: 10,
796
+ },
797
+ sessionHint: {
798
+ flexShrink: 1,
799
+ color: 'rgba(255,255,255,0.35)',
800
+ fontSize: 12,
801
+ },
802
+ nodeList: {
803
+ flexGrow: 1,
804
+ flexShrink: 1,
805
+ minHeight: 0,
806
+ maxHeight: Math.round(Dimensions.get('window').height * 0.42),
807
+ marginBottom: 14,
808
+ },
809
+ nodeListEmpty: {
810
+ minHeight: 120,
811
+ justifyContent: 'center',
812
+ },
813
+ emptyBlock: {
814
+ alignItems: 'center',
815
+ paddingVertical: 28,
816
+ paddingHorizontal: 20,
817
+ },
818
+ emptyTitle: {
819
+ color: 'rgba(255,255,255,0.55)',
820
+ fontSize: 15,
821
+ fontWeight: '600',
822
+ marginBottom: 6,
823
+ },
824
+ emptyHint: {
825
+ color: 'rgba(255,255,255,0.32)',
826
+ fontSize: 13,
827
+ textAlign: 'center',
828
+ lineHeight: 18,
829
+ },
830
+ nodeRow: {
831
+ flexDirection: 'row',
832
+ paddingBottom: 4,
833
+ },
834
+ timeline: {
835
+ width: 16,
836
+ alignItems: 'center',
837
+ marginRight: 10,
838
+ },
839
+ timelineDot: {
840
+ width: 7,
841
+ height: 7,
842
+ borderRadius: 4,
843
+ backgroundColor: '#0A84FF',
844
+ marginTop: 5,
845
+ },
846
+ timelineLine: {
847
+ width: 1,
848
+ flex: 1,
849
+ backgroundColor: 'rgba(255,255,255,0.1)',
850
+ marginTop: 4,
851
+ marginBottom: 2,
852
+ },
853
+ nodeBody: {
854
+ flex: 1,
855
+ paddingBottom: 14,
856
+ },
857
+ nodeTop: {
858
+ flexDirection: 'row',
859
+ alignItems: 'center',
860
+ justifyContent: 'space-between',
861
+ marginBottom: 3,
862
+ },
863
+ nodeKind: {
864
+ color: '#7DD3FC',
865
+ fontSize: 10,
866
+ fontWeight: '700',
867
+ letterSpacing: 0.3,
868
+ },
869
+ nodeTime: {
870
+ color: 'rgba(255,255,255,0.28)',
871
+ fontSize: 11,
872
+ fontVariant: ['tabular-nums'],
873
+ },
874
+ nodeTitle: {
875
+ color: '#ECECF0',
876
+ fontSize: 14,
877
+ lineHeight: 20,
878
+ },
879
+ dot: {
880
+ width: 7,
881
+ height: 7,
882
+ borderRadius: 4,
883
+ marginRight: 8,
884
+ },
885
+ composer: {
886
+ flexShrink: 0,
887
+ flexDirection: 'row',
888
+ alignItems: 'flex-end',
889
+ gap: 8,
890
+ backgroundColor: 'rgba(255,255,255,0.06)',
891
+ borderRadius: 16,
892
+ paddingLeft: 14,
893
+ paddingRight: 10,
894
+ paddingVertical: 6,
895
+ borderWidth: StyleSheet.hairlineWidth,
896
+ borderColor: 'rgba(255,255,255,0.08)',
897
+ },
898
+ inputWrap: {
899
+ flex: 1,
900
+ paddingVertical: 8,
901
+ paddingHorizontal: 6,
902
+ justifyContent: 'center',
903
+ },
904
+ input: {
905
+ width: '100%',
906
+ color: '#F4F4F5',
907
+ fontSize: INPUT_FONT_SIZE,
908
+ lineHeight: INPUT_LINE_HEIGHT,
909
+ paddingHorizontal: 2,
910
+ paddingVertical: 0,
911
+ margin: 0,
912
+ },
913
+ btn: {
914
+ minWidth: 68,
915
+ paddingHorizontal: 14,
916
+ paddingVertical: 11,
917
+ borderRadius: 12,
918
+ alignItems: 'center',
919
+ justifyContent: 'center',
920
+ marginBottom: 2,
921
+ },
922
+ btnIcon: {
923
+ minWidth: 44,
924
+ paddingHorizontal: 12,
925
+ },
926
+ btnSend: { backgroundColor: '#0A84FF' },
927
+ btnStop: { backgroundColor: '#FF453A' },
928
+ btnDisabled: { opacity: 0.4 },
929
+ btnText: { color: '#fff', fontWeight: '700', fontSize: 14 },
930
+ });