@buoy-gg/ask-buoy 7.0.36 → 7.0.38

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 (312) hide show
  1. package/README.md +58 -27
  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 -781
  6. package/lib/commonjs/blocks/ExtraBlocks.js +1 -1860
  7. package/lib/commonjs/blocks/MediaBlocks.js +1 -156
  8. package/lib/commonjs/blocks/ReceiptBlocks.js +1 -586
  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/components/ApprovalCard.js +1 -244
  20. package/lib/commonjs/components/AskBuoyHeader.js +1 -196
  21. package/lib/commonjs/components/AskBuoyIcon.js +1 -19
  22. package/lib/commonjs/components/AskBuoyModal.js +1 -479
  23. package/lib/commonjs/components/AskBuoySettings.js +1 -119
  24. package/lib/commonjs/components/ChangesBar.js +1 -211
  25. package/lib/commonjs/components/Composer.js +1 -255
  26. package/lib/commonjs/components/EmptyState.js +1 -161
  27. package/lib/commonjs/components/KeyboardPad.js +1 -80
  28. package/lib/commonjs/components/Markdown.js +1 -310
  29. package/lib/commonjs/components/MessageList.js +1 -930
  30. package/lib/commonjs/components/QueuedMessages.js +1 -145
  31. package/lib/commonjs/components/ThinkingStrip.js +1 -223
  32. package/lib/commonjs/components/TypingDots.js +1 -63
  33. package/lib/commonjs/components/markdownParse.js +1 -131
  34. package/lib/commonjs/components/markdownParse.test.js +1 -99
  35. package/lib/commonjs/components/useCopyAction.js +1 -50
  36. package/lib/commonjs/index.js +1 -252
  37. package/lib/commonjs/preset.js +1 -90
  38. package/lib/commonjs/store/activityGroups.js +1 -110
  39. package/lib/commonjs/store/activityGroups.test.js +1 -78
  40. package/lib/commonjs/store/askBuoySettings.js +1 -72
  41. package/lib/commonjs/store/askBuoyStore.js +1 -547
  42. package/lib/commonjs/store/blockPlacement.js +1 -64
  43. package/lib/commonjs/store/blockPlacement.test.js +1 -123
  44. package/lib/commonjs/store/queue.test.js +1 -150
  45. package/lib/commonjs/store/resetConversation.js +1 -77
  46. package/lib/commonjs/store/restorePending.test.js +1 -63
  47. package/lib/commonjs/store/restoredIds.test.js +1 -47
  48. package/lib/commonjs/store/suggestions.js +1 -54
  49. package/lib/commonjs/store/suggestions.test.js +1 -58
  50. package/lib/commonjs/store/systemLine.test.js +1 -77
  51. package/lib/commonjs/store/ticketPrompt.js +1 -17
  52. package/lib/commonjs/store/traceText.js +1 -81
  53. package/lib/commonjs/store/traceText.test.js +1 -112
  54. package/lib/commonjs/store/transcriptPersistence.js +1 -297
  55. package/lib/commonjs/store/transcriptPersistence.test.js +1 -333
  56. package/lib/commonjs/store/turnRendering.test.js +1 -151
  57. package/lib/commonjs/store/useAskBuoy.js +1 -622
  58. package/lib/commonjs/store/useAskBuoySettings.js +1 -14
  59. package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -140
  60. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +1 -141
  61. package/lib/commonjs/sync/wire.js +1 -58
  62. package/lib/commonjs/types.js +1 -6
  63. package/lib/module/blocks/AskBlocks.js +1 -331
  64. package/lib/module/blocks/BlockRenderer.js +1 -257
  65. package/lib/module/blocks/ChromePrototypes.js +1 -503
  66. package/lib/module/blocks/DataBlocks.js +1 -767
  67. package/lib/module/blocks/ExtraBlocks.js +1 -1833
  68. package/lib/module/blocks/MediaBlocks.js +1 -151
  69. package/lib/module/blocks/ReceiptBlocks.js +1 -574
  70. package/lib/module/blocks/blockText.js +1 -55
  71. package/lib/module/blocks/blockText.test.js +1 -53
  72. package/lib/module/blocks/context.js +1 -35
  73. package/lib/module/blocks/icons.js +1 -91
  74. package/lib/module/blocks/index.js +1 -8
  75. package/lib/module/blocks/listRow.test.js +1 -56
  76. package/lib/module/blocks/pageState.js +1 -30
  77. package/lib/module/blocks/pageState.test.js +1 -56
  78. package/lib/module/blocks/primitives.js +1 -445
  79. package/lib/module/blocks/primitivesIndex.js +1 -5
  80. package/lib/module/components/ApprovalCard.js +1 -239
  81. package/lib/module/components/AskBuoyHeader.js +1 -193
  82. package/lib/module/components/AskBuoyIcon.js +1 -8
  83. package/lib/module/components/AskBuoyModal.js +1 -474
  84. package/lib/module/components/AskBuoySettings.js +1 -114
  85. package/lib/module/components/ChangesBar.js +1 -206
  86. package/lib/module/components/Composer.js +1 -250
  87. package/lib/module/components/EmptyState.js +1 -156
  88. package/lib/module/components/KeyboardPad.js +1 -75
  89. package/lib/module/components/Markdown.js +1 -305
  90. package/lib/module/components/MessageList.js +1 -924
  91. package/lib/module/components/QueuedMessages.js +1 -140
  92. package/lib/module/components/ThinkingStrip.js +1 -218
  93. package/lib/module/components/TypingDots.js +1 -58
  94. package/lib/module/components/markdownParse.js +1 -125
  95. package/lib/module/components/markdownParse.test.js +1 -98
  96. package/lib/module/components/useCopyAction.js +1 -46
  97. package/lib/module/index.js +1 -34
  98. package/lib/module/preset.js +1 -73
  99. package/lib/module/store/activityGroups.js +1 -103
  100. package/lib/module/store/activityGroups.test.js +1 -77
  101. package/lib/module/store/askBuoySettings.js +1 -67
  102. package/lib/module/store/askBuoyStore.js +1 -541
  103. package/lib/module/store/blockPlacement.js +1 -59
  104. package/lib/module/store/blockPlacement.test.js +1 -122
  105. package/lib/module/store/queue.test.js +1 -149
  106. package/lib/module/store/resetConversation.js +1 -72
  107. package/lib/module/store/restorePending.test.js +1 -62
  108. package/lib/module/store/restoredIds.test.js +1 -46
  109. package/lib/module/store/suggestions.js +1 -49
  110. package/lib/module/store/suggestions.test.js +1 -57
  111. package/lib/module/store/systemLine.test.js +1 -76
  112. package/lib/module/store/ticketPrompt.js +1 -13
  113. package/lib/module/store/traceText.js +1 -75
  114. package/lib/module/store/traceText.test.js +1 -111
  115. package/lib/module/store/transcriptPersistence.js +1 -287
  116. package/lib/module/store/transcriptPersistence.test.js +1 -332
  117. package/lib/module/store/turnRendering.test.js +1 -150
  118. package/lib/module/store/useAskBuoy.js +1 -616
  119. package/lib/module/store/useAskBuoySettings.js +1 -9
  120. package/lib/module/sync/askBuoySyncAdapter.js +1 -135
  121. package/lib/module/sync/askBuoySyncAdapter.test.js +1 -140
  122. package/lib/module/sync/wire.js +1 -47
  123. package/lib/module/types.js +1 -4
  124. package/lib/typescript/components/ApprovalCard.d.ts +9 -1
  125. package/lib/typescript/preset.d.ts +4 -2
  126. package/lib/typescript/store/askBuoyStore.d.ts +32 -4
  127. package/lib/typescript/store/useAskBuoy.d.ts +3 -2
  128. package/lib/typescript/sync/askBuoySyncAdapter.d.ts +3 -0
  129. package/package.json +9 -9
  130. package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
  131. package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
  132. package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
  133. package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
  134. package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
  135. package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
  136. package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
  137. package/lib/commonjs/blocks/blockText.js.map +0 -1
  138. package/lib/commonjs/blocks/blockText.test.js.map +0 -1
  139. package/lib/commonjs/blocks/context.js.map +0 -1
  140. package/lib/commonjs/blocks/icons.js.map +0 -1
  141. package/lib/commonjs/blocks/index.js.map +0 -1
  142. package/lib/commonjs/blocks/listRow.test.js.map +0 -1
  143. package/lib/commonjs/blocks/pageState.js.map +0 -1
  144. package/lib/commonjs/blocks/pageState.test.js.map +0 -1
  145. package/lib/commonjs/blocks/primitives.js.map +0 -1
  146. package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
  147. package/lib/commonjs/components/ApprovalCard.js.map +0 -1
  148. package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
  149. package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
  150. package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
  151. package/lib/commonjs/components/AskBuoySettings.js.map +0 -1
  152. package/lib/commonjs/components/ChangesBar.js.map +0 -1
  153. package/lib/commonjs/components/Composer.js.map +0 -1
  154. package/lib/commonjs/components/EmptyState.js.map +0 -1
  155. package/lib/commonjs/components/KeyboardPad.js.map +0 -1
  156. package/lib/commonjs/components/Markdown.js.map +0 -1
  157. package/lib/commonjs/components/MessageList.js.map +0 -1
  158. package/lib/commonjs/components/QueuedMessages.js.map +0 -1
  159. package/lib/commonjs/components/ThinkingStrip.js.map +0 -1
  160. package/lib/commonjs/components/TypingDots.js.map +0 -1
  161. package/lib/commonjs/components/markdownParse.js.map +0 -1
  162. package/lib/commonjs/components/markdownParse.test.js.map +0 -1
  163. package/lib/commonjs/components/useCopyAction.js.map +0 -1
  164. package/lib/commonjs/index.js.map +0 -1
  165. package/lib/commonjs/preset.js.map +0 -1
  166. package/lib/commonjs/store/activityGroups.js.map +0 -1
  167. package/lib/commonjs/store/activityGroups.test.js.map +0 -1
  168. package/lib/commonjs/store/askBuoySettings.js.map +0 -1
  169. package/lib/commonjs/store/askBuoyStore.js.map +0 -1
  170. package/lib/commonjs/store/blockPlacement.js.map +0 -1
  171. package/lib/commonjs/store/blockPlacement.test.js.map +0 -1
  172. package/lib/commonjs/store/queue.test.js.map +0 -1
  173. package/lib/commonjs/store/resetConversation.js.map +0 -1
  174. package/lib/commonjs/store/restorePending.test.js.map +0 -1
  175. package/lib/commonjs/store/restoredIds.test.js.map +0 -1
  176. package/lib/commonjs/store/suggestions.js.map +0 -1
  177. package/lib/commonjs/store/suggestions.test.js.map +0 -1
  178. package/lib/commonjs/store/systemLine.test.js.map +0 -1
  179. package/lib/commonjs/store/ticketPrompt.js.map +0 -1
  180. package/lib/commonjs/store/traceText.js.map +0 -1
  181. package/lib/commonjs/store/traceText.test.js.map +0 -1
  182. package/lib/commonjs/store/transcriptPersistence.js.map +0 -1
  183. package/lib/commonjs/store/transcriptPersistence.test.js.map +0 -1
  184. package/lib/commonjs/store/turnRendering.test.js.map +0 -1
  185. package/lib/commonjs/store/useAskBuoy.js.map +0 -1
  186. package/lib/commonjs/store/useAskBuoySettings.js.map +0 -1
  187. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
  188. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
  189. package/lib/commonjs/sync/wire.js.map +0 -1
  190. package/lib/commonjs/types.js.map +0 -1
  191. package/lib/module/blocks/AskBlocks.js.map +0 -1
  192. package/lib/module/blocks/BlockRenderer.js.map +0 -1
  193. package/lib/module/blocks/ChromePrototypes.js.map +0 -1
  194. package/lib/module/blocks/DataBlocks.js.map +0 -1
  195. package/lib/module/blocks/ExtraBlocks.js.map +0 -1
  196. package/lib/module/blocks/MediaBlocks.js.map +0 -1
  197. package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
  198. package/lib/module/blocks/blockText.js.map +0 -1
  199. package/lib/module/blocks/blockText.test.js.map +0 -1
  200. package/lib/module/blocks/context.js.map +0 -1
  201. package/lib/module/blocks/icons.js.map +0 -1
  202. package/lib/module/blocks/index.js.map +0 -1
  203. package/lib/module/blocks/listRow.test.js.map +0 -1
  204. package/lib/module/blocks/pageState.js.map +0 -1
  205. package/lib/module/blocks/pageState.test.js.map +0 -1
  206. package/lib/module/blocks/primitives.js.map +0 -1
  207. package/lib/module/blocks/primitivesIndex.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/components/ApprovalCard.d.ts.map +0 -1
  270. package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
  271. package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
  272. package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
  273. package/lib/typescript/components/AskBuoySettings.d.ts.map +0 -1
  274. package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
  275. package/lib/typescript/components/Composer.d.ts.map +0 -1
  276. package/lib/typescript/components/EmptyState.d.ts.map +0 -1
  277. package/lib/typescript/components/KeyboardPad.d.ts.map +0 -1
  278. package/lib/typescript/components/Markdown.d.ts.map +0 -1
  279. package/lib/typescript/components/MessageList.d.ts.map +0 -1
  280. package/lib/typescript/components/QueuedMessages.d.ts.map +0 -1
  281. package/lib/typescript/components/ThinkingStrip.d.ts.map +0 -1
  282. package/lib/typescript/components/TypingDots.d.ts.map +0 -1
  283. package/lib/typescript/components/markdownParse.d.ts.map +0 -1
  284. package/lib/typescript/components/markdownParse.test.d.ts.map +0 -1
  285. package/lib/typescript/components/useCopyAction.d.ts.map +0 -1
  286. package/lib/typescript/index.d.ts.map +0 -1
  287. package/lib/typescript/preset.d.ts.map +0 -1
  288. package/lib/typescript/store/activityGroups.d.ts.map +0 -1
  289. package/lib/typescript/store/activityGroups.test.d.ts.map +0 -1
  290. package/lib/typescript/store/askBuoySettings.d.ts.map +0 -1
  291. package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
  292. package/lib/typescript/store/blockPlacement.d.ts.map +0 -1
  293. package/lib/typescript/store/blockPlacement.test.d.ts.map +0 -1
  294. package/lib/typescript/store/queue.test.d.ts.map +0 -1
  295. package/lib/typescript/store/resetConversation.d.ts.map +0 -1
  296. package/lib/typescript/store/restorePending.test.d.ts.map +0 -1
  297. package/lib/typescript/store/restoredIds.test.d.ts.map +0 -1
  298. package/lib/typescript/store/suggestions.d.ts.map +0 -1
  299. package/lib/typescript/store/suggestions.test.d.ts.map +0 -1
  300. package/lib/typescript/store/systemLine.test.d.ts.map +0 -1
  301. package/lib/typescript/store/ticketPrompt.d.ts.map +0 -1
  302. package/lib/typescript/store/traceText.d.ts.map +0 -1
  303. package/lib/typescript/store/traceText.test.d.ts.map +0 -1
  304. package/lib/typescript/store/transcriptPersistence.d.ts.map +0 -1
  305. package/lib/typescript/store/transcriptPersistence.test.d.ts.map +0 -1
  306. package/lib/typescript/store/turnRendering.test.d.ts.map +0 -1
  307. package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
  308. package/lib/typescript/store/useAskBuoySettings.d.ts.map +0 -1
  309. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
  310. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
  311. package/lib/typescript/sync/wire.d.ts.map +0 -1
  312. package/lib/typescript/types.d.ts.map +0 -1
