@buoy-gg/ask-buoy 7.0.41 → 7.0.42

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 (313) hide show
  1. package/README.md +13 -98
  2. package/lib/commonjs/blocks/AskBlocks.js +1 -338
  3. package/lib/commonjs/blocks/BlockRenderer.js +1 -262
  4. package/lib/commonjs/blocks/ChromePrototypes.js +1 -514
  5. package/lib/commonjs/blocks/DataBlocks.js +1 -783
  6. package/lib/commonjs/blocks/ExtraBlocks.js +1 -1862
  7. package/lib/commonjs/blocks/MediaBlocks.js +1 -158
  8. package/lib/commonjs/blocks/ReceiptBlocks.js +2 -592
  9. package/lib/commonjs/blocks/blockText.js +1 -60
  10. package/lib/commonjs/blocks/blockText.test.js +1 -53
  11. package/lib/commonjs/blocks/context.js +1 -42
  12. package/lib/commonjs/blocks/icons.js +1 -96
  13. package/lib/commonjs/blocks/index.js +1 -95
  14. package/lib/commonjs/blocks/listRow.test.js +1 -55
  15. package/lib/commonjs/blocks/pageState.js +1 -34
  16. package/lib/commonjs/blocks/pageState.test.js +1 -57
  17. package/lib/commonjs/blocks/primitives.js +1 -457
  18. package/lib/commonjs/blocks/primitivesIndex.js +1 -62
  19. package/lib/commonjs/blocks/ruleStates.js +1 -39
  20. package/lib/commonjs/components/ApprovalCard.js +1 -297
  21. package/lib/commonjs/components/AskBuoyHeader.js +1 -196
  22. package/lib/commonjs/components/AskBuoyIcon.js +1 -19
  23. package/lib/commonjs/components/AskBuoyModal.js +2 -482
  24. package/lib/commonjs/components/AskBuoySettings.js +1 -181
  25. package/lib/commonjs/components/ChangesBar.js +1 -212
  26. package/lib/commonjs/components/Composer.js +1 -255
  27. package/lib/commonjs/components/EmptyState.js +1 -161
  28. package/lib/commonjs/components/KeyboardPad.js +1 -80
  29. package/lib/commonjs/components/Markdown.js +1 -310
  30. package/lib/commonjs/components/MessageList.js +1 -970
  31. package/lib/commonjs/components/QueuedMessages.js +1 -145
  32. package/lib/commonjs/components/ThinkingStrip.js +1 -223
  33. package/lib/commonjs/components/TypingDots.js +1 -63
  34. package/lib/commonjs/components/markdownParse.js +1 -131
  35. package/lib/commonjs/components/markdownParse.test.js +1 -99
  36. package/lib/commonjs/components/useCopyAction.js +1 -50
  37. package/lib/commonjs/index.js +1 -252
  38. package/lib/commonjs/preset.js +1 -91
  39. package/lib/commonjs/store/activityGroups.js +1 -110
  40. package/lib/commonjs/store/activityGroups.test.js +1 -78
  41. package/lib/commonjs/store/askBuoySettings.js +1 -72
  42. package/lib/commonjs/store/askBuoyStore.js +2 -588
  43. package/lib/commonjs/store/blockPlacement.js +1 -64
  44. package/lib/commonjs/store/blockPlacement.test.js +1 -123
  45. package/lib/commonjs/store/queue.test.js +1 -150
  46. package/lib/commonjs/store/resetConversation.js +1 -77
  47. package/lib/commonjs/store/restorePending.test.js +1 -63
  48. package/lib/commonjs/store/restoredIds.test.js +1 -47
  49. package/lib/commonjs/store/suggestions.js +1 -54
  50. package/lib/commonjs/store/suggestions.test.js +1 -58
  51. package/lib/commonjs/store/systemLine.test.js +1 -77
  52. package/lib/commonjs/store/ticketPrompt.js +1 -17
  53. package/lib/commonjs/store/traceText.js +1 -81
  54. package/lib/commonjs/store/traceText.test.js +1 -112
  55. package/lib/commonjs/store/transcriptPersistence.js +1 -297
  56. package/lib/commonjs/store/transcriptPersistence.test.js +1 -333
  57. package/lib/commonjs/store/turnRendering.test.js +1 -151
  58. package/lib/commonjs/store/useAskBuoy.js +1 -651
  59. package/lib/commonjs/store/useAskBuoySettings.js +1 -14
  60. package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -153
  61. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +1 -141
  62. package/lib/commonjs/sync/wire.js +1 -58
  63. package/lib/commonjs/types.js +1 -6
  64. package/lib/module/blocks/AskBlocks.js +1 -331
  65. package/lib/module/blocks/BlockRenderer.js +1 -257
  66. package/lib/module/blocks/ChromePrototypes.js +1 -503
  67. package/lib/module/blocks/DataBlocks.js +1 -769
  68. package/lib/module/blocks/ExtraBlocks.js +1 -1835
  69. package/lib/module/blocks/MediaBlocks.js +1 -153
  70. package/lib/module/blocks/ReceiptBlocks.js +2 -580
  71. package/lib/module/blocks/blockText.js +1 -55
  72. package/lib/module/blocks/blockText.test.js +1 -53
  73. package/lib/module/blocks/context.js +1 -35
  74. package/lib/module/blocks/icons.js +1 -91
  75. package/lib/module/blocks/index.js +1 -8
  76. package/lib/module/blocks/listRow.test.js +1 -56
  77. package/lib/module/blocks/pageState.js +1 -30
  78. package/lib/module/blocks/pageState.test.js +1 -56
  79. package/lib/module/blocks/primitives.js +1 -445
  80. package/lib/module/blocks/primitivesIndex.js +1 -5
  81. package/lib/module/blocks/ruleStates.js +1 -35
  82. package/lib/module/components/ApprovalCard.js +1 -292
  83. package/lib/module/components/AskBuoyHeader.js +1 -193
  84. package/lib/module/components/AskBuoyIcon.js +1 -8
  85. package/lib/module/components/AskBuoyModal.js +2 -477
  86. package/lib/module/components/AskBuoySettings.js +1 -176
  87. package/lib/module/components/ChangesBar.js +1 -206
  88. package/lib/module/components/Composer.js +1 -250
  89. package/lib/module/components/EmptyState.js +1 -156
  90. package/lib/module/components/KeyboardPad.js +1 -75
  91. package/lib/module/components/Markdown.js +1 -305
  92. package/lib/module/components/MessageList.js +1 -964
  93. package/lib/module/components/QueuedMessages.js +1 -140
  94. package/lib/module/components/ThinkingStrip.js +1 -218
  95. package/lib/module/components/TypingDots.js +1 -58
  96. package/lib/module/components/markdownParse.js +1 -125
  97. package/lib/module/components/markdownParse.test.js +1 -98
  98. package/lib/module/components/useCopyAction.js +1 -46
  99. package/lib/module/index.js +1 -34
  100. package/lib/module/preset.js +1 -74
  101. package/lib/module/store/activityGroups.js +1 -103
  102. package/lib/module/store/activityGroups.test.js +1 -77
  103. package/lib/module/store/askBuoySettings.js +1 -67
  104. package/lib/module/store/askBuoyStore.js +2 -582
  105. package/lib/module/store/blockPlacement.js +1 -59
  106. package/lib/module/store/blockPlacement.test.js +1 -122
  107. package/lib/module/store/queue.test.js +1 -149
  108. package/lib/module/store/resetConversation.js +1 -72
  109. package/lib/module/store/restorePending.test.js +1 -62
  110. package/lib/module/store/restoredIds.test.js +1 -46
  111. package/lib/module/store/suggestions.js +1 -49
  112. package/lib/module/store/suggestions.test.js +1 -57
  113. package/lib/module/store/systemLine.test.js +1 -76
  114. package/lib/module/store/ticketPrompt.js +1 -13
  115. package/lib/module/store/traceText.js +1 -75
  116. package/lib/module/store/traceText.test.js +1 -111
  117. package/lib/module/store/transcriptPersistence.js +1 -287
  118. package/lib/module/store/transcriptPersistence.test.js +1 -332
  119. package/lib/module/store/turnRendering.test.js +1 -150
  120. package/lib/module/store/useAskBuoy.js +1 -646
  121. package/lib/module/store/useAskBuoySettings.js +1 -9
  122. package/lib/module/sync/askBuoySyncAdapter.js +1 -148
  123. package/lib/module/sync/askBuoySyncAdapter.test.js +1 -140
  124. package/lib/module/sync/wire.js +1 -47
  125. package/lib/module/types.js +1 -4
  126. package/lib/web/index.mjs +11 -12
  127. package/package.json +8 -8
  128. package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
  129. package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
  130. package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
  131. package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
  132. package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
  133. package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
  134. package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
  135. package/lib/commonjs/blocks/blockText.js.map +0 -1
  136. package/lib/commonjs/blocks/blockText.test.js.map +0 -1
  137. package/lib/commonjs/blocks/context.js.map +0 -1
  138. package/lib/commonjs/blocks/icons.js.map +0 -1
  139. package/lib/commonjs/blocks/index.js.map +0 -1
  140. package/lib/commonjs/blocks/listRow.test.js.map +0 -1
  141. package/lib/commonjs/blocks/pageState.js.map +0 -1
  142. package/lib/commonjs/blocks/pageState.test.js.map +0 -1
  143. package/lib/commonjs/blocks/primitives.js.map +0 -1
  144. package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
  145. package/lib/commonjs/blocks/ruleStates.js.map +0 -1
  146. package/lib/commonjs/components/ApprovalCard.js.map +0 -1
  147. package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
  148. package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
  149. package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
  150. package/lib/commonjs/components/AskBuoySettings.js.map +0 -1
  151. package/lib/commonjs/components/ChangesBar.js.map +0 -1
  152. package/lib/commonjs/components/Composer.js.map +0 -1
  153. package/lib/commonjs/components/EmptyState.js.map +0 -1
  154. package/lib/commonjs/components/KeyboardPad.js.map +0 -1
  155. package/lib/commonjs/components/Markdown.js.map +0 -1
  156. package/lib/commonjs/components/MessageList.js.map +0 -1
  157. package/lib/commonjs/components/QueuedMessages.js.map +0 -1
  158. package/lib/commonjs/components/ThinkingStrip.js.map +0 -1
  159. package/lib/commonjs/components/TypingDots.js.map +0 -1
  160. package/lib/commonjs/components/markdownParse.js.map +0 -1
  161. package/lib/commonjs/components/markdownParse.test.js.map +0 -1
  162. package/lib/commonjs/components/useCopyAction.js.map +0 -1
  163. package/lib/commonjs/index.js.map +0 -1
  164. package/lib/commonjs/preset.js.map +0 -1
  165. package/lib/commonjs/store/activityGroups.js.map +0 -1
  166. package/lib/commonjs/store/activityGroups.test.js.map +0 -1
  167. package/lib/commonjs/store/askBuoySettings.js.map +0 -1
  168. package/lib/commonjs/store/askBuoyStore.js.map +0 -1
  169. package/lib/commonjs/store/blockPlacement.js.map +0 -1
  170. package/lib/commonjs/store/blockPlacement.test.js.map +0 -1
  171. package/lib/commonjs/store/queue.test.js.map +0 -1
  172. package/lib/commonjs/store/resetConversation.js.map +0 -1
  173. package/lib/commonjs/store/restorePending.test.js.map +0 -1
  174. package/lib/commonjs/store/restoredIds.test.js.map +0 -1
  175. package/lib/commonjs/store/suggestions.js.map +0 -1
  176. package/lib/commonjs/store/suggestions.test.js.map +0 -1
  177. package/lib/commonjs/store/systemLine.test.js.map +0 -1
  178. package/lib/commonjs/store/ticketPrompt.js.map +0 -1
  179. package/lib/commonjs/store/traceText.js.map +0 -1
  180. package/lib/commonjs/store/traceText.test.js.map +0 -1
  181. package/lib/commonjs/store/transcriptPersistence.js.map +0 -1
  182. package/lib/commonjs/store/transcriptPersistence.test.js.map +0 -1
  183. package/lib/commonjs/store/turnRendering.test.js.map +0 -1
  184. package/lib/commonjs/store/useAskBuoy.js.map +0 -1
  185. package/lib/commonjs/store/useAskBuoySettings.js.map +0 -1
  186. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
  187. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
  188. package/lib/commonjs/sync/wire.js.map +0 -1
  189. package/lib/commonjs/types.js.map +0 -1
  190. package/lib/module/blocks/AskBlocks.js.map +0 -1
  191. package/lib/module/blocks/BlockRenderer.js.map +0 -1
  192. package/lib/module/blocks/ChromePrototypes.js.map +0 -1
  193. package/lib/module/blocks/DataBlocks.js.map +0 -1
  194. package/lib/module/blocks/ExtraBlocks.js.map +0 -1
  195. package/lib/module/blocks/MediaBlocks.js.map +0 -1
  196. package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
  197. package/lib/module/blocks/blockText.js.map +0 -1
  198. package/lib/module/blocks/blockText.test.js.map +0 -1
  199. package/lib/module/blocks/context.js.map +0 -1
  200. package/lib/module/blocks/icons.js.map +0 -1
  201. package/lib/module/blocks/index.js.map +0 -1
  202. package/lib/module/blocks/listRow.test.js.map +0 -1
  203. package/lib/module/blocks/pageState.js.map +0 -1
  204. package/lib/module/blocks/pageState.test.js.map +0 -1
  205. package/lib/module/blocks/primitives.js.map +0 -1
  206. package/lib/module/blocks/primitivesIndex.js.map +0 -1
  207. package/lib/module/blocks/ruleStates.js.map +0 -1
  208. package/lib/module/components/ApprovalCard.js.map +0 -1
  209. package/lib/module/components/AskBuoyHeader.js.map +0 -1
  210. package/lib/module/components/AskBuoyIcon.js.map +0 -1
  211. package/lib/module/components/AskBuoyModal.js.map +0 -1
  212. package/lib/module/components/AskBuoySettings.js.map +0 -1
  213. package/lib/module/components/ChangesBar.js.map +0 -1
  214. package/lib/module/components/Composer.js.map +0 -1
  215. package/lib/module/components/EmptyState.js.map +0 -1
  216. package/lib/module/components/KeyboardPad.js.map +0 -1
  217. package/lib/module/components/Markdown.js.map +0 -1
  218. package/lib/module/components/MessageList.js.map +0 -1
  219. package/lib/module/components/QueuedMessages.js.map +0 -1
  220. package/lib/module/components/ThinkingStrip.js.map +0 -1
  221. package/lib/module/components/TypingDots.js.map +0 -1
  222. package/lib/module/components/markdownParse.js.map +0 -1
  223. package/lib/module/components/markdownParse.test.js.map +0 -1
  224. package/lib/module/components/useCopyAction.js.map +0 -1
  225. package/lib/module/index.js.map +0 -1
  226. package/lib/module/preset.js.map +0 -1
  227. package/lib/module/store/activityGroups.js.map +0 -1
  228. package/lib/module/store/activityGroups.test.js.map +0 -1
  229. package/lib/module/store/askBuoySettings.js.map +0 -1
  230. package/lib/module/store/askBuoyStore.js.map +0 -1
  231. package/lib/module/store/blockPlacement.js.map +0 -1
  232. package/lib/module/store/blockPlacement.test.js.map +0 -1
  233. package/lib/module/store/queue.test.js.map +0 -1
  234. package/lib/module/store/resetConversation.js.map +0 -1
  235. package/lib/module/store/restorePending.test.js.map +0 -1
  236. package/lib/module/store/restoredIds.test.js.map +0 -1
  237. package/lib/module/store/suggestions.js.map +0 -1
  238. package/lib/module/store/suggestions.test.js.map +0 -1
  239. package/lib/module/store/systemLine.test.js.map +0 -1
  240. package/lib/module/store/ticketPrompt.js.map +0 -1
  241. package/lib/module/store/traceText.js.map +0 -1
  242. package/lib/module/store/traceText.test.js.map +0 -1
  243. package/lib/module/store/transcriptPersistence.js.map +0 -1
  244. package/lib/module/store/transcriptPersistence.test.js.map +0 -1
  245. package/lib/module/store/turnRendering.test.js.map +0 -1
  246. package/lib/module/store/useAskBuoy.js.map +0 -1
  247. package/lib/module/store/useAskBuoySettings.js.map +0 -1
  248. package/lib/module/sync/askBuoySyncAdapter.js.map +0 -1
  249. package/lib/module/sync/askBuoySyncAdapter.test.js.map +0 -1
  250. package/lib/module/sync/wire.js.map +0 -1
  251. package/lib/module/types.js.map +0 -1
  252. package/lib/typescript/blocks/AskBlocks.d.ts.map +0 -1
  253. package/lib/typescript/blocks/BlockRenderer.d.ts.map +0 -1
  254. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +0 -1
  255. package/lib/typescript/blocks/DataBlocks.d.ts.map +0 -1
  256. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +0 -1
  257. package/lib/typescript/blocks/MediaBlocks.d.ts.map +0 -1
  258. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +0 -1
  259. package/lib/typescript/blocks/blockText.d.ts.map +0 -1
  260. package/lib/typescript/blocks/blockText.test.d.ts.map +0 -1
  261. package/lib/typescript/blocks/context.d.ts.map +0 -1
  262. package/lib/typescript/blocks/icons.d.ts.map +0 -1
  263. package/lib/typescript/blocks/index.d.ts.map +0 -1
  264. package/lib/typescript/blocks/listRow.test.d.ts.map +0 -1
  265. package/lib/typescript/blocks/pageState.d.ts.map +0 -1
  266. package/lib/typescript/blocks/pageState.test.d.ts.map +0 -1
  267. package/lib/typescript/blocks/primitives.d.ts.map +0 -1
  268. package/lib/typescript/blocks/primitivesIndex.d.ts.map +0 -1
  269. package/lib/typescript/blocks/ruleStates.d.ts.map +0 -1
  270. package/lib/typescript/components/ApprovalCard.d.ts.map +0 -1
  271. package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
  272. package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
  273. package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
  274. package/lib/typescript/components/AskBuoySettings.d.ts.map +0 -1
  275. package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
  276. package/lib/typescript/components/Composer.d.ts.map +0 -1
  277. package/lib/typescript/components/EmptyState.d.ts.map +0 -1
  278. package/lib/typescript/components/KeyboardPad.d.ts.map +0 -1
  279. package/lib/typescript/components/Markdown.d.ts.map +0 -1
  280. package/lib/typescript/components/MessageList.d.ts.map +0 -1
  281. package/lib/typescript/components/QueuedMessages.d.ts.map +0 -1
  282. package/lib/typescript/components/ThinkingStrip.d.ts.map +0 -1
  283. package/lib/typescript/components/TypingDots.d.ts.map +0 -1
  284. package/lib/typescript/components/markdownParse.d.ts.map +0 -1
  285. package/lib/typescript/components/markdownParse.test.d.ts.map +0 -1
  286. package/lib/typescript/components/useCopyAction.d.ts.map +0 -1
  287. package/lib/typescript/index.d.ts.map +0 -1
  288. package/lib/typescript/preset.d.ts.map +0 -1
  289. package/lib/typescript/store/activityGroups.d.ts.map +0 -1
  290. package/lib/typescript/store/activityGroups.test.d.ts.map +0 -1
  291. package/lib/typescript/store/askBuoySettings.d.ts.map +0 -1
  292. package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
  293. package/lib/typescript/store/blockPlacement.d.ts.map +0 -1
  294. package/lib/typescript/store/blockPlacement.test.d.ts.map +0 -1
  295. package/lib/typescript/store/queue.test.d.ts.map +0 -1
  296. package/lib/typescript/store/resetConversation.d.ts.map +0 -1
  297. package/lib/typescript/store/restorePending.test.d.ts.map +0 -1
  298. package/lib/typescript/store/restoredIds.test.d.ts.map +0 -1
  299. package/lib/typescript/store/suggestions.d.ts.map +0 -1
  300. package/lib/typescript/store/suggestions.test.d.ts.map +0 -1
  301. package/lib/typescript/store/systemLine.test.d.ts.map +0 -1
  302. package/lib/typescript/store/ticketPrompt.d.ts.map +0 -1
  303. package/lib/typescript/store/traceText.d.ts.map +0 -1
  304. package/lib/typescript/store/traceText.test.d.ts.map +0 -1
  305. package/lib/typescript/store/transcriptPersistence.d.ts.map +0 -1
  306. package/lib/typescript/store/transcriptPersistence.test.d.ts.map +0 -1
  307. package/lib/typescript/store/turnRendering.test.d.ts.map +0 -1
  308. package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
  309. package/lib/typescript/store/useAskBuoySettings.d.ts.map +0 -1
  310. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
  311. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
  312. package/lib/typescript/sync/wire.d.ts.map +0 -1
  313. package/lib/typescript/types.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,112 +1,27 @@
