@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,46 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Copy that reports what happened.
5
- *
6
- * Both clipboard libraries are OPTIONAL peers, so `copyToClipboard` resolves
7
- * false in an app that installed neither — a copy button that silently does
8
- * nothing is worse than no copy button, so that case falls through to the OS
9
- * share sheet (which also offers Copy) instead of failing quietly.
10
- *
11
- * `getText` is read on PRESS, not on render: the whole-transcript callers
12
- * would otherwise rebuild the transcript on every frame of a streaming answer
13
- * just to have a string ready for a button nobody tapped.
14
- */
15
- import { useCallback, useEffect, useRef, useState } from "react";
16
- import { Share } from "react-native";
17
- import { copyToClipboard } from "@buoy-gg/shared-ui";
18
-
19
- /** Long enough to notice out of the corner of an eye, short enough not to linger. */
20
- const COPIED_MS = 1500;
21
- export function useCopyAction(getText) {
22
- const [copied, setCopied] = useState(false);
23
- const timer = useRef(null);
24
- useEffect(() => () => {
25
- if (timer.current) clearTimeout(timer.current);
26
- }, []);
27
- const copy = useCallback(() => {
28
- const text = getText();
29
- void copyToClipboard(text).then(ok => {
30
- if (!ok) {
31
- void Share.share({
32
- message: text
33
- }).catch(() => {});
34
- return;
35
- }
36
- setCopied(true);
37
- if (timer.current) clearTimeout(timer.current);
38
- timer.current = setTimeout(() => setCopied(false), COPIED_MS);
39
- }).catch(() => {});
40
- }, [getText]);
41
- return {
42
- copied,
43
- copy
44
- };
45
- }
46
- //# sourceMappingURL=useCopyAction.js.map
1
+ "use strict";import{useCallback,useEffect,useRef,useState}from"react";import{Share}from"react-native";import{copyToClipboard}from"@buoy-gg/shared-ui";const COPIED_MS=1500;export function useCopyAction(e){const[t,r]=useState(!1),c=useRef(null);return useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),{copied:t,copy:useCallback(()=>{const t=e();copyToClipboard(t).then(e=>{e?(r(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>r(!1),1500)):Share.share({message:t}).catch(()=>{})}).catch(()=>{})},[e])}}
@@ -1,34 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * @buoy-gg/ask-buoy — "Ask Buoy".
5
- *
6
- * A chat sheet that drives every other Buoy tool on behalf of someone who does
7
- * not read code. The model runs on the company's own endpoint (see
8
- * `AskBuoyConfig`), the tool calls go through the same `dispatchToolAction`
9
- * seam a Scenario step uses, and anything it changes is listed in a bar with an
10
- * Undo.
11
- */
12
- export { AskBuoyModal } from "./components/AskBuoyModal";
13
- export { askBuoyToolPreset, createAskBuoyTool, AskBuoyIcon, ASK_BUOY_ICON_COLOR } from "./preset";
14
- export { askBuoySyncAdapter, ASK_BUOY_ADAPTER_VERSION } from "./sync/askBuoySyncAdapter";
15
- export { askBuoyStore } from "./store/askBuoyStore";
16
- export { useAskBuoy, useAskBuoyState } from "./store/useAskBuoy";
17
- export { redactForWire } from "./sync/wire";
18
- export { BlockRenderer, BlockHandlersProvider, useBlockHandlers } from "./blocks";
19
- export { Card as BlockCard, ActionRow as BlockActionRow, ProvenanceBadge } from "./blocks";
20
- export { MessageActions, ReasoningStrip, ElapsedRow, QueuedComposer, ReloadDivider, Timestamp, EditableUserBubble, LivePill } from "./blocks";
21
- export { Markdown } from "./components/Markdown";
22
- // The real transcript pieces, exported so the example app's "chat scenes" page
23
- // can stage conversations in the actual sheet chrome.
24
- export { MessageList } from "./components/MessageList";
25
- export { AskBuoyHeader } from "./components/AskBuoyHeader";
26
- export { AskBuoySettings } from "./components/AskBuoySettings";
27
- export { ThinkingStrip } from "./components/ThinkingStrip";
28
- export { askBuoySettings } from "./store/askBuoySettings";
29
- export { useAskBuoySettings } from "./store/useAskBuoySettings";
30
- export { traceEntries, traceToText, hasTrace } from "./store/traceText";
31
- export { Composer } from "./components/Composer";
32
- export { ChangesBar } from "./components/ChangesBar";
33
- export { ApprovalCard } from "./components/ApprovalCard";
34
- //# sourceMappingURL=index.js.map
1
+ "use strict";export{AskBuoyModal}from"./components/AskBuoyModal";export{askBuoyToolPreset,createAskBuoyTool,AskBuoyIcon,ASK_BUOY_ICON_COLOR}from"./preset";export{askBuoySyncAdapter,ASK_BUOY_ADAPTER_VERSION}from"./sync/askBuoySyncAdapter";export{askBuoyStore}from"./store/askBuoyStore";export{useAskBuoy,useAskBuoyState}from"./store/useAskBuoy";export{redactForWire}from"./sync/wire";export{BlockRenderer,BlockHandlersProvider,useBlockHandlers}from"./blocks";export{Card as BlockCard,ActionRow as BlockActionRow,ProvenanceBadge}from"./blocks";export{MessageActions,ReasoningStrip,ElapsedRow,QueuedComposer,ReloadDivider,Timestamp,EditableUserBubble,LivePill}from"./blocks";export{Markdown}from"./components/Markdown";export{MessageList}from"./components/MessageList";export{AskBuoyHeader}from"./components/AskBuoyHeader";export{AskBuoySettings}from"./components/AskBuoySettings";export{ThinkingStrip}from"./components/ThinkingStrip";export{askBuoySettings}from"./store/askBuoySettings";export{useAskBuoySettings}from"./store/useAskBuoySettings";export{traceEntries,traceToText,hasTrace}from"./store/traceText";export{Composer}from"./components/Composer";export{ChangesBar}from"./components/ChangesBar";export{ApprovalCard}from"./components/ApprovalCard";
@@ -1,73 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * The Ask Buoy tool preset.
5
- *
6
- * Manual chrome (`component` renders its own JsModal) rather than the
7
- * declarative `modal` config, because ToolModalShell forwards neither a footer
8
- * slot nor `initialHeight` — and a chat needs a sticky composer and more than
9
- * the default 400pt of sheet.
10
- *
11
- * The config is closed over at creation time rather than read from a store, so
12
- * the endpoint and headers come from the app's own code on every render and
13
- * there is never a copy of them sitting anywhere Buoy persists.
14
- */
15
- import { AskBuoyIcon, ASK_BUOY_ICON_COLOR } from "./components/AskBuoyIcon";
16
- import { AskBuoyModal } from "./components/AskBuoyModal";
17
- import { jsx as _jsx } from "react/jsx-runtime";
18
- export { AskBuoyIcon, ASK_BUOY_ICON_COLOR };
19
- export const askBuoyToolPreset = {
20
- id: "ask-buoy",
21
- name: "ASK BUOY",
22
- description: "Ask about this app in plain English",
23
- slot: "both",
24
- // Set here rather than in floating-tools-core's `toolColors` map: that map
25
- // is already missing half the shipped tools, so the web twin falls back to a
26
- // generic accent for them. A color on the preset is the one place both
27
- // native and web read.
28
- color: ASK_BUOY_ICON_COLOR,
29
- icon: ({
30
- size,
31
- color
32
- }) => /*#__PURE__*/_jsx(AskBuoyIcon, {
33
- size: size,
34
- color: color || ASK_BUOY_ICON_COLOR
35
- }),
36
- component: AskBuoyModal
37
- };
38
-
39
- /**
40
- * `endpoint` and `model` are REQUIRED at the type level. This used to extend
41
- * Partial<AskBuoyConfig> with a cast, so a missing endpoint type-checked and
42
- * only surfaced as a runtime "not set up yet" — the wrong moment to learn it.
43
- */
44
-
45
- /**
46
- * Wire Ask Buoy to your team's AI endpoint.
47
- *
48
- * @example
49
- * createAskBuoyTool({
50
- * endpoint: "https://ai.acme.com/v1/messages",
51
- * model: "claude-opus-5",
52
- * headers: async () => ({ Authorization: `Bearer ${await auth.getToken()}` }),
53
- * context: { notes: ["user.rewards.points = loyalty points"] },
54
- * })
55
- */
56
- export function createAskBuoyTool(config) {
57
- const {
58
- name,
59
- description,
60
- ...rest
61
- } = config;
62
- const resolved = rest;
63
- return {
64
- ...askBuoyToolPreset,
65
- name: name ?? askBuoyToolPreset.name,
66
- description: description ?? askBuoyToolPreset.description,
67
- component: props => /*#__PURE__*/_jsx(AskBuoyModal, {
68
- ...props,
69
- config: resolved
70
- })
71
- };
72
- }
73
- //# sourceMappingURL=preset.js.map
1
+ "use strict";import{AskBuoyIcon,ASK_BUOY_ICON_COLOR}from"./components/AskBuoyIcon";import{AskBuoyModal}from"./components/AskBuoyModal";import{jsx as _jsx}from"react/jsx-runtime";export{AskBuoyIcon,ASK_BUOY_ICON_COLOR};export const askBuoyToolPreset={id:"ask-buoy",name:"ASK BUOY",description:"Ask about this app in plain English",slot:"both",color:ASK_BUOY_ICON_COLOR,icon:({size:o,slot:s})=>_jsx(AskBuoyIcon,{size:"dial"===s?1.5*o:o}),component:AskBuoyModal};export function createAskBuoyTool(o){const{name:s,description:t,...e}=o,n=e;return{...askBuoyToolPreset,name:s??askBuoyToolPreset.name,description:t??askBuoyToolPreset.description,component:o=>_jsx(AskBuoyModal,{...o,config:n})}}
@@ -1,103 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * How tool rows fold in the activity card.
5
- *
6
- * Consecutive SUCCESSFUL READS fold into one row — "Looked at Network, Storage
7
- * · 3 reads" — and nothing else ever folds. The previous rule folded by count:
8
- * past four steps the card became "Did 7 things · 1 failed" with every row but
9
- * the failures hidden, including the one successful write, which is the row
10
- * the user most needs to see. Codex's exec cell does the same thing for file
11
- * reads ("Explored — Read a, b, c") and keeps every run visible.
12
- *
13
- * A group never crosses a write: a read after a mutation is a different
14
- * observation from a read before it, and merging them would misreport order.
15
- * Uses the engine's `effect` classification, never the action's name.
16
- */
17
- import { toolTitle } from "@buoy-gg/agent-core";
18
- const foldable = c => c.effect === "read" && c.status === "ok";
19
- export function groupCalls(calls) {
20
- const out = [];
21
- let run = [];
22
- const flush = () => {
23
- if (run.length === 0) return;
24
- if (run.length === 1) {
25
- out.push({
26
- kind: "call",
27
- call: run[0]
28
- });
29
- } else {
30
- const titles = [...new Set(run.map(c => toolTitle(c.toolId)))];
31
- out.push({
32
- kind: "reads",
33
- id: run.map(c => c.id).join("+"),
34
- calls: run,
35
- label: `Looked at ${joinNatural(titles)}`,
36
- count: run.length
37
- });
38
- }
39
- run = [];
40
- };
41
- for (const call of calls) {
42
- if (foldable(call)) {
43
- run.push(call);
44
- continue;
45
- }
46
- flush();
47
- out.push({
48
- kind: "call",
49
- call
50
- });
51
- }
52
- flush();
53
- return out;
54
- }
55
-
56
- /** "Network", "Network and Storage", "Network, Storage and Screen". */
57
- function joinNatural(items) {
58
- if (items.length <= 1) return items[0] ?? "";
59
- if (items.length === 2) return `${items[0]} and ${items[1]}`;
60
- return `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
61
- }
62
-
63
- /**
64
- * "48s · 6 actions · 1 declined" — the line under a finished answer.
65
- *
66
- * "Actions" is tool calls, not provider rounds: rounds are an implementation
67
- * detail nobody outside the engine can count. Failed, refused, declined and
68
- * stopped are listed separately because they are different outcomes — a
69
- * failed exploratory read the agent recovered from is not a failed task. No
70
- * duration is invented when the message has no start time (a restored note).
71
- */
72
- export function turnFooter(message) {
73
- const parts = [];
74
- if (message.startedAt !== undefined && message.endedAt !== undefined && message.endedAt >= message.startedAt) {
75
- parts.push(formatElapsed(message.endedAt - message.startedAt));
76
- }
77
- const n = message.toolCalls.length;
78
- if (n > 0) {
79
- parts.push(`${n} action${n === 1 ? "" : "s"}`);
80
- const count = s => message.toolCalls.filter(c => c.status === s).length;
81
- const failed = count("failed");
82
- const refused = count("refused");
83
- const declined = count("declined");
84
- const stopped = count("stopped");
85
- if (failed) parts.push(`${failed} failed`);
86
- if (refused) parts.push(`${refused} refused`);
87
- if (declined) parts.push(`${declined} declined`);
88
- if (stopped) parts.push(`${stopped} not run`);
89
- }
90
- return parts.length ? parts.join(" · ") : null;
91
- }
92
-
93
- /** "4s", "1m 04s", "1h 02m". Compact, for a subtitle or a footer. */
94
- export function formatElapsed(ms) {
95
- const total = Math.max(0, Math.floor(ms / 1000));
96
- if (total < 60) return `${total}s`;
97
- const m = Math.floor(total / 60);
98
- const s = total % 60;
99
- if (m < 60) return `${m}m ${String(s).padStart(2, "0")}s`;
100
- const h = Math.floor(m / 60);
101
- return `${h}h ${String(m % 60).padStart(2, "0")}m`;
102
- }
103
- //# sourceMappingURL=activityGroups.js.map
1
+ "use strict";import{toolTitle}from"@buoy-gg/agent-core";const foldable=t=>"read"===t.effect&&"ok"===t.status;export function groupCalls(t){const e=[];let o=[];const n=()=>{if(0!==o.length){if(1===o.length)e.push({kind:"call",call:o[0]});else{const t=[...new Set(o.map(t=>toolTitle(t.toolId)))];e.push({kind:"reads",id:o.map(t=>t.id).join("+"),calls:o,label:`Looked at ${joinNatural(t)}`,count:o.length})}o=[]}};for(const l of t)foldable(l)?o.push(l):(n(),e.push({kind:"call",call:l}));return n(),e}function joinNatural(t){return t.length<=1?t[0]??"":2===t.length?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}export function turnFooter(t){const e=[];void 0!==t.startedAt&&void 0!==t.endedAt&&t.endedAt>=t.startedAt&&e.push(formatElapsed(t.endedAt-t.startedAt));const o=t.toolCalls.length;if(o>0){e.push(`${o} action${1===o?"":"s"}`);const n=e=>t.toolCalls.filter(t=>t.status===e).length,l=n("failed"),a=n("refused"),s=n("declined"),r=n("stopped");l&&e.push(`${l} failed`),a&&e.push(`${a} refused`),s&&e.push(`${s} declined`),r&&e.push(`${r} not run`)}return e.length?e.join(" · "):null}export function formatElapsed(t){const e=Math.max(0,Math.floor(t/1e3));if(e<60)return`${e}s`;const o=Math.floor(e/60);return o<60?`${o}m ${String(e%60).padStart(2,"0")}s`:`${Math.floor(o/60)}h ${String(o%60).padStart(2,"0")}m`}
@@ -1,77 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * The fold rule: consecutive successful reads fold, nothing else ever does,
5
- * and a group never crosses a write.
6
- */
7
- import { describe, expect, it } from "vitest";
8
- import { formatElapsed, groupCalls, turnFooter } from "./activityGroups";
9
- const call = (id, toolId, effect, status = "ok") => ({
10
- id,
11
- toolId,
12
- action: "x",
13
- label: `${toolId} ${id}`,
14
- status,
15
- effect
16
- });
17
- describe("groupCalls", () => {
18
- it("leaves a single read as an ordinary row", () => {
19
- const items = groupCalls([call("a", "console", "read")]);
20
- expect(items).toEqual([{
21
- kind: "call",
22
- call: expect.objectContaining({
23
- id: "a"
24
- })
25
- }]);
26
- });
27
- it("folds consecutive successful reads and names the tools once each", () => {
28
- const items = groupCalls([call("a", "network", "read"), call("b", "storage", "read"), call("c", "storage", "read")]);
29
- expect(items).toHaveLength(1);
30
- const g = items[0];
31
- expect(g.kind).toBe("reads");
32
- expect(g.kind === "reads" && g.count).toBe(3);
33
- expect(g.kind === "reads" && g.label).toBe("Looked at Network and Storage");
34
- });
35
- it("never folds a write, and never folds reads across one", () => {
36
- const items = groupCalls([call("a", "network", "read"), call("b", "storage", "read"), call("w", "zustand", "write"), call("c", "storage", "read"), call("d", "console", "read")]);
37
- expect(items.map(i => i.kind === "reads" ? `reads:${i.count}` : `call:${i.call.id}`)).toEqual(["reads:2", "call:w", "reads:2"]);
38
- });
39
- it("keeps failed, refused, declined, stopped and running reads as their own rows", () => {
40
- const items = groupCalls([call("a", "network", "read"), call("f", "storage", "read", "failed"), call("b", "storage", "read"), call("r", "storage", "read", "running")]);
41
- expect(items.map(i => i.kind)).toEqual(["call", "call", "call", "call"]);
42
- });
43
- });
44
- describe("turnFooter", () => {
45
- it("reports duration and action count", () => {
46
- expect(turnFooter({
47
- startedAt: 1_000,
48
- endedAt: 13_000,
49
- toolCalls: [call("a", "network", "read"), call("b", "zustand", "write")]
50
- })).toBe("12s · 2 actions");
51
- });
52
- it("separates the outcomes that were not plain successes", () => {
53
- expect(turnFooter({
54
- startedAt: 0,
55
- endedAt: 48_000,
56
- toolCalls: [call("a", "network", "read"), call("b", "storage", "write", "failed"), call("c", "storage", "destructive", "declined"), call("d", "storage", "write", "stopped")]
57
- })).toBe("48s · 4 actions · 1 failed · 1 declined · 1 not run");
58
- });
59
- it("invents no duration for a note with no start time", () => {
60
- expect(turnFooter({
61
- endedAt: 5_000,
62
- toolCalls: []
63
- })).toBeNull();
64
- expect(turnFooter({
65
- endedAt: 5_000,
66
- toolCalls: [call("a", "network", "read")]
67
- })).toBe("1 action");
68
- });
69
- });
70
- describe("formatElapsed", () => {
71
- it("is compact", () => {
72
- expect(formatElapsed(4_200)).toBe("4s");
73
- expect(formatElapsed(64_000)).toBe("1m 04s");
74
- expect(formatElapsed(3_720_000)).toBe("1h 02m");
75
- });
76
- });
77
- //# sourceMappingURL=activityGroups.test.js.map
1
+ "use strict";import{describe,expect,it}from"vitest";import{formatElapsed,groupCalls,turnFooter}from"./activityGroups";const call=(e,t,a,o="ok")=>({id:e,toolId:t,action:"x",label:`${t} ${e}`,status:o,effect:a});describe("groupCalls",()=>{it("leaves a single read as an ordinary row",()=>{const e=groupCalls([call("a","console","read")]);expect(e).toEqual([{kind:"call",call:expect.objectContaining({id:"a"})}])}),it("folds consecutive successful reads and names the tools once each",()=>{const e=groupCalls([call("a","network","read"),call("b","storage","read"),call("c","storage","read")]);expect(e).toHaveLength(1);const t=e[0];expect(t.kind).toBe("reads"),expect("reads"===t.kind&&t.count).toBe(3),expect("reads"===t.kind&&t.label).toBe("Looked at Network and Storage")}),it("never folds a write, and never folds reads across one",()=>{const e=groupCalls([call("a","network","read"),call("b","storage","read"),call("w","zustand","write"),call("c","storage","read"),call("d","console","read")]);expect(e.map(e=>"reads"===e.kind?`reads:${e.count}`:`call:${e.call.id}`)).toEqual(["reads:2","call:w","reads:2"])}),it("keeps failed, refused, declined, stopped and running reads as their own rows",()=>{const e=groupCalls([call("a","network","read"),call("f","storage","read","failed"),call("b","storage","read"),call("r","storage","read","running")]);expect(e.map(e=>e.kind)).toEqual(["call","call","call","call"])})}),describe("turnFooter",()=>{it("reports duration and action count",()=>{expect(turnFooter({startedAt:1e3,endedAt:13e3,toolCalls:[call("a","network","read"),call("b","zustand","write")]})).toBe("12s · 2 actions")}),it("separates the outcomes that were not plain successes",()=>{expect(turnFooter({startedAt:0,endedAt:48e3,toolCalls:[call("a","network","read"),call("b","storage","write","failed"),call("c","storage","destructive","declined"),call("d","storage","write","stopped")]})).toBe("48s · 4 actions · 1 failed · 1 declined · 1 not run")}),it("invents no duration for a note with no start time",()=>{expect(turnFooter({endedAt:5e3,toolCalls:[]})).toBeNull(),expect(turnFooter({endedAt:5e3,toolCalls:[call("a","network","read")]})).toBe("1 action")})}),describe("formatElapsed",()=>{it("is compact",()=>{expect(formatElapsed(4200)).toBe("4s"),expect(formatElapsed(64e3)).toBe("1m 04s"),expect(formatElapsed(372e4)).toBe("1h 02m")})});
@@ -1,67 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Ask Buoy's own preferences — the things a tester sets on the sheet, not the
5
- * things a developer sets in `askBuoy={{ … }}`.
6
- *
7
- * Module-level and subscribable for the same reason the transcript is: the
8
- * sheet unmounts whenever the tool is closed or minimised, and a preference
9
- * that reset on every close would not be a preference.
10
- */
11
- import { definePersistedSetting, devToolsStorageKeys } from "@buoy-gg/shared-ui";
12
- export const DEFAULT_SETTINGS = {
13
- showThinking: false,
14
- bypassApprovals: false,
15
- readOnly: false
16
- };
17
- const store = definePersistedSetting(`${devToolsStorageKeys.base}_ask_buoy_settings`, DEFAULT_SETTINGS, {
18
- sanitize: merged => ({
19
- showThinking: merged.showThinking === true,
20
- // Fails closed: anything but a literal `true` on disk means "ask me".
21
- bypassApprovals: merged.bypassApprovals === true,
22
- readOnly: merged.readOnly === true
23
- })
24
- });
25
- let current = DEFAULT_SETTINGS;
26
- let loaded = false;
27
- const listeners = new Set();
28
- function emit() {
29
- for (const fn of listeners) {
30
- try {
31
- fn();
32
- } catch {
33
- // A throwing subscriber must not take the sheet down.
34
- }
35
- }
36
- }
37
- export const askBuoySettings = {
38
- get: () => current,
39
- subscribe(fn) {
40
- listeners.add(fn);
41
- // First subscriber pays for the read; everyone after gets the cached value.
42
- if (!loaded) {
43
- loaded = true;
44
- void store.load().then(value => {
45
- current = value;
46
- emit();
47
- });
48
- }
49
- return () => listeners.delete(fn);
50
- },
51
- set(key, value) {
52
- if (current[key] === value) return;
53
- current = {
54
- ...current,
55
- [key]: value
56
- };
57
- emit();
58
- void store.save(current);
59
- },
60
- /** Tests only — the module cache would otherwise leak between them. */
61
- reset() {
62
- current = DEFAULT_SETTINGS;
63
- loaded = false;
64
- void store.clear();
65
- }
66
- };
67
- //# sourceMappingURL=askBuoySettings.js.map
1
+ "use strict";import{definePersistedSetting,devToolsStorageKeys}from"@buoy-gg/shared-ui";export const DEFAULT_SETTINGS={showThinking:!1,bypassApprovals:!1,readOnly:!1};const store=definePersistedSetting(`${devToolsStorageKeys.base}_ask_buoy_settings`,DEFAULT_SETTINGS,{sanitize:e=>({showThinking:!0===e.showThinking,bypassApprovals:!0===e.bypassApprovals,readOnly:!0===e.readOnly})});let current=DEFAULT_SETTINGS,loaded=!1;const listeners=new Set;function emit(){for(const e of listeners)try{e()}catch{}}export const askBuoySettings={get:()=>current,subscribe:e=>(listeners.add(e),loaded||(loaded=!0,store.load().then(e=>{current=e,emit()})),()=>listeners.delete(e)),set(e,s){current[e]!==s&&(current={...current,[e]:s},emit(),store.save(current))},reset(){current=DEFAULT_SETTINGS,loaded=!1,store.clear()}};