@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,503 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Conversation chrome from the survey — NOT blocks. Prototypes for the review
5
- * page so each can be judged before it is wired into the real transcript:
6
- * message actions, a reasoning strip, elapsed time on a running step, a
7
- * queued-message composer state, timestamps + a reload divider, and an
8
- * editable user bubble with a branch affordance.
9
- */
10
- import { useEffect, useState } from "react";
11
- import { ActivityIndicator, Pressable, StyleSheet, Text, TextInput, View } from "react-native";
12
- import { ChevronDown, ChevronRight, Copy, night, RefreshCw } from "@buoy-gg/shared-ui";
13
- import { useBlockHandlers } from "./context";
14
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- function IconButton({
16
- label,
17
- onPress,
18
- children
19
- }) {
20
- return /*#__PURE__*/_jsx(Pressable, {
21
- onPress: onPress,
22
- accessibilityRole: "button",
23
- accessibilityLabel: label,
24
- style: ({
25
- pressed
26
- }) => [styles.iconBtn, pressed && styles.pressed],
27
- children: children
28
- });
29
- }
30
-
31
- /** Copy · Retry · 👍 👎 · Share, under an assistant message. */
32
- export function MessageActions({
33
- id = "chrome-actions"
34
- }) {
35
- const h = useBlockHandlers();
36
- const [vote, setVote] = useState(null);
37
- const fire = label => void h.runAction({
38
- label,
39
- send: `__chrome__:${label}`
40
- }, id);
41
- return /*#__PURE__*/_jsxs(View, {
42
- style: styles.actions,
43
- testID: "chrome-message-actions",
44
- children: [/*#__PURE__*/_jsx(IconButton, {
45
- label: "Copy",
46
- onPress: () => fire("copy"),
47
- children: /*#__PURE__*/_jsx(Copy, {
48
- size: 13,
49
- color: night.color.textSecondary
50
- })
51
- }), /*#__PURE__*/_jsx(IconButton, {
52
- label: "Retry",
53
- onPress: () => fire("retry"),
54
- children: /*#__PURE__*/_jsx(RefreshCw, {
55
- size: 13,
56
- color: night.color.textSecondary
57
- })
58
- }), /*#__PURE__*/_jsx(IconButton, {
59
- label: "Good answer",
60
- onPress: () => {
61
- setVote("up");
62
- fire("thumbs up");
63
- },
64
- children: /*#__PURE__*/_jsx(Text, {
65
- style: [styles.glyph, vote === "up" && styles.glyphOn],
66
- children: "\uD83D\uDC4D"
67
- })
68
- }), /*#__PURE__*/_jsx(IconButton, {
69
- label: "Bad answer",
70
- onPress: () => {
71
- setVote("down");
72
- fire("thumbs down");
73
- },
74
- children: /*#__PURE__*/_jsx(Text, {
75
- style: [styles.glyph, vote === "down" && styles.glyphOn],
76
- children: "\uD83D\uDC4E"
77
- })
78
- }), /*#__PURE__*/_jsx(IconButton, {
79
- label: "Export",
80
- onPress: () => fire("export transcript"),
81
- children: /*#__PURE__*/_jsx(Text, {
82
- style: styles.textBtn,
83
- children: "Export"
84
- })
85
- })]
86
- });
87
- }
88
-
89
- /** Collapsible "what I'm doing / what I thought" strip. */
90
- export function ReasoningStrip({
91
- text,
92
- live
93
- }) {
94
- const [open, setOpen] = useState(false);
95
- return /*#__PURE__*/_jsxs(View, {
96
- style: styles.reasoning,
97
- testID: "chrome-reasoning",
98
- children: [/*#__PURE__*/_jsxs(Pressable, {
99
- onPress: () => setOpen(v => !v),
100
- style: styles.reasoningHead,
101
- accessibilityRole: "button",
102
- accessibilityState: {
103
- expanded: open
104
- },
105
- children: [live ? /*#__PURE__*/_jsx(ActivityIndicator, {
106
- size: "small",
107
- color: night.color.textTertiary
108
- }) : null, /*#__PURE__*/_jsx(Text, {
109
- style: styles.reasoningTitle,
110
- children: live ? "Working it out…" : "How I got here"
111
- }), open ? /*#__PURE__*/_jsx(ChevronDown, {
112
- size: 12,
113
- color: night.color.textTertiary
114
- }) : /*#__PURE__*/_jsx(ChevronRight, {
115
- size: 12,
116
- color: night.color.textTertiary
117
- })]
118
- }), open ? /*#__PURE__*/_jsx(Text, {
119
- style: styles.reasoningBody,
120
- children: text
121
- }) : null]
122
- });
123
- }
124
-
125
- /** A running activity row with elapsed time. */
126
- export function ElapsedRow({
127
- label
128
- }) {
129
- const [ms, setMs] = useState(0);
130
- useEffect(() => {
131
- const t = setInterval(() => setMs(m => m + 250), 250);
132
- return () => clearInterval(t);
133
- }, []);
134
- return /*#__PURE__*/_jsxs(View, {
135
- style: styles.elapsed,
136
- testID: "chrome-elapsed",
137
- children: [/*#__PURE__*/_jsx(ActivityIndicator, {
138
- size: "small",
139
- color: night.color.textSecondary
140
- }), /*#__PURE__*/_jsx(Text, {
141
- style: styles.elapsedLabel,
142
- children: label
143
- }), /*#__PURE__*/_jsxs(Text, {
144
- style: styles.elapsedMs,
145
- children: [(ms / 1000).toFixed(1), "s"]
146
- })]
147
- });
148
- }
149
-
150
- /** Composer while the agent is busy: type now, it sends when the turn ends. */
151
- export function QueuedComposer() {
152
- const [text, setText] = useState("");
153
- const [queued, setQueued] = useState(null);
154
- return /*#__PURE__*/_jsxs(View, {
155
- style: styles.composerWrap,
156
- testID: "chrome-queue",
157
- children: [queued ? /*#__PURE__*/_jsxs(View, {
158
- style: styles.queuedRow,
159
- children: [/*#__PURE__*/_jsxs(Text, {
160
- style: styles.queuedText,
161
- numberOfLines: 1,
162
- children: ["Queued: \"", queued, "\""]
163
- }), /*#__PURE__*/_jsx(Pressable, {
164
- onPress: () => setQueued(null),
165
- children: /*#__PURE__*/_jsx(Text, {
166
- style: styles.queuedCancel,
167
- children: "Cancel"
168
- })
169
- })]
170
- }) : null, /*#__PURE__*/_jsxs(View, {
171
- style: styles.composer,
172
- children: [/*#__PURE__*/_jsx(TextInput, {
173
- style: styles.composerInput,
174
- value: text,
175
- onChangeText: setText,
176
- placeholder: "Agent is busy \u2014 type and it sends next",
177
- placeholderTextColor: night.color.placeholder
178
- }), /*#__PURE__*/_jsx(Pressable, {
179
- disabled: !text.trim(),
180
- onPress: () => {
181
- setQueued(text.trim());
182
- setText("");
183
- },
184
- style: [styles.queueBtn, !text.trim() && {
185
- opacity: 0.5
186
- }],
187
- children: /*#__PURE__*/_jsx(Text, {
188
- style: styles.queueBtnText,
189
- children: "Queue"
190
- })
191
- })]
192
- })]
193
- });
194
- }
195
-
196
- /** "9:41 · 3 min ago" on long-press, and a divider when the app reloaded. */
197
- export function ReloadDivider({
198
- at
199
- }) {
200
- return /*#__PURE__*/_jsxs(View, {
201
- style: styles.divider,
202
- testID: "chrome-divider",
203
- children: [/*#__PURE__*/_jsx(View, {
204
- style: styles.dividerLine
205
- }), /*#__PURE__*/_jsxs(Text, {
206
- style: styles.dividerText,
207
- children: ["App reloaded \xB7 ", at]
208
- }), /*#__PURE__*/_jsx(View, {
209
- style: styles.dividerLine
210
- })]
211
- });
212
- }
213
- export function Timestamp({
214
- at
215
- }) {
216
- return /*#__PURE__*/_jsx(Text, {
217
- style: styles.timestamp,
218
- children: at
219
- });
220
- }
221
-
222
- /** A user bubble you can edit (re-run from here) or branch. */
223
- export function EditableUserBubble({
224
- text
225
- }) {
226
- const h = useBlockHandlers();
227
- const [editing, setEditing] = useState(false);
228
- const [value, setValue] = useState(text);
229
- return /*#__PURE__*/_jsx(View, {
230
- style: styles.userWrap,
231
- testID: "chrome-edit-bubble",
232
- children: editing ? /*#__PURE__*/_jsxs(View, {
233
- style: styles.editBox,
234
- children: [/*#__PURE__*/_jsx(TextInput, {
235
- style: styles.editInput,
236
- value: value,
237
- onChangeText: setValue,
238
- multiline: true
239
- }), /*#__PURE__*/_jsxs(View, {
240
- style: styles.editActions,
241
- children: [/*#__PURE__*/_jsx(Pressable, {
242
- onPress: () => {
243
- setEditing(false);
244
- void h.runAction({
245
- label: "re-run edited",
246
- send: `__chrome__:re-run "${value}"`
247
- }, "chrome-edit");
248
- },
249
- style: styles.editPrimary,
250
- children: /*#__PURE__*/_jsx(Text, {
251
- style: styles.editPrimaryText,
252
- children: "Re-run from here"
253
- })
254
- }), /*#__PURE__*/_jsx(Pressable, {
255
- onPress: () => {
256
- setEditing(false);
257
- void h.runAction({
258
- label: "branch",
259
- send: `__chrome__:branch "${value}"`
260
- }, "chrome-edit");
261
- },
262
- style: styles.editPlate,
263
- children: /*#__PURE__*/_jsx(Text, {
264
- style: styles.editPlateText,
265
- children: "Branch"
266
- })
267
- }), /*#__PURE__*/_jsx(Pressable, {
268
- onPress: () => setEditing(false),
269
- style: styles.editPlate,
270
- children: /*#__PURE__*/_jsx(Text, {
271
- style: styles.editPlateText,
272
- children: "Cancel"
273
- })
274
- })]
275
- })]
276
- }) : /*#__PURE__*/_jsxs(Pressable, {
277
- onLongPress: () => setEditing(true),
278
- onPress: () => setEditing(true),
279
- style: styles.bubble,
280
- accessibilityRole: "button",
281
- accessibilityLabel: "Edit message",
282
- children: [/*#__PURE__*/_jsx(Text, {
283
- style: styles.bubbleText,
284
- children: value
285
- }), /*#__PURE__*/_jsx(Text, {
286
- style: styles.bubbleHint,
287
- children: "tap to edit \xB7 2 branches"
288
- })]
289
- })
290
- });
291
- }
292
- const styles = StyleSheet.create({
293
- actions: {
294
- flexDirection: "row",
295
- alignItems: "center",
296
- gap: 4,
297
- paddingHorizontal: 2
298
- },
299
- iconBtn: {
300
- paddingHorizontal: 8,
301
- paddingVertical: 6,
302
- borderRadius: night.radius.badge
303
- },
304
- pressed: {
305
- backgroundColor: night.color.fill
306
- },
307
- glyph: {
308
- fontSize: 13,
309
- opacity: 0.6
310
- },
311
- glyphOn: {
312
- opacity: 1
313
- },
314
- textBtn: {
315
- color: night.color.textSecondary,
316
- fontSize: night.font.micro,
317
- fontWeight: "600"
318
- },
319
- reasoning: {
320
- borderRadius: night.radius.row,
321
- backgroundColor: night.color.fill,
322
- overflow: "hidden"
323
- },
324
- reasoningHead: {
325
- flexDirection: "row",
326
- alignItems: "center",
327
- gap: 8,
328
- paddingHorizontal: 12,
329
- paddingVertical: 8
330
- },
331
- reasoningTitle: {
332
- flex: 1,
333
- color: night.color.textSecondary,
334
- fontSize: night.font.caption,
335
- fontStyle: "italic"
336
- },
337
- reasoningBody: {
338
- color: night.color.textSecondary,
339
- fontSize: night.font.caption,
340
- lineHeight: 18,
341
- paddingHorizontal: 12,
342
- paddingBottom: 10
343
- },
344
- elapsed: {
345
- flexDirection: "row",
346
- alignItems: "center",
347
- gap: 10,
348
- paddingHorizontal: 12,
349
- paddingVertical: 10,
350
- borderRadius: night.radius.card,
351
- borderWidth: StyleSheet.hairlineWidth,
352
- borderColor: night.color.border,
353
- backgroundColor: night.color.surface
354
- },
355
- elapsedLabel: {
356
- flex: 1,
357
- color: night.color.text,
358
- fontSize: night.font.body
359
- },
360
- elapsedMs: {
361
- color: night.color.textTertiary,
362
- fontSize: night.font.caption,
363
- fontFamily: "Menlo"
364
- },
365
- composerWrap: {
366
- gap: 6
367
- },
368
- queuedRow: {
369
- flexDirection: "row",
370
- alignItems: "center",
371
- gap: 8,
372
- paddingHorizontal: 12,
373
- paddingVertical: 6,
374
- borderRadius: night.radius.row,
375
- backgroundColor: night.color.infoSoft
376
- },
377
- queuedText: {
378
- flex: 1,
379
- color: night.color.text,
380
- fontSize: night.font.caption
381
- },
382
- queuedCancel: {
383
- color: night.color.info,
384
- fontSize: night.font.caption,
385
- fontWeight: "600"
386
- },
387
- composer: {
388
- flexDirection: "row",
389
- alignItems: "center",
390
- gap: 8
391
- },
392
- composerInput: {
393
- flex: 1,
394
- height: 40,
395
- paddingHorizontal: 16,
396
- borderRadius: 20,
397
- borderWidth: StyleSheet.hairlineWidth,
398
- borderColor: night.color.border,
399
- backgroundColor: night.color.surfaceElevated,
400
- color: night.color.text,
401
- fontSize: night.font.body
402
- },
403
- queueBtn: {
404
- paddingHorizontal: 14,
405
- height: 40,
406
- borderRadius: 20,
407
- backgroundColor: night.color.button,
408
- alignItems: "center",
409
- justifyContent: "center"
410
- },
411
- queueBtnText: {
412
- color: night.color.text,
413
- fontSize: night.font.caption,
414
- fontWeight: "600"
415
- },
416
- divider: {
417
- flexDirection: "row",
418
- alignItems: "center",
419
- gap: 10,
420
- paddingVertical: 4
421
- },
422
- dividerLine: {
423
- flex: 1,
424
- height: StyleSheet.hairlineWidth,
425
- backgroundColor: night.color.border
426
- },
427
- dividerText: {
428
- color: night.color.textTertiary,
429
- fontSize: night.font.micro
430
- },
431
- timestamp: {
432
- alignSelf: "center",
433
- color: night.color.textTertiary,
434
- fontSize: night.font.micro
435
- },
436
- userWrap: {
437
- alignItems: "flex-end"
438
- },
439
- bubble: {
440
- maxWidth: "84%",
441
- paddingHorizontal: 14,
442
- paddingVertical: 9,
443
- borderRadius: 18,
444
- borderBottomRightRadius: 6,
445
- backgroundColor: night.color.accentFill,
446
- borderWidth: StyleSheet.hairlineWidth,
447
- borderColor: night.color.accentBorder,
448
- gap: 4
449
- },
450
- bubbleText: {
451
- color: night.color.text,
452
- fontSize: night.font.row,
453
- lineHeight: 21
454
- },
455
- bubbleHint: {
456
- color: night.color.textTertiary,
457
- fontSize: 10,
458
- textAlign: "right"
459
- },
460
- editBox: {
461
- width: "100%",
462
- gap: 8
463
- },
464
- editInput: {
465
- minHeight: 60,
466
- padding: 12,
467
- borderRadius: night.radius.row,
468
- backgroundColor: night.color.surfaceElevated,
469
- color: night.color.text,
470
- fontSize: night.font.row,
471
- borderWidth: StyleSheet.hairlineWidth,
472
- borderColor: night.color.accentBorderStrong
473
- },
474
- editActions: {
475
- flexDirection: "row",
476
- gap: 8,
477
- justifyContent: "flex-end",
478
- flexWrap: "wrap"
479
- },
480
- editPrimary: {
481
- paddingHorizontal: 12,
482
- paddingVertical: 8,
483
- borderRadius: night.radius.row,
484
- backgroundColor: night.color.accent
485
- },
486
- editPrimaryText: {
487
- color: night.color.onAccent,
488
- fontSize: night.font.caption,
489
- fontWeight: "600"
490
- },
491
- editPlate: {
492
- paddingHorizontal: 12,
493
- paddingVertical: 8,
494
- borderRadius: night.radius.row,
495
- backgroundColor: night.color.button
496
- },
497
- editPlateText: {
498
- color: night.color.text,
499
- fontSize: night.font.caption,
500
- fontWeight: "600"
501
- }
502
- });
503
- //# sourceMappingURL=ChromePrototypes.js.map
1
+ "use strict";import{useEffect,useState}from"react";import{ActivityIndicator,Pressable,StyleSheet,Text,TextInput,View}from"react-native";import{ChevronDown,ChevronRight,Copy,night,RefreshCw}from"@buoy-gg/shared-ui";import{useBlockHandlers}from"./context";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function IconButton({label:e,onPress:t,children:o}){return _jsx(Pressable,{onPress:t,accessibilityRole:"button",accessibilityLabel:e,style:({pressed:e})=>[styles.iconBtn,e&&styles.pressed],children:o})}export function MessageActions({id:e="chrome-actions"}){const t=useBlockHandlers(),[o,r]=useState(null),n=o=>{t.runAction({label:o,send:`__chrome__:${o}`},e)};return _jsxs(View,{style:styles.actions,testID:"chrome-message-actions",children:[_jsx(IconButton,{label:"Copy",onPress:()=>n("copy"),children:_jsx(Copy,{size:13,color:night.color.textSecondary})}),_jsx(IconButton,{label:"Retry",onPress:()=>n("retry"),children:_jsx(RefreshCw,{size:13,color:night.color.textSecondary})}),_jsx(IconButton,{label:"Good answer",onPress:()=>{r("up"),n("thumbs up")},children:_jsx(Text,{style:[styles.glyph,"up"===o&&styles.glyphOn],children:"👍"})}),_jsx(IconButton,{label:"Bad answer",onPress:()=>{r("down"),n("thumbs down")},children:_jsx(Text,{style:[styles.glyph,"down"===o&&styles.glyphOn],children:"👎"})}),_jsx(IconButton,{label:"Export",onPress:()=>n("export transcript"),children:_jsx(Text,{style:styles.textBtn,children:"Export"})})]})}export function ReasoningStrip({text:e,live:t}){const[o,r]=useState(!1);return _jsxs(View,{style:styles.reasoning,testID:"chrome-reasoning",children:[_jsxs(Pressable,{onPress:()=>r(e=>!e),style:styles.reasoningHead,accessibilityRole:"button",accessibilityState:{expanded:o},children:[t?_jsx(ActivityIndicator,{size:"small",color:night.color.textTertiary}):null,_jsx(Text,{style:styles.reasoningTitle,children:t?"Working it out…":"How I got here"}),_jsx(o?ChevronDown:ChevronRight,{size:12,color:night.color.textTertiary})]}),o?_jsx(Text,{style:styles.reasoningBody,children:e}):null]})}export function ElapsedRow({label:e}){const[t,o]=useState(0);return useEffect(()=>{const e=setInterval(()=>o(e=>e+250),250);return()=>clearInterval(e)},[]),_jsxs(View,{style:styles.elapsed,testID:"chrome-elapsed",children:[_jsx(ActivityIndicator,{size:"small",color:night.color.textSecondary}),_jsx(Text,{style:styles.elapsedLabel,children:e}),_jsxs(Text,{style:styles.elapsedMs,children:[(t/1e3).toFixed(1),"s"]})]})}export function QueuedComposer(){const[e,t]=useState(""),[o,r]=useState(null);return _jsxs(View,{style:styles.composerWrap,testID:"chrome-queue",children:[o?_jsxs(View,{style:styles.queuedRow,children:[_jsxs(Text,{style:styles.queuedText,numberOfLines:1,children:['Queued: "',o,'"']}),_jsx(Pressable,{onPress:()=>r(null),children:_jsx(Text,{style:styles.queuedCancel,children:"Cancel"})})]}):null,_jsxs(View,{style:styles.composer,children:[_jsx(TextInput,{style:styles.composerInput,value:e,onChangeText:t,placeholder:"Agent is busy — type and it sends next",placeholderTextColor:night.color.placeholder}),_jsx(Pressable,{disabled:!e.trim(),onPress:()=>{r(e.trim()),t("")},style:[styles.queueBtn,!e.trim()&&{opacity:.5}],children:_jsx(Text,{style:styles.queueBtnText,children:"Queue"})})]})]})}export function ReloadDivider({at:e}){return _jsxs(View,{style:styles.divider,testID:"chrome-divider",children:[_jsx(View,{style:styles.dividerLine}),_jsxs(Text,{style:styles.dividerText,children:["App reloaded · ",e]}),_jsx(View,{style:styles.dividerLine})]})}export function Timestamp({at:e}){return _jsx(Text,{style:styles.timestamp,children:e})}export function EditableUserBubble({text:e}){const t=useBlockHandlers(),[o,r]=useState(!1),[n,i]=useState(e);return _jsx(View,{style:styles.userWrap,testID:"chrome-edit-bubble",children:o?_jsxs(View,{style:styles.editBox,children:[_jsx(TextInput,{style:styles.editInput,value:n,onChangeText:i,multiline:!0}),_jsxs(View,{style:styles.editActions,children:[_jsx(Pressable,{onPress:()=>{r(!1),t.runAction({label:"re-run edited",send:`__chrome__:re-run "${n}"`},"chrome-edit")},style:styles.editPrimary,children:_jsx(Text,{style:styles.editPrimaryText,children:"Re-run from here"})}),_jsx(Pressable,{onPress:()=>{r(!1),t.runAction({label:"branch",send:`__chrome__:branch "${n}"`},"chrome-edit")},style:styles.editPlate,children:_jsx(Text,{style:styles.editPlateText,children:"Branch"})}),_jsx(Pressable,{onPress:()=>r(!1),style:styles.editPlate,children:_jsx(Text,{style:styles.editPlateText,children:"Cancel"})})]})]}):_jsxs(Pressable,{onLongPress:()=>r(!0),onPress:()=>r(!0),style:styles.bubble,accessibilityRole:"button",accessibilityLabel:"Edit message",children:[_jsx(Text,{style:styles.bubbleText,children:n}),_jsx(Text,{style:styles.bubbleHint,children:"tap to edit · 2 branches"})]})})}const styles=StyleSheet.create({actions:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:2},iconBtn:{paddingHorizontal:8,paddingVertical:6,borderRadius:night.radius.badge},pressed:{backgroundColor:night.color.fill},glyph:{fontSize:13,opacity:.6},glyphOn:{opacity:1},textBtn:{color:night.color.textSecondary,fontSize:night.font.micro,fontWeight:"600"},reasoning:{borderRadius:night.radius.row,backgroundColor:night.color.fill,overflow:"hidden"},reasoningHead:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingVertical:8},reasoningTitle:{flex:1,color:night.color.textSecondary,fontSize:night.font.caption,fontStyle:"italic"},reasoningBody:{color:night.color.textSecondary,fontSize:night.font.caption,lineHeight:18,paddingHorizontal:12,paddingBottom:10},elapsed:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:10,borderRadius:night.radius.card,borderWidth:StyleSheet.hairlineWidth,borderColor:night.color.border,backgroundColor:night.color.surface},elapsedLabel:{flex:1,color:night.color.text,fontSize:night.font.body},elapsedMs:{color:night.color.textTertiary,fontSize:night.font.caption,fontFamily:"Menlo"},composerWrap:{gap:6},queuedRow:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingVertical:6,borderRadius:night.radius.row,backgroundColor:night.color.infoSoft},queuedText:{flex:1,color:night.color.text,fontSize:night.font.caption},queuedCancel:{color:night.color.info,fontSize:night.font.caption,fontWeight:"600"},composer:{flexDirection:"row",alignItems:"center",gap:8},composerInput:{flex:1,height:40,paddingHorizontal:16,borderRadius:20,borderWidth:StyleSheet.hairlineWidth,borderColor:night.color.border,backgroundColor:night.color.surfaceElevated,color:night.color.text,fontSize:night.font.body},queueBtn:{paddingHorizontal:14,height:40,borderRadius:20,backgroundColor:night.color.button,alignItems:"center",justifyContent:"center"},queueBtnText:{color:night.color.text,fontSize:night.font.caption,fontWeight:"600"},divider:{flexDirection:"row",alignItems:"center",gap:10,paddingVertical:4},dividerLine:{flex:1,height:StyleSheet.hairlineWidth,backgroundColor:night.color.border},dividerText:{color:night.color.textTertiary,fontSize:night.font.micro},timestamp:{alignSelf:"center",color:night.color.textTertiary,fontSize:night.font.micro},userWrap:{alignItems:"flex-end"},bubble:{maxWidth:"84%",paddingHorizontal:14,paddingVertical:9,borderRadius:18,borderBottomRightRadius:6,backgroundColor:night.color.accentFill,borderWidth:StyleSheet.hairlineWidth,borderColor:night.color.accentBorder,gap:4},bubbleText:{color:night.color.text,fontSize:night.font.row,lineHeight:21},bubbleHint:{color:night.color.textTertiary,fontSize:10,textAlign:"right"},editBox:{width:"100%",gap:8},editInput:{minHeight:60,padding:12,borderRadius:night.radius.row,backgroundColor:night.color.surfaceElevated,color:night.color.text,fontSize:night.font.row,borderWidth:StyleSheet.hairlineWidth,borderColor:night.color.accentBorderStrong},editActions:{flexDirection:"row",gap:8,justifyContent:"flex-end",flexWrap:"wrap"},editPrimary:{paddingHorizontal:12,paddingVertical:8,borderRadius:night.radius.row,backgroundColor:night.color.accent},editPrimaryText:{color:night.color.onAccent,fontSize:night.font.caption,fontWeight:"600"},editPlate:{paddingHorizontal:12,paddingVertical:8,borderRadius:night.radius.row,backgroundColor:night.color.button},editPlateText:{color:night.color.text,fontSize:night.font.caption,fontWeight:"600"}});