1
- # @buoy-gg/ask-buoy
1
+ <div align="center">
2
2
 
3
- Ask Buoy adds an AI chat to your React Native app. It can inspect and act through installed Buoy tools, subject to your policy and each tool’s integration.
3
+ # @buoy-gg/ask-buoy
4
4
 
5
- For example, a tester can ask it to simulate a failed checkout request when Network overrides are configured. It reports the actions it took and exposes available undo operations. Some changes cannot be undone.
5
+ An AI chat inside your React Native app. It can inspect and act through your installed Buoy tools, subject to your policy and each tool's integration.
6
6
 
7
- You configure the model endpoint and authentication. Requests go from the app to that endpoint. Use an authenticated gateway that validates the caller and keeps provider secrets on the server.
7
+ <a href="https://buoy.gg/buoy/latest/docs/tools/ask-buoy"><b>Ask Buoy guide</b></a> &nbsp;·&nbsp; <a href="https://buoy.gg">buoy.gg</a> &nbsp;·&nbsp; <a href="https://github.com/Buoy-gg/buoy">All tools</a>
8
8
 
9
- ## Setup
9
+ [![npm version](https://img.shields.io/npm/v/@buoy-gg/ask-buoy?style=flat-square&labelColor=10302a&color=2a9d78)](https://www.npmjs.com/package/@buoy-gg/ask-buoy) [![npm downloads](https://img.shields.io/npm/dm/@buoy-gg/ask-buoy?style=flat-square&labelColor=10302a&color=2a9d78&label=downloads%2Fmonth)](https://www.npmjs.com/package/@buoy-gg/ask-buoy)
10
10
 
11
- ```bash
12
- npm install @buoy-gg/core @buoy-gg/ask-buoy
13
- ```
11
+ <a href="https://buoy.gg/buoy/latest/docs/tools/ask-buoy"><img src="https://raw.githubusercontent.com/Buoy-gg/buoy/main/.github/readme/tools/ask-buoy.png" alt="Watch the Ask Buoy film on buoy.gg" width="640" /></a>
14
12
 
15
- ## Account and configuration
13
+ </div>
16
14
 
17
- Ask Buoy requires Pro access. Use a development build with `@buoy-gg/core` and configure your Buoy account key. From your app’s directory, sign in:
15
+ ## Install
18
16
 
19
17
  ```bash
20
- npx --package=@buoy-gg/core buoy login
21
- ```
22
-
23
- For Expo, initialize Buoy before rendering the menu:
24
-
25
- ```tsx
26
- import { Buoy } from "@buoy-gg/core";
27
-
28
- Buoy.init({ licenseKey: process.env.EXPO_PUBLIC_BUOY_KEY });
29
- ```
30
-
31
- The login command writes the Expo key to `.env.local`. For React Native CLI, pass the key from your app’s environment configuration; React Native does not load `.env.local` automatically. Mount `FloatingDevTools` inside the same providers as your screens and restart the development server after installation. The [Quick Start](https://buoy.gg/buoy/latest/docs/quick-start) shows the complete root component setup.
32
-
33
- This configuration fragment uses your existing `auth.getToken()` implementation. Your gateway must validate that token. Replace the endpoint and model with values your gateway supports.
34
-
35
- ```tsx
36
- import { FloatingDevTools } from "@buoy-gg/core";
37
-
38
- <FloatingDevTools
39
- askBuoy={{
40
- endpoint: "https://ai.acme.com/v1/messages",
41
- protocol: "anthropic", // or "openai" — Azure, Gemini-compat, most gateways
42
- model: "YOUR_MODEL_ID",
43
-
44
- // Called before every request, so short-lived tokens work.
45
- headers: async () => ({
46
- Authorization: `Bearer ${await auth.getToken()}`,
47
- }),
48
- }}
49
- />
50
- ```
51
-
52
- Open Ask Buoy and ask it to read a known captured request. Confirm that it reports the actual request before trying a write. Available actions depend on installed tools and policy. Start with `policy: { readOnly: true }` in the `askBuoy` configuration if you want to validate reads first.
53
-
54
- Keep package versions compatible with their declared peer dependencies, especially `@buoy-gg/license`. Check package-manager peer warnings when upgrading.
55
-
56
- ### Teach it your data
57
-
58
- Buoy discovers routes, query keys, store names and storage keys by watching the app run, and reads the item shape of every non-empty list it can see — what it can't know is what any of that *means*, or the shape of a collection that is currently empty.
59
-
60
- Add `context` inside the `askBuoy` configuration. For example:
61
-
62
- ```tsx
63
- const context = {
64
- notes: ["Prices are integer cents everywhere. `/api/*` ids are prefixed — ord_, usr_, itm_."],
65
- types: { CartLine: "{ lineId: string; itemId: string; qty: number; unitPrice: number }" },
66
- };
18
+ npm install @buoy-gg/core @buoy-gg/ask-buoy
67
19
  ```
68
20
 
69
- The docs carry a prompt you can paste into a coding agent to draft both from your repo.
70
-
71
- Tasks that aren't guessable from the app — *"reproduce the pricing glitch"*, *"put this account in the expired state"* — go in `context.procedures`: an `id`, a one-line `summary` (the only part in every prompt), and a `body` with the steps, loaded when a request matches. A tester types **"run the expired-subscription check"** and the agent opens the playbook first instead of asking what that means. A procedure guides; it grants nothing.
72
-
73
- ## Permissions and verification
74
-
75
- The changes bar lists undoable and permanent changes. Supported storage and query-cache writes capture the prior value for undo. Changes without a captured prior value are marked permanent.
76
-
77
- Destructive actions require approval by default. Configure `policy` to require more approvals, allow or deny actions, limit steps, or enable read-only access. An approval note is passed to the model. **Allow for this chat** waives approval for that action during the conversation; it does not override read-only mode, deny rules, or release restrictions. Review or revoke these waivers in Settings.
78
-
79
- Supported writes have outcome checks. The activity row reports **Verified**, **Done · not yet visible**, or **Done · check failed**. Inspect the affected screen or state when a result is unverified. Actions requiring development hooks are refused in release builds.
80
-
81
- Credential redaction uses field names and value patterns. SecureStore values require `policy.secureReads`. Review the data your tools expose; redaction cannot establish that arbitrary app data is safe to send to a model.
82
-
83
- ## Sessions and debugging
84
-
85
- - Saved sessions can restore the transcript, agent memory, and pending approvals. Set `persistTranscript: false` to disable transcript persistence. Saved transcripts omit tool results.
86
- - Large, redacted results remain in memory for the conversation. The agent can retrieve fields or sections omitted from the model’s initial result. This evidence store is not persisted across restarts.
87
- - Eligible rate-limit and overload responses are retried when no output was generated. Oversized requests can trim history and retry. The sheet reports retry activity.
88
- - Answers can include tables, choices, diffs, images, receipts, and approval cards. Messages sent during a turn queue for later processing.
89
- - **Settings → Chat → Show agent thinking** exposes available reasoning and step payloads, results, timing, and token counts. Inspect the result as well as the step status when diagnosing a failed action.
90
- - A ticket summary can collect steps, expected and observed behavior, build information, and available evidence without running new actions.
91
-
92
- ## Desktop and custom integrations
93
-
94
- Desktop can mirror the conversation and expose supported remote undo. There is no remote composer. Mirroring requires external sync and account admission; your app still controls authorization.
95
-
96
- Custom tools need a sync adapter and a `ToolDescriptor` passed through `tools`. They use the same parameter validation and policy checks as built-in actions.
97
-
98
- Use `onEvent` to observe tool calls, outcome checks, approvals, retries, errors, and token usage. Each `done` event includes a `stopReason`.
99
-
100
- ## Docs
101
-
102
- For gateway requirements, model configuration, data sent to the model, and policy options, see **[buoy.gg/docs/tools/ask-buoy](https://buoy.gg/buoy/latest/docs/tools/ask-buoy)**
103
-
104
- The headless engine (catalog, providers, turn loop, effect ledger, blocks) lives in [`@buoy-gg/agent-core`](https://www.npmjs.com/package/@buoy-gg/agent-core).
105
-
106
- ## License
21
+ Ask Buoy requires Pro and a model endpoint you configure, passed to `<FloatingDevTools />` through the `askBuoy` prop. It reports the actions it takes and offers undo where it can; some changes can't be undone.
107
22
 
108
- Ask Buoy requires a [Buoy Pro licence](https://buoy.gg/pricing). See [buoy.gg](https://buoy.gg) for licensing.
23
+ The [Ask Buoy guide](https://buoy.gg/buoy/latest/docs/tools/ask-buoy) covers setup, what it captures and its limits. New to Buoy? Start with the [Quick start](https://buoy.gg/buoy/latest/docs/quick-start).
109
24
 
110
- ## Web support (unreleased)
25
+ ---
111
26
 
112
- Register this package’s /web namespace in FloatingDevTools modules to use its shared panels and actions in a browser app. The browser build is available in this checkout and has not been published yet. See the [web setup guide](https://buoy.gg/buoy/latest/docs/web-preview) for registration, dependencies, and browser boundaries.
27
+ <sub>Part of <a href="https://buoy.gg">Buoy</a>, developer tools that live inside your app. Proprietary software. © Buoy LLC. <a href="https://buoy.gg/terms">Terms</a></sub>
@@ -1,338 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Choice = Choice;
7
- exports.Confirm = Confirm;
8
- exports.Input = Input;
9
- var _react = require("react");
10
- var _reactNative = require("react-native");
11
- var _sharedUi = require("@buoy-gg/shared-ui");
12
- var _context = require("./context");
13
- var _icons = require("./icons");
14
- var _primitives = require("./primitives");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- /**
17
- * Ask blocks — the user has to decide, and the turn is waiting.
18
- *
19
- * Choice, Confirm and Input all lock once answered: the chosen option stays
20
- * highlighted, the rest dim, and nothing in history is tappable twice. The
21
- * answer is handed to the sheet as a BlockAnswer and becomes the next user
22
- * message, so the model reads plain words ("Business checkout"), never JSON.
23
- */
24
-
25
- function Choice({
26
- block
27
- }) {
28
- const h = (0, _context.useBlockHandlers)();
29
- const answer = h.answered[block.id];
30
- const chosen = answer?.kind === "choice" ? answer.optionId : null;
31
- const locked = !!answer;
32
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
33
- testID: `buoy-block-choice-${block.id}`,
34
- tone: locked ? undefined : "info",
35
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
36
- style: styles.question,
37
- children: block.question
38
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
39
- style: styles.options,
40
- children: block.options.slice(0, 5).map((o, i) => {
41
- const isChosen = chosen === o.id;
42
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
43
- testID: `buoy-block-option-${o.id}`,
44
- accessibilityRole: "button",
45
- accessibilityState: {
46
- selected: isChosen,
47
- disabled: locked
48
- },
49
- disabled: locked,
50
- onPress: () => h.answer({
51
- blockId: block.id,
52
- kind: "choice",
53
- optionId: o.id,
54
- label: o.label
55
- }),
56
- style: ({
57
- pressed
58
- }) => [styles.option, i > 0 && styles.optionDivider, isChosen && styles.optionChosen, locked && !isChosen && styles.optionDimmed, pressed && !locked && styles.pressed],
59
- children: [o.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.BlockIcon, {
60
- name: o.icon
61
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
62
- style: styles.optionText,
63
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
64
- style: [styles.optionLabel, isChosen && styles.optionLabelChosen],
65
- children: o.label
66
- }), o.detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
67
- style: styles.optionDetail,
68
- children: o.detail
69
- }) : null]
70
- }), isChosen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Check, {
71
- size: 14,
72
- color: _sharedUi.night.color.accent
73
- }) : locked ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronRight, {
74
- size: 14,
75
- color: _sharedUi.night.color.textTertiary
76
- })]
77
- }, o.id);
78
- })
79
- }), !locked && block.allowFreeText !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
80
- style: styles.hint,
81
- children: "Or just type your answer below."
82
- }) : null]
83
- });
84
- }
85
- function Confirm({
86
- block
87
- }) {
88
- const h = (0, _context.useBlockHandlers)();
89
- const answer = h.answered[block.id];
90
- const locked = !!answer;
91
- const approved = answer?.kind === "confirm" ? answer.approved : null;
92
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
93
- testID: `buoy-block-confirm-${block.id}`,
94
- tone: locked ? undefined : "warning",
95
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
96
- style: styles.confirmTitle,
97
- children: block.title
98
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
99
- style: styles.confirmChange,
100
- children: block.change
101
- }), block.consequence ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
102
- style: styles.confirmConsequence,
103
- children: block.consequence
104
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
105
- style: styles.confirmActions,
106
- children: locked ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
107
- style: styles.decided,
108
- children: approved ? `✓ ${block.approveLabel ?? "Done"}` : `✕ ${block.declineLabel ?? "Not now"}`
109
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
110
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
111
- testID: "buoy-block-approve",
112
- accessibilityRole: "button",
113
- onPress: () => h.answer({
114
- blockId: block.id,
115
- kind: "confirm",
116
- approved: true
117
- }),
118
- style: ({
119
- pressed
120
- }) => [styles.button, styles.buttonPrimary, pressed && styles.pressed],
121
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
122
- style: styles.buttonTextPrimary,
123
- children: block.approveLabel ?? "Do it"
124
- })
125
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
126
- testID: "buoy-block-decline",
127
- accessibilityRole: "button",
128
- onPress: () => h.answer({
129
- blockId: block.id,
130
- kind: "confirm",
131
- approved: false
132
- }),
133
- style: ({
134
- pressed
135
- }) => [styles.button, styles.buttonPlate, pressed && styles.pressed],
136
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
137
- style: styles.buttonTextPlate,
138
- children: block.declineLabel ?? "Not now"
139
- })
140
- })]
141
- })
142
- })]
143
- });
144
- }
145
- function Input({
146
- block
147
- }) {
148
- const h = (0, _context.useBlockHandlers)();
149
- const answer = h.answered[block.id];
150
- const locked = !!answer;
151
- const [value, setValue] = (0, _react.useState)("");
152
- const secret = block.type === "secret";
153
- const submit = () => {
154
- const v = value.trim();
155
- if (!v) return;
156
- h.answer({
157
- blockId: block.id,
158
- kind: "input",
159
- value: v
160
- });
161
- };
162
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
163
- testID: `buoy-block-input-${block.id}`,
164
- tone: locked ? undefined : "info",
165
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
166
- style: styles.question,
167
- children: block.label
168
- }), locked ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
169
- style: styles.decided,
170
- children: answer.kind === "input" ? secret ? "••••••" : answer.value : "(skipped)"
171
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
172
- style: styles.inputRow,
173
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
174
- testID: "buoy-block-input-field",
175
- style: styles.input,
176
- value: value,
177
- onChangeText: setValue,
178
- placeholder: block.placeholder ?? "",
179
- placeholderTextColor: _sharedUi.night.color.placeholder,
180
- keyboardType: block.type === "number" ? "numeric" : "ascii-capable",
181
- secureTextEntry: secret,
182
- autoCapitalize: "none",
183
- autoCorrect: false,
184
- returnKeyType: "send",
185
- onSubmitEditing: submit
186
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
187
- testID: "buoy-block-input-submit",
188
- accessibilityRole: "button",
189
- disabled: !value.trim(),
190
- onPress: submit,
191
- style: ({
192
- pressed
193
- }) => [styles.button, styles.buttonPrimary, !value.trim() && styles.buttonDisabled, pressed && styles.pressed],
194
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
195
- style: styles.buttonTextPrimary,
196
- children: block.submitLabel ?? "Send"
197
- })
198
- })]
199
- })]
200
- });
201
- }
202
- const styles = _reactNative.StyleSheet.create({
203
- question: {
204
- color: _sharedUi.night.color.text,
205
- fontSize: _sharedUi.night.font.row,
206
- fontWeight: "600",
207
- lineHeight: 20,
208
- paddingHorizontal: 12,
209
- paddingTop: 12,
210
- paddingBottom: 8
211
- },
212
- options: {
213
- marginHorizontal: 8,
214
- marginBottom: 8,
215
- borderRadius: _sharedUi.night.radius.row,
216
- backgroundColor: _sharedUi.night.color.surfaceElevated,
217
- overflow: "hidden"
218
- },
219
- option: {
220
- flexDirection: "row",
221
- alignItems: "center",
222
- gap: 10,
223
- paddingHorizontal: 12,
224
- paddingVertical: 11
225
- },
226
- optionDivider: {
227
- borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
228
- borderTopColor: _sharedUi.night.color.separator
229
- },
230
- optionChosen: {
231
- backgroundColor: _sharedUi.night.color.accentSoft
232
- },
233
- optionDimmed: {
234
- opacity: 0.45
235
- },
236
- optionText: {
237
- flex: 1,
238
- gap: 2
239
- },
240
- optionLabel: {
241
- color: _sharedUi.night.color.text,
242
- fontSize: _sharedUi.night.font.body,
243
- fontWeight: "500"
244
- },
245
- optionLabelChosen: {
246
- color: _sharedUi.night.color.accent
247
- },
248
- optionDetail: {
249
- color: _sharedUi.night.color.textSecondary,
250
- fontSize: _sharedUi.night.font.caption,
251
- lineHeight: 17
252
- },
253
- hint: {
254
- color: _sharedUi.night.color.textTertiary,
255
- fontSize: _sharedUi.night.font.micro,
256
- paddingHorizontal: 12,
257
- paddingBottom: 10
258
- },
259
- confirmTitle: {
260
- color: _sharedUi.night.color.text,
261
- fontSize: _sharedUi.night.font.row,
262
- fontWeight: "600",
263
- paddingHorizontal: 12,
264
- paddingTop: 12
265
- },
266
- confirmChange: {
267
- color: _sharedUi.night.color.text,
268
- fontSize: _sharedUi.night.font.body,
269
- lineHeight: 19,
270
- paddingHorizontal: 12,
271
- paddingTop: 6
272
- },
273
- confirmConsequence: {
274
- color: _sharedUi.night.color.warning,
275
- fontSize: _sharedUi.night.font.caption,
276
- lineHeight: 17,
277
- paddingHorizontal: 12,
278
- paddingTop: 6
279
- },
280
- confirmActions: {
281
- flexDirection: "row",
282
- gap: 8,
283
- paddingHorizontal: 12,
284
- paddingVertical: 12,
285
- alignItems: "center"
286
- },
287
- decided: {
288
- color: _sharedUi.night.color.textSecondary,
289
- fontSize: _sharedUi.night.font.caption,
290
- fontWeight: "600",
291
- paddingHorizontal: 12,
292
- paddingVertical: 10
293
- },
294
- inputRow: {
295
- flexDirection: "row",
296
- alignItems: "center",
297
- gap: 8,
298
- paddingHorizontal: 12,
299
- paddingBottom: 12
300
- },
301
- input: {
302
- flex: 1,
303
- height: 38,
304
- paddingHorizontal: 12,
305
- borderRadius: _sharedUi.night.radius.row,
306
- backgroundColor: _sharedUi.night.color.surfaceElevated,
307
- color: _sharedUi.night.color.text,
308
- fontSize: _sharedUi.night.font.body
309
- },
310
- button: {
311
- paddingHorizontal: 14,
312
- paddingVertical: 9,
313
- borderRadius: _sharedUi.night.radius.row
314
- },
315
- buttonPrimary: {
316
- backgroundColor: _sharedUi.night.color.accent
317
- },
318
- buttonPlate: {
319
- backgroundColor: _sharedUi.night.color.button
320
- },
321
- buttonDisabled: {
322
- opacity: 0.5
323
- },
324
- buttonTextPrimary: {
325
- color: _sharedUi.night.color.onAccent,
326
- fontSize: _sharedUi.night.font.caption,
327
- fontWeight: "600"
328
- },
329
- buttonTextPlate: {
330
- color: _sharedUi.night.color.text,
331
- fontSize: _sharedUi.night.font.caption,
332
- fontWeight: "600"
333
- },
334
- pressed: {
335
- opacity: 0.7
336
- }
337
- });
338
- //# sourceMappingURL=AskBlocks.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Choice=Choice;exports.Confirm=Confirm;exports.Input=Input;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _context=require("./context");var _icons=require("./icons");var _primitives=require("./primitives");var _jsxRuntime=require("react/jsx-runtime");function Choice({block:e}){const i=(0,_context.useBlockHandlers)();const n=i.answered[e.id];const l=n?.kind==="choice"?n.optionId:null;const o=!!n;return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-choice-${e.id}`,tone:o?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.question}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.options,children:e.options.slice(0,5).map((t,a)=>{const r=l===t.id;return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{testID:`buoy-block-option-${t.id}`,accessibilityRole:"button",accessibilityState:{selected:r,disabled:o},disabled:o,onPress:()=>i.answer({blockId:e.id,kind:"choice",optionId:t.id,label:t.label}),style:({pressed:s})=>[styles.option,a>0&&styles.optionDivider,r&&styles.optionChosen,o&&!r&&styles.optionDimmed,s&&!o&&styles.pressed],children:[t.icon?(0,_jsxRuntime.jsx)(_icons.BlockIcon,{name:t.icon}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.optionText,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.optionLabel,r&&styles.optionLabelChosen],children:t.label}),t.detail?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.optionDetail,children:t.detail}):null]}),r?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:14,color:_sharedUi.night.color.accent}):o?null:(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:14,color:_sharedUi.night.color.textTertiary})]},t.id)})}),!o&&e.allowFreeText!==false?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hint,children:"Or just type your answer below."}):null]})}function Confirm({block:e}){const i=(0,_context.useBlockHandlers)();const n=i.answered[e.id];const l=!!n;const o=n?.kind==="confirm"?n.approved:null;return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-confirm-${e.id}`,tone:l?void 0:"warning",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.confirmTitle,children:e.title}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.confirmChange,children:e.change}),e.consequence?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.confirmConsequence,children:e.consequence}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.confirmActions,children:l?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:o?`\u2713 ${e.approveLabel??"Done"}`:`\u2715 ${e.declineLabel??"Not now"}`}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-block-approve",accessibilityRole:"button",onPress:()=>i.answer({blockId:e.id,kind:"confirm",approved:true}),style:({pressed:t})=>[styles.button,styles.buttonPrimary,t&&styles.pressed],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:e.approveLabel??"Do it"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-block-decline",accessibilityRole:"button",onPress:()=>i.answer({blockId:e.id,kind:"confirm",approved:false}),style:({pressed:t})=>[styles.button,styles.buttonPlate,t&&styles.pressed],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPlate,children:e.declineLabel??"Not now"})})]})})]})}function Input({block:e}){const i=(0,_context.useBlockHandlers)();const n=i.answered[e.id];const l=!!n;const[o,t]=(0,_react.useState)("");const a=e.type==="secret";const r=()=>{const s=o.trim();if(!s)return;i.answer({blockId:e.id,kind:"input",value:s})};return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-input-${e.id}`,tone:l?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.label}),l?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:n.kind==="input"?a?"\u2022\u2022\u2022\u2022\u2022\u2022":n.value:"(skipped)"}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.inputRow,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{testID:"buoy-block-input-field",style:styles.input,value:o,onChangeText:t,placeholder:e.placeholder??"",placeholderTextColor:_sharedUi.night.color.placeholder,keyboardType:e.type==="number"?"numeric":"ascii-capable",secureTextEntry:a,autoCapitalize:"none",autoCorrect:false,returnKeyType:"send",onSubmitEditing:r}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-block-input-submit",accessibilityRole:"button",disabled:!o.trim(),onPress:r,style:({pressed:s})=>[styles.button,styles.buttonPrimary,!o.trim()&&styles.buttonDisabled,s&&styles.pressed],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:e.submitLabel??"Send"})})]})]})}const styles=_reactNative.StyleSheet.create({question:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600",lineHeight:20,paddingHorizontal:12,paddingTop:12,paddingBottom:8},options:{marginHorizontal:8,marginBottom:8,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surfaceElevated,overflow:"hidden"},option:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:11},optionDivider:{borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:_sharedUi.night.color.separator},optionChosen:{backgroundColor:_sharedUi.night.color.accentSoft},optionDimmed:{opacity:.45},optionText:{flex:1,gap:2},optionLabel:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body,fontWeight:"500"},optionLabelChosen:{color:_sharedUi.night.color.accent},optionDetail:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:17},hint:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,paddingHorizontal:12,paddingBottom:10},confirmTitle:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600",paddingHorizontal:12,paddingTop:12},confirmChange:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body,lineHeight:19,paddingHorizontal:12,paddingTop:6},confirmConsequence:{color:_sharedUi.night.color.warning,fontSize:_sharedUi.night.font.caption,lineHeight:17,paddingHorizontal:12,paddingTop:6},confirmActions:{flexDirection:"row",gap:8,paddingHorizontal:12,paddingVertical:12,alignItems:"center"},decided:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontWeight:"600",paddingHorizontal:12,paddingVertical:10},inputRow:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingBottom:12},input:{flex:1,height:38,paddingHorizontal:12,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surfaceElevated,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body},button:{paddingHorizontal:14,paddingVertical:9,borderRadius:_sharedUi.night.radius.row},buttonPrimary:{backgroundColor:_sharedUi.night.color.accent},buttonPlate:{backgroundColor:_sharedUi.night.color.button},buttonDisabled:{opacity:.5},buttonTextPrimary:{color:_sharedUi.night.color.onAccent,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},buttonTextPlate:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},pressed:{opacity:.7}});