@buoy-gg/ask-buoy 7.0.41 → 7.0.43

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 -12
  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
@@ -1,297 +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
- const [note, setNote] = (0, _react.useState)("");
40
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
41
- style: styles.card,
42
- testID: "buoy-ask-buoy-approval",
43
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
44
- style: styles.titleRow,
45
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.AlertTriangle, {
46
- size: 14,
47
- color: _sharedUi.night.color.warning
48
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
49
- style: styles.title,
50
- children: "Allow this change?"
51
- })]
52
- }), pending.restored ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
53
- style: styles.restored,
54
- testID: "buoy-ask-buoy-approval-restored",
55
- children: "Asked before the app restarted \u2014 check it still applies."
56
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
57
- style: styles.label,
58
- children: pending.label
59
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
60
- style: styles.reason,
61
- children: pending.reason
62
- }), pending.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ApprovalDetails, {
63
- text: pending.description
64
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
65
- testID: "buoy-ask-buoy-approval-note",
66
- value: note,
67
- onChangeText: setNote,
68
- placeholder: "Add a note for the agent (optional)",
69
- placeholderTextColor: _sharedUi.night.color.textTertiary,
70
- style: styles.note,
71
- returnKeyType: "done",
72
- blurOnSubmit: true
73
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
74
- style: styles.actions,
75
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
76
- testID: "buoy-ask-buoy-approve",
77
- accessibilityRole: "button",
78
- onPress: () => onAnswer({
79
- approved: true,
80
- reason: note
81
- }),
82
- style: ({
83
- pressed
84
- }) => [styles.button, styles.approve, pressed && styles.pressed],
85
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
86
- style: styles.approveText,
87
- children: "Allow"
88
- })
89
- }), pending.restored ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
90
- testID: "buoy-ask-buoy-approve-trust",
91
- accessibilityRole: "button",
92
- onPress: () => onAnswer({
93
- approved: true,
94
- reason: note,
95
- trust: true
96
- }),
97
- style: ({
98
- pressed
99
- }) => [styles.button, styles.trust, pressed && styles.pressed],
100
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
101
- style: styles.trustText,
102
- children: "Allow for this chat"
103
- })
104
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
105
- testID: "buoy-ask-buoy-reject",
106
- accessibilityRole: "button",
107
- onPress: () => onAnswer({
108
- approved: false,
109
- reason: note
110
- }),
111
- style: ({
112
- pressed
113
- }) => [styles.button, styles.reject, pressed && styles.pressed],
114
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
115
- style: styles.rejectText,
116
- children: "Not now"
117
- })
118
- })]
119
- })]
120
- });
121
- }
122
-
123
- /**
124
- * The catalog's own description, behind a disclosure, closed by default.
125
- *
126
- * Owns its open state rather than taking it as a prop: nothing above the card
127
- * needs to know, and answering the prompt unmounts the whole thing anyway.
128
- * One ChevronDown rotated in place, not a swap between two icon components —
129
- * the tree keeps its shape whichever way it is pointing.
130
- */
131
- function ApprovalDetails({
132
- text
133
- }) {
134
- const [open, setOpen] = (0, _react.useState)(false);
135
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
136
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
137
- testID: "buoy-ask-buoy-approval-details",
138
- accessibilityRole: "button",
139
- accessibilityState: {
140
- expanded: open
141
- },
142
- onPress: () => setOpen(prev => !prev),
143
- style: ({
144
- pressed
145
- }) => [styles.disclosure, pressed && styles.pressed],
146
- hitSlop: 6,
147
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
148
- style: open ? styles.chevronOpen : styles.chevronClosed,
149
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
150
- size: 12,
151
- color: _sharedUi.night.color.textTertiary
152
- })
153
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
154
- style: styles.disclosureText,
155
- children: open ? "Hide details" : "Details"
156
- })]
157
- }), open ?
158
- /*#__PURE__*/
159
- // Capped and scrollable: the text behind this is unbounded, and the
160
- // buttons below must stay on screen whatever it says.
161
- (0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
162
- style: styles.detail,
163
- contentContainerStyle: styles.detailContent,
164
- nestedScrollEnabled: true,
165
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
166
- style: styles.description,
167
- children: text
168
- })
169
- }) : null]
170
- });
171
- }
172
- const styles = _reactNative.StyleSheet.create({
173
- card: {
174
- marginHorizontal: _sharedUi.night.gutter,
175
- marginBottom: 10,
176
- padding: _sharedUi.night.cardPad,
177
- borderRadius: _sharedUi.night.radius.card,
178
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
179
- borderColor: _sharedUi.night.color.accentBorderStrong,
180
- backgroundColor: _sharedUi.night.color.surface,
181
- gap: 6
182
- },
183
- titleRow: {
184
- flexDirection: "row",
185
- alignItems: "center",
186
- gap: 6
187
- },
188
- title: {
189
- color: _sharedUi.night.color.text,
190
- fontSize: _sharedUi.night.font.caption,
191
- fontWeight: "600"
192
- },
193
- label: {
194
- color: _sharedUi.night.color.text,
195
- fontSize: _sharedUi.night.font.row,
196
- fontWeight: "600",
197
- lineHeight: 20
198
- },
199
- description: {
200
- color: _sharedUi.night.color.textSecondary,
201
- fontSize: _sharedUi.night.font.caption,
202
- lineHeight: 18
203
- },
204
- reason: {
205
- color: _sharedUi.night.color.warning,
206
- fontSize: _sharedUi.night.font.caption,
207
- lineHeight: 18
208
- },
209
- restored: {
210
- color: _sharedUi.night.color.info,
211
- backgroundColor: _sharedUi.night.color.infoSoft,
212
- fontSize: _sharedUi.night.font.micro,
213
- lineHeight: 16,
214
- paddingHorizontal: 8,
215
- paddingVertical: 5,
216
- borderRadius: 8
217
- },
218
- disclosure: {
219
- flexDirection: "row",
220
- alignItems: "center",
221
- gap: 4,
222
- paddingVertical: 4
223
- },
224
- disclosureText: {
225
- color: _sharedUi.night.color.textTertiary,
226
- fontSize: _sharedUi.night.font.micro,
227
- fontWeight: "600"
228
- },
229
- chevronOpen: {
230
- transform: [{
231
- rotate: "0deg"
232
- }]
233
- },
234
- chevronClosed: {
235
- transform: [{
236
- rotate: "-90deg"
237
- }]
238
- },
239
- detail: {
240
- maxHeight: 150,
241
- marginTop: 2
242
- },
243
- detailContent: {
244
- paddingBottom: 2
245
- },
246
- note: {
247
- color: _sharedUi.night.color.text,
248
- fontSize: _sharedUi.night.font.caption,
249
- paddingHorizontal: 10,
250
- paddingVertical: 7,
251
- borderRadius: _sharedUi.night.radius.row,
252
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
253
- borderColor: _sharedUi.night.color.border,
254
- backgroundColor: _sharedUi.night.color.button,
255
- marginTop: 2
256
- },
257
- actions: {
258
- flexDirection: "row",
259
- flexWrap: "wrap",
260
- gap: 8,
261
- marginTop: 6
262
- },
263
- button: {
264
- paddingHorizontal: 16,
265
- paddingVertical: 9,
266
- borderRadius: _sharedUi.night.radius.row
267
- },
268
- approve: {
269
- backgroundColor: _sharedUi.night.color.accent
270
- },
271
- approveText: {
272
- color: _sharedUi.night.color.onAccent,
273
- fontWeight: "600",
274
- fontSize: _sharedUi.night.font.caption
275
- },
276
- trust: {
277
- backgroundColor: _sharedUi.night.color.button,
278
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
279
- borderColor: _sharedUi.night.color.accentBorderStrong
280
- },
281
- trustText: {
282
- color: _sharedUi.night.color.accent,
283
- fontWeight: "600",
284
- fontSize: _sharedUi.night.font.caption
285
- },
286
- reject: {
287
- backgroundColor: _sharedUi.night.color.button
288
- },
289
- rejectText: {
290
- color: _sharedUi.night.color.text,
291
- fontSize: _sharedUi.night.font.caption
292
- },
293
- pressed: {
294
- opacity: 0.7
295
- }
296
- });
297
- //# sourceMappingURL=ApprovalCard.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ApprovalCard=ApprovalCard;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function ApprovalCard({pending:e,onAnswer:t}){const[o,r]=(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 \u2014 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:o,onChangeText:r,placeholder:"Add a note for the agent (optional)",placeholderTextColor:_sharedUi.night.color.textTertiary,style:styles.note,returnKeyType:"done",blurOnSubmit:true}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actions,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-ask-buoy-approve",accessibilityRole:"button",onPress:()=>t({approved:true,reason:o}),style:({pressed:i})=>[styles.button,styles.approve,i&&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:true,reason:o,trust:true}),style:({pressed:i})=>[styles.button,styles.trust,i&&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:false,reason:o}),style:({pressed:i})=>[styles.button,styles.reject,i&&styles.pressed],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rejectText,children:"Not now"})})]})]})}function ApprovalDetails({text:e}){const[t,o]=(0,_react.useState)(false);return(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{testID:"buoy-ask-buoy-approval-details",accessibilityRole:"button",accessibilityState:{expanded:t},onPress:()=>o(r=>!r),style:({pressed:r})=>[styles.disclosure,r&&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:true,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:true});exports.AskBuoyHeader=AskBuoyHeader;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _useCopyAction=require("./useCopyAction");var _activityGroups=require("../store/activityGroups");var _jsxRuntime=require("react/jsx-runtime");const HEADER_TICK_MS=200;const NO_TRANSCRIPT=()=>"";function AskBuoyHeader({configured:c,busy:e,failed:f=false,activeLabel:i,awaitingApproval:l=false,startedAt:r=null,stopping:j=false,readOnly:k=false,toolCount:o,hasMessages:t,onBack:s,onReset:v,getTranscript:a,onOpenSettings:u,onTicket:y}){const{copied:d,copy:S}=(0,_useCopyAction.useCopyAction)(a??NO_TRANSCRIPT);const[g,b]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{if(!e)b(false);else if(i)b(true)},[e,i]);const n=e&&!l&&r!==null;const[R,x]=(0,_react.useState)(()=>(0,_sharedUi.realNow)());(0,_react.useEffect)(()=>{if(!n)return;x((0,_sharedUi.realNow)());const T=setInterval(()=>x((0,_sharedUi.realNow)()),1e3);return()=>clearInterval(T)},[n]);const h=n&&r!==null?(0,_activityGroups.formatElapsed)(R-r):null;const B=!c?"confused":f?"error":e?i||g?"robot":"thinking":"idle";const p=j?"Stopping":i??"Thinking";const D=!c?"Not set up in this app":l?"Waiting for you":e?h?`${p} \xB7 ${h}`:`${p}\u2026`:k?`Read only${o>0?` \xB7 ${o} tool${o===1?"":"s"}`:""}`:o>0?`Ready \xB7 ${o} tool${o===1?"":"s"} available`:"Ready";return(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[s?(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:s}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.otto,testID:"buoy-ask-buoy-otto",children:(0,_jsxRuntime.jsx)(_sharedUi.Otto,{state:B,pixelSize:2,tickMs:HEADER_TICK_MS,water:false})}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:"Ask Buoy",subtitle:D,testID:"buoy-ask-buoy-title"}),(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions,{children:[y?(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-ask-buoy-ticket",accessibilityRole:"button",accessibilityLabel:"Summarize for a ticket",disabled:!t||e,onPress:y,style:[styles.actionBtn,(!t||e)&&styles.actionBtnDisabled],children:(0,_jsxRuntime.jsx)(_sharedUi.FileText,{size:14,color:t&&!e?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})}):null,a?(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-ask-buoy-copy-chat",accessibilityRole:"button",accessibilityLabel:d?"Conversation copied":"Copy conversation",disabled:!t,onPress:S,style:[styles.actionBtn,!t&&styles.actionBtnDisabled],children:d?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:14,color:_sharedUi.night.color.accent}):(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:t?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})}):null,u?(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-ask-buoy-settings",accessibilityRole:"button",accessibilityLabel:"Settings",onPress:u,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:!t,onPress:v,style:[styles.actionBtn,!t&&styles.actionBtnDisabled],children:(0,_jsxRuntime.jsx)(_sharedUi.Plus,{size:14,color:t?_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:true});Object.defineProperty(exports,"ASK_BUOY_ICON_COLOR",{enumerable:true,get:function(){return _floatingToolsCore.ASK_BUOY_ICON_COLOR}});Object.defineProperty(exports,"AskBuoyIcon",{enumerable:true,get:function(){return _floatingToolsCore.AskBuoyIcon}});var _floatingToolsCore=require("@buoy-gg/floating-tools-core");