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