@@ -1,244 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ApprovalCard = ApprovalCard;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * The approval prompt, shown only when the policy asks for a tap.
13
- *
14
- * It renders the EFFECT, not the payload. That is the whole design constraint:
15
- * every other agent product assumes a developer is reading the proposed
16
- * command before approving it, and the people this tool is for cannot evaluate
17
- * `redux_dispatch({type:'SET_ENTITLEMENTS', payload:{…}})`. An approval prompt
18
- * nobody can read is not oversight — it is a rubber stamp that looks like
19
- * oversight, which is worse than having no prompt at all.
20
- *
21
- * WHICH IS WHY THE DETAIL IS COLLAPSED. The card sits between the message list
22
- * and the composer, so its height is taken out of the transcript rather than
23
- * scrolled: a card taller than the sheet pushes its own buttons off the bottom
24
- * with nothing to scroll them back. That is what happened — `description` is
25
- * the catalog summary, written for the MODEL, and zustand's runs to a
26
- * twenty-line paragraph about merge semantics. A prompt you physically cannot
27
- * answer is the worst failure mode this component has.
28
- *
29
- * So the visible card is fixed-height by construction — the title, the effect
30
- * in one line, the consequence in one line, a disclosure, and the buttons —
31
- * and the long text lives behind the disclosure inside a capped scroll box, so
32
- * expanding it can never push the buttons away again either.
33
- */
34
-
35
- function ApprovalCard({
36
- pending,
37
- onAnswer
38
- }) {
39
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
40
- style: styles.card,
41
- testID: "buoy-ask-buoy-approval",
42
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
43
- style: styles.titleRow,
44
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.AlertTriangle, {
45
- size: 14,
46
- color: _sharedUi.night.color.warning
47
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
48
- style: styles.title,
49
- children: "Allow this change?"
50
- })]
51
- }), pending.restored ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
52
- style: styles.restored,
53
- testID: "buoy-ask-buoy-approval-restored",
54
- children: "Asked before the app restarted \u2014 check it still applies."
55
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
56
- style: styles.label,
57
- children: pending.label
58
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
59
- style: styles.reason,
60
- children: pending.reason
61
- }), pending.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ApprovalDetails, {
62
- text: pending.description
63
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
64
- style: styles.actions,
65
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
66
- testID: "buoy-ask-buoy-approve",
67
- accessibilityRole: "button",
68
- onPress: () => onAnswer(true),
69
- style: ({
70
- pressed
71
- }) => [styles.button, styles.approve, pressed && styles.pressed],
72
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
73
- style: styles.approveText,
74
- children: "Allow"
75
- })
76
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
77
- testID: "buoy-ask-buoy-reject",
78
- accessibilityRole: "button",
79
- onPress: () => onAnswer(false),
80
- style: ({
81
- pressed
82
- }) => [styles.button, styles.reject, pressed && styles.pressed],
83
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
84
- style: styles.rejectText,
85
- children: "Not now"
86
- })
87
- })]
88
- })]
89
- });
90
- }
91
-
92
- /**
93
- * The catalog's own description, behind a disclosure, closed by default.
94
- *
95
- * Owns its open state rather than taking it as a prop: nothing above the card
96
- * needs to know, and answering the prompt unmounts the whole thing anyway.
97
- * One ChevronDown rotated in place, not a swap between two icon components —
98
- * the tree keeps its shape whichever way it is pointing.
99
- */
100
- function ApprovalDetails({
101
- text
102
- }) {
103
- const [open, setOpen] = (0, _react.useState)(false);
104
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
105
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
106
- testID: "buoy-ask-buoy-approval-details",
107
- accessibilityRole: "button",
108
- accessibilityState: {
109
- expanded: open
110
- },
111
- onPress: () => setOpen(prev => !prev),
112
- style: ({
113
- pressed
114
- }) => [styles.disclosure, pressed && styles.pressed],
115
- hitSlop: 6,
116
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
117
- style: open ? styles.chevronOpen : styles.chevronClosed,
118
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
119
- size: 12,
120
- color: _sharedUi.night.color.textTertiary
121
- })
122
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
123
- style: styles.disclosureText,
124
- children: open ? "Hide details" : "Details"
125
- })]
126
- }), open ?
127
- /*#__PURE__*/
128
- // Capped and scrollable: the text behind this is unbounded, and the
129
- // buttons below must stay on screen whatever it says.
130
- (0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
131
- style: styles.detail,
132
- contentContainerStyle: styles.detailContent,
133
- nestedScrollEnabled: true,
134
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
135
- style: styles.description,
136
- children: text
137
- })
138
- }) : null]
139
- });
140
- }
141
- const styles = _reactNative.StyleSheet.create({
142
- card: {
143
- marginHorizontal: _sharedUi.night.gutter,
144
- marginBottom: 10,
145
- padding: _sharedUi.night.cardPad,
146
- borderRadius: _sharedUi.night.radius.card,
147
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
148
- borderColor: _sharedUi.night.color.accentBorderStrong,
149
- backgroundColor: _sharedUi.night.color.surface,
150
- gap: 6
151
- },
152
- titleRow: {
153
- flexDirection: "row",
154
- alignItems: "center",
155
- gap: 6
156
- },
157
- title: {
158
- color: _sharedUi.night.color.text,
159
- fontSize: _sharedUi.night.font.caption,
160
- fontWeight: "600"
161
- },
162
- label: {
163
- color: _sharedUi.night.color.text,
164
- fontSize: _sharedUi.night.font.row,
165
- fontWeight: "600",
166
- lineHeight: 20
167
- },
168
- description: {
169
- color: _sharedUi.night.color.textSecondary,
170
- fontSize: _sharedUi.night.font.caption,
171
- lineHeight: 18
172
- },
173
- reason: {
174
- color: _sharedUi.night.color.warning,
175
- fontSize: _sharedUi.night.font.caption,
176
- lineHeight: 18
177
- },
178
- restored: {
179
- color: _sharedUi.night.color.info,
180
- backgroundColor: _sharedUi.night.color.infoSoft,
181
- fontSize: _sharedUi.night.font.micro,
182
- lineHeight: 16,
183
- paddingHorizontal: 8,
184
- paddingVertical: 5,
185
- borderRadius: 8
186
- },
187
- disclosure: {
188
- flexDirection: "row",
189
- alignItems: "center",
190
- gap: 4,
191
- paddingVertical: 4
192
- },
193
- disclosureText: {
194
- color: _sharedUi.night.color.textTertiary,
195
- fontSize: _sharedUi.night.font.micro,
196
- fontWeight: "600"
197
- },
198
- chevronOpen: {
199
- transform: [{
200
- rotate: "0deg"
201
- }]
202
- },
203
- chevronClosed: {
204
- transform: [{
205
- rotate: "-90deg"
206
- }]
207
- },
208
- detail: {
209
- maxHeight: 150,
210
- marginTop: 2
211
- },
212
- detailContent: {
213
- paddingBottom: 2
214
- },
215
- actions: {
216
- flexDirection: "row",
217
- gap: 8,
218
- marginTop: 6
219
- },
220
- button: {
221
- paddingHorizontal: 16,
222
- paddingVertical: 9,
223
- borderRadius: _sharedUi.night.radius.row
224
- },
225
- approve: {
226
- backgroundColor: _sharedUi.night.color.accent
227
- },
228
- approveText: {
229
- color: _sharedUi.night.color.onAccent,
230
- fontWeight: "600",
231
- fontSize: _sharedUi.night.font.caption
232
- },
233
- reject: {
234
- backgroundColor: _sharedUi.night.color.button
235
- },
236
- rejectText: {
237
- color: _sharedUi.night.color.text,
238
- fontSize: _sharedUi.night.font.caption
239
- },
240
- pressed: {
241
- opacity: 0.7
242
- }
243
- });
244
- //# sourceMappingURL=ApprovalCard.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApprovalCard=ApprovalCard;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_jsxRuntime=require("react/jsx-runtime");function ApprovalCard({pending:e,onAnswer:t}){const[r,i]=(0,_react.useState)("");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:"buoy-ask-buoy-approval",children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.titleRow,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:14,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,children:"Allow this change?"})]}),e.restored?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.restored,testID:"buoy-ask-buoy-approval-restored",children:"Asked before the app restarted — check it still applies."}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.label,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reason,children:e.reason}),e.description?(0,_jsxRuntime.jsx)(ApprovalDetails,{text:e.description}):null,(0,_jsxRuntime.jsx)(_reactNative.TextInput,{testID:"buoy-ask-buoy-approval-note",value:r,onChangeText:i,placeholder:"Add a note for the agent (optional)",placeholderTextColor:_sharedUi.night.color.textTertiary,style:styles.note,returnKeyType:"done",blurOnSubmit:!0}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actions,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-ask-buoy-approve",accessibilityRole:"button",onPress:()=>t({approved:!0,reason:r}),style:({pressed:e})=>[styles.button,styles.approve,e&&styles.pressed],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.approveText,children:"Allow"})}),e.restored?null:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-ask-buoy-approve-trust",accessibilityRole:"button",onPress:()=>t({approved:!0,reason:r,trust:!0}),style:({pressed:e})=>[styles.button,styles.trust,e&&styles.pressed],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.trustText,children:"Allow for this chat"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-ask-buoy-reject",accessibilityRole:"button",onPress:()=>t({approved:!1,reason:r}),style:({pressed:e})=>[styles.button,styles.reject,e&&styles.pressed],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rejectText,children:"Not now"})})]})]})}function ApprovalDetails({text:e}){const[t,r]=(0,_react.useState)(!1);return(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{testID:"buoy-ask-buoy-approval-details",accessibilityRole:"button",accessibilityState:{expanded:t},onPress:()=>r(e=>!e),style:({pressed:e})=>[styles.disclosure,e&&styles.pressed],hitSlop:6,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:t?styles.chevronOpen:styles.chevronClosed,children:(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:12,color:_sharedUi.night.color.textTertiary})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disclosureText,children:t?"Hide details":"Details"})]}),t?(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.detail,contentContainerStyle:styles.detailContent,nestedScrollEnabled:!0,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.description,children:e})}):null]})}const styles=_reactNative.StyleSheet.create({card:{marginHorizontal:_sharedUi.night.gutter,marginBottom:10,padding:_sharedUi.night.cardPad,borderRadius:_sharedUi.night.radius.card,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.accentBorderStrong,backgroundColor:_sharedUi.night.color.surface,gap:6},titleRow:{flexDirection:"row",alignItems:"center",gap:6},title:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},label:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600",lineHeight:20},description:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:18},reason:{color:_sharedUi.night.color.warning,fontSize:_sharedUi.night.font.caption,lineHeight:18},restored:{color:_sharedUi.night.color.info,backgroundColor:_sharedUi.night.color.infoSoft,fontSize:_sharedUi.night.font.micro,lineHeight:16,paddingHorizontal:8,paddingVertical:5,borderRadius:8},disclosure:{flexDirection:"row",alignItems:"center",gap:4,paddingVertical:4},disclosureText:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,fontWeight:"600"},chevronOpen:{transform:[{rotate:"0deg"}]},chevronClosed:{transform:[{rotate:"-90deg"}]},detail:{maxHeight:150,marginTop:2},detailContent:{paddingBottom:2},note:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,paddingHorizontal:10,paddingVertical:7,borderRadius:_sharedUi.night.radius.row,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.button,marginTop:2},actions:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},button:{paddingHorizontal:16,paddingVertical:9,borderRadius:_sharedUi.night.radius.row},approve:{backgroundColor:_sharedUi.night.color.accent},approveText:{color:_sharedUi.night.color.onAccent,fontWeight:"600",fontSize:_sharedUi.night.font.caption},trust:{backgroundColor:_sharedUi.night.color.button,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.accentBorderStrong},trustText:{color:_sharedUi.night.color.accent,fontWeight:"600",fontSize:_sharedUi.night.font.caption},reject:{backgroundColor:_sharedUi.night.color.button},rejectText:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption},pressed:{opacity:.7}});
@@ -1,196 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.AskBuoyHeader = AskBuoyHeader;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _useCopyAction = require("./useCopyAction");
11
- var _activityGroups = require("../store/activityGroups");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- /**
14
- * The sheet header.
15
- *
16
- * Built on the shared `ModalHeader` so it matches Console, Network and Events
17
- * 1:1 — the stock JsModal header was designed for a single centred title and
18
- * paints its "Double tap: Toggle • Triple tap: Close" hint through the middle
19
- * of it, which is how "Ask Buoy" ended up overprinted by grey italics.
20
- *
21
- * The subtitle is the one piece of live status the sheet has: what the agent
22
- * is doing right now, in words a tester can act on. "Thinking…" while a
23
- * response is streaming with no tool in flight, the current tool's title
24
- * while one runs, and the reachable tool count at rest so a "why can't it
25
- * see my network calls" question has an answer in the header.
26
- *
27
- * "New conversation" moved up here from a 11pt text link under the composer.
28
- * A reset that lives under the keyboard is a reset nobody finds. Copy sits
29
- * beside it for the same reason: the transcript actions under the newest
30
- * answer are only reachable once you have scrolled back down to it.
31
- */
32
-
33
- /**
34
- * Slower than the sprite's default 140ms.
35
- *
36
- * This mascot is ambient status a user stares at for the length of a turn,
37
- * not a moment of delight they glance at once — at the stock tick it read as
38
- * fidgeting in the corner of the eye while you were trying to read the
39
- * answer next to it. Every other placement keeps the default.
40
- */const HEADER_TICK_MS = 200;
41
-
42
- /** No conversation to copy — the button is left out rather than left dead. */
43
- const NO_TRANSCRIPT = () => "";
44
- function AskBuoyHeader({
45
- configured,
46
- busy,
47
- failed = false,
48
- activeLabel,
49
- awaitingApproval = false,
50
- startedAt = null,
51
- stopping = false,
52
- readOnly = false,
53
- toolCount,
54
- hasMessages,
55
- onBack,
56
- onReset,
57
- getTranscript,
58
- onOpenSettings,
59
- onTicket
60
- }) {
61
- const {
62
- copied,
63
- copy
64
- } = (0, _useCopyAction.useCopyAction)(getTranscript ?? NO_TRANSCRIPT);
65
-
66
- /**
67
- * ONE mascot state per turn, held to the end of it.
68
- *
69
- * `activeLabel` drops to null in the gap between two tool calls, so deriving
70
- * the state from it directly flipped robot → thinking → robot on every
71
- * boundary. A turn that runs four tools swapped the sprite eight times in
72
- * about three seconds — a strobe that reads as a glitch, not as progress.
73
- * So the robot latches: once this turn has driven a tool it stays `robot`
74
- * until the turn ends, which is also the honest summary of that turn.
75
- *
76
- * The SUBTITLE still tracks each call, because updating a line of text is
77
- * informative where restarting an animation is just noise.
78
- */
79
- const [droveTool, setDroveTool] = (0, _react.useState)(false);
80
- (0, _react.useEffect)(() => {
81
- if (!busy) setDroveTool(false);else if (activeLabel) setDroveTool(true);
82
- }, [busy, activeLabel]);
83
-
84
- /**
85
- * The elapsed clock. Ticks only while a turn is running and not parked on
86
- * the user (nothing is elapsing while an approval card waits for a tap).
87
- */
88
- const ticking = busy && !awaitingApproval && startedAt !== null;
89
- const [now, setNow] = (0, _react.useState)(() => Date.now());
90
- (0, _react.useEffect)(() => {
91
- if (!ticking) return;
92
- setNow(Date.now());
93
- const timer = setInterval(() => setNow(Date.now()), 1000);
94
- return () => clearInterval(timer);
95
- }, [ticking]);
96
- const elapsed = ticking && startedAt !== null ? (0, _activityGroups.formatElapsed)(now - startedAt) : null;
97
-
98
- /**
99
- * Otto mirrors the subtitle, never contradicts it. This is the one place in
100
- * the product where a mascot earns continuous presence: the user is waiting
101
- * on a machine and the header is the only thing reporting on it.
102
- *
103
- * `robot` while a tool runs is literal — the agent IS driving the tools.
104
- */
105
- const otto = !configured ? "confused" : failed ? "error" : busy ? activeLabel || droveTool ? "robot" : "thinking" : "idle";
106
- const working = stopping ? "Stopping" : activeLabel ?? "Thinking";
107
- const subtitle = !configured ? "Not set up in this app" : awaitingApproval ? "Waiting for you" : busy ? elapsed ? `${working} · ${elapsed}` : `${working}…` : readOnly ? `Read only${toolCount > 0 ? ` · ${toolCount} tool${toolCount === 1 ? "" : "s"}` : ""}` : toolCount > 0 ? `Ready · ${toolCount} tool${toolCount === 1 ? "" : "s"} available` : "Ready";
108
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader, {
109
- children: [onBack ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation, {
110
- onBack: onBack
111
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
112
- style: styles.otto,
113
- testID: "buoy-ask-buoy-otto",
114
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Otto, {
115
- state: otto,
116
- pixelSize: 2,
117
- tickMs: HEADER_TICK_MS,
118
- water: false
119
- })
120
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Content, {
121
- title: "Ask Buoy",
122
- subtitle: subtitle,
123
- testID: "buoy-ask-buoy-title"
124
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions, {
125
- children: [onTicket ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
126
- testID: "buoy-ask-buoy-ticket",
127
- accessibilityRole: "button",
128
- accessibilityLabel: "Summarize for a ticket",
129
- disabled: !hasMessages || busy,
130
- onPress: onTicket,
131
- style: [styles.actionBtn, (!hasMessages || busy) && styles.actionBtnDisabled],
132
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.FileText, {
133
- size: 14,
134
- color: hasMessages && !busy ? _sharedUi.night.color.textSecondary : _sharedUi.night.color.textTertiary
135
- })
136
- }) : null, getTranscript ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
137
- testID: "buoy-ask-buoy-copy-chat",
138
- accessibilityRole: "button",
139
- accessibilityLabel: copied ? "Conversation copied" : "Copy conversation",
140
- disabled: !hasMessages,
141
- onPress: copy,
142
- style: [styles.actionBtn, !hasMessages && styles.actionBtnDisabled],
143
- children: copied ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Check, {
144
- size: 14,
145
- color: _sharedUi.night.color.accent
146
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Copy, {
147
- size: 14,
148
- color: hasMessages ? _sharedUi.night.color.textSecondary : _sharedUi.night.color.textTertiary
149
- })
150
- }) : null, onOpenSettings ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
151
- testID: "buoy-ask-buoy-settings",
152
- accessibilityRole: "button",
153
- accessibilityLabel: "Settings",
154
- onPress: onOpenSettings,
155
- style: styles.actionBtn,
156
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.SettingsSolid, {
157
- size: 14,
158
- color: _sharedUi.night.color.textSecondary
159
- })
160
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
161
- testID: "buoy-ask-buoy-reset",
162
- accessibilityRole: "button",
163
- accessibilityLabel: "New conversation",
164
- disabled: !hasMessages,
165
- onPress: onReset,
166
- style: [styles.actionBtn, !hasMessages && styles.actionBtnDisabled],
167
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Plus, {
168
- size: 14,
169
- color: hasMessages ? _sharedUi.night.color.textSecondary : _sharedUi.night.color.textTertiary
170
- })
171
- })]
172
- })]
173
- });
174
- }
175
- const styles = _reactNative.StyleSheet.create({
176
- // 32pt of Otto (16 grid × 2pt) reading as the header's status glyph.
177
- otto: {
178
- marginRight: 8,
179
- justifyContent: "center"
180
- },
181
- // Same plate as the Console header's action buttons.
182
- actionBtn: {
183
- width: 32,
184
- height: 32,
185
- borderRadius: 8,
186
- backgroundColor: _sharedUi.night.color.buttonSurface,
187
- borderWidth: 1,
188
- borderColor: _sharedUi.night.color.border,
189
- alignItems: "center",
190
- justifyContent: "center"
191
- },
192
- actionBtnDisabled: {
193
- opacity: 0.55
194
- }
195
- });
196
- //# sourceMappingURL=AskBuoyHeader.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AskBuoyHeader=AskBuoyHeader;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_useCopyAction=require("./useCopyAction"),_activityGroups=require("../store/activityGroups"),_jsxRuntime=require("react/jsx-runtime");const HEADER_TICK_MS=200,NO_TRANSCRIPT=()=>"";function AskBuoyHeader({configured:e,busy:t,failed:i=!1,activeLabel:s,awaitingApproval:o=!1,startedAt:a=null,stopping:r=!1,readOnly:n=!1,toolCount:c,hasMessages:l,onBack:u,onReset:d,getTranscript:y,onOpenSettings:_,onTicket:h}){const{copied:b,copy:x}=(0,_useCopyAction.useCopyAction)(y??NO_TRANSCRIPT),[j,p]=(0,_react.useState)(!1);(0,_react.useEffect)(()=>{t?s&&p(!0):p(!1)},[t,s]);const R=t&&!o&&null!==a,[g,m]=(0,_react.useState)(()=>Date.now());(0,_react.useEffect)(()=>{if(!R)return;m(Date.now());const e=setInterval(()=>m(Date.now()),1e3);return()=>clearInterval(e)},[R]);const v=R&&null!==a?(0,_activityGroups.formatElapsed)(g-a):null,U=e?i?"error":t?s||j?"robot":"thinking":"idle":"confused",k=r?"Stopping":s??"Thinking",S=e?o?"Waiting for you":t?v?`${k} · ${v}`:`${k}…`:n?"Read only"+(c>0?` · ${c} tool${1===c?"":"s"}`:""):c>0?`Ready · ${c} tool${1===c?"":"s"} available`:"Ready":"Not set up in this app";return(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[u?(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:u}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.otto,testID:"buoy-ask-buoy-otto",children:(0,_jsxRuntime.jsx)(_sharedUi.Otto,{state:U,pixelSize:2,tickMs:HEADER_TICK_MS,water:!1})}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:"Ask Buoy",subtitle:S,testID:"buoy-ask-buoy-title"}),(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions,{children:[h?(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-ask-buoy-ticket",accessibilityRole:"button",accessibilityLabel:"Summarize for a ticket",disabled:!l||t,onPress:h,style:[styles.actionBtn,(!l||t)&&styles.actionBtnDisabled],children:(0,_jsxRuntime.jsx)(_sharedUi.FileText,{size:14,color:l&&!t?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})}):null,y?(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-ask-buoy-copy-chat",accessibilityRole:"button",accessibilityLabel:b?"Conversation copied":"Copy conversation",disabled:!l,onPress:x,style:[styles.actionBtn,!l&&styles.actionBtnDisabled],children:b?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:14,color:_sharedUi.night.color.accent}):(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:l?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})}):null,_?(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-ask-buoy-settings",accessibilityRole:"button",accessibilityLabel:"Settings",onPress:_,style:styles.actionBtn,children:(0,_jsxRuntime.jsx)(_sharedUi.SettingsSolid,{size:14,color:_sharedUi.night.color.textSecondary})}):null,(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-ask-buoy-reset",accessibilityRole:"button",accessibilityLabel:"New conversation",disabled:!l,onPress:d,style:[styles.actionBtn,!l&&styles.actionBtnDisabled],children:(0,_jsxRuntime.jsx)(_sharedUi.Plus,{size:14,color:l?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})})]})]})}const styles=_reactNative.StyleSheet.create({otto:{marginRight:8,justifyContent:"center"},actionBtn:{width:32,height:32,borderRadius:8,backgroundColor:_sharedUi.night.color.buttonSurface,borderWidth:1,borderColor:_sharedUi.night.color.border,alignItems:"center",justifyContent:"center"},actionBtnDisabled:{opacity:.55}});
@@ -1,19 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "ASK_BUOY_ICON_COLOR", {
7
- enumerable: true,
8
- get: function () {
9
- return _floatingToolsCore.ASK_BUOY_ICON_COLOR;
10
- }
11
- });
12
- Object.defineProperty(exports, "AskBuoyIcon", {
13
- enumerable: true,
14
- get: function () {
15
- return _floatingToolsCore.AskBuoyIcon;
16
- }
17
- });
18
- var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
19
- //# sourceMappingURL=AskBuoyIcon.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ASK_BUOY_ICON_COLOR",{enumerable:!0,get:function(){return _floatingToolsCore.ASK_BUOY_ICON_COLOR}}),Object.defineProperty(exports,"AskBuoyIcon",{enumerable:!0,get:function(){return _floatingToolsCore.AskBuoyIcon}});var _floatingToolsCore=require("@buoy-gg/floating-tools-core");