@buoy-gg/ask-buoy 7.0.35 → 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 (286) hide show
  1. package/README.md +73 -15
  2. package/lib/commonjs/blocks/AskBlocks.js +1 -338
  3. package/lib/commonjs/blocks/BlockRenderer.js +1 -250
  4. package/lib/commonjs/blocks/ChromePrototypes.js +1 -514
  5. package/lib/commonjs/blocks/DataBlocks.js +1 -688
  6. package/lib/commonjs/blocks/ExtraBlocks.js +1 -1854
  7. package/lib/commonjs/blocks/MediaBlocks.js +1 -140
  8. package/lib/commonjs/blocks/ReceiptBlocks.js +1 -586
  9. package/lib/commonjs/blocks/blockText.js +1 -0
  10. package/lib/commonjs/blocks/blockText.test.js +1 -0
  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 -401
  18. package/lib/commonjs/blocks/primitivesIndex.js +1 -62
  19. package/lib/commonjs/components/ApprovalCard.js +1 -140
  20. package/lib/commonjs/components/AskBuoyHeader.js +1 -164
  21. package/lib/commonjs/components/AskBuoyIcon.js +1 -19
  22. package/lib/commonjs/components/AskBuoyModal.js +1 -353
  23. package/lib/commonjs/components/AskBuoySettings.js +1 -69
  24. package/lib/commonjs/components/ChangesBar.js +1 -211
  25. package/lib/commonjs/components/Composer.js +1 -175
  26. package/lib/commonjs/components/EmptyState.js +1 -154
  27. package/lib/commonjs/components/KeyboardPad.js +1 -0
  28. package/lib/commonjs/components/Markdown.js +1 -252
  29. package/lib/commonjs/components/MessageList.js +1 -683
  30. package/lib/commonjs/components/QueuedMessages.js +1 -0
  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 -0
  34. package/lib/commonjs/components/markdownParse.test.js +1 -0
  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 -0
  39. package/lib/commonjs/store/activityGroups.test.js +1 -0
  40. package/lib/commonjs/store/askBuoySettings.js +1 -67
  41. package/lib/commonjs/store/askBuoyStore.js +1 -365
  42. package/lib/commonjs/store/blockPlacement.js +1 -0
  43. package/lib/commonjs/store/blockPlacement.test.js +1 -0
  44. package/lib/commonjs/store/queue.test.js +1 -0
  45. package/lib/commonjs/store/resetConversation.js +1 -0
  46. package/lib/commonjs/store/restorePending.test.js +1 -0
  47. package/lib/commonjs/store/restoredIds.test.js +1 -47
  48. package/lib/commonjs/store/suggestions.js +1 -0
  49. package/lib/commonjs/store/suggestions.test.js +1 -0
  50. package/lib/commonjs/store/systemLine.test.js +1 -0
  51. package/lib/commonjs/store/ticketPrompt.js +1 -0
  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 -208
  55. package/lib/commonjs/store/transcriptPersistence.test.js +1 -185
  56. package/lib/commonjs/store/turnRendering.test.js +1 -0
  57. package/lib/commonjs/store/useAskBuoy.js +1 -400
  58. package/lib/commonjs/store/useAskBuoySettings.js +1 -14
  59. package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -119
  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 -245
  65. package/lib/module/blocks/ChromePrototypes.js +1 -503
  66. package/lib/module/blocks/DataBlocks.js +1 -674
  67. package/lib/module/blocks/ExtraBlocks.js +1 -1827
  68. package/lib/module/blocks/MediaBlocks.js +1 -135
  69. package/lib/module/blocks/ReceiptBlocks.js +1 -574
  70. package/lib/module/blocks/blockText.js +1 -0
  71. package/lib/module/blocks/blockText.test.js +1 -0
  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 -389
  79. package/lib/module/blocks/primitivesIndex.js +1 -5
  80. package/lib/module/components/ApprovalCard.js +1 -135
  81. package/lib/module/components/AskBuoyHeader.js +1 -161
  82. package/lib/module/components/AskBuoyIcon.js +1 -8
  83. package/lib/module/components/AskBuoyModal.js +1 -348
  84. package/lib/module/components/AskBuoySettings.js +1 -64
  85. package/lib/module/components/ChangesBar.js +1 -206
  86. package/lib/module/components/Composer.js +1 -170
  87. package/lib/module/components/EmptyState.js +1 -149
  88. package/lib/module/components/KeyboardPad.js +1 -0
  89. package/lib/module/components/Markdown.js +1 -246
  90. package/lib/module/components/MessageList.js +1 -677
  91. package/lib/module/components/QueuedMessages.js +1 -0
  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 -0
  95. package/lib/module/components/markdownParse.test.js +1 -0
  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 -0
  100. package/lib/module/store/activityGroups.test.js +1 -0
  101. package/lib/module/store/askBuoySettings.js +1 -62
  102. package/lib/module/store/askBuoyStore.js +1 -361
  103. package/lib/module/store/blockPlacement.js +1 -0
  104. package/lib/module/store/blockPlacement.test.js +1 -0
  105. package/lib/module/store/queue.test.js +1 -0
  106. package/lib/module/store/resetConversation.js +1 -0
  107. package/lib/module/store/restorePending.test.js +1 -0
  108. package/lib/module/store/restoredIds.test.js +1 -46
  109. package/lib/module/store/suggestions.js +1 -0
  110. package/lib/module/store/suggestions.test.js +1 -0
  111. package/lib/module/store/systemLine.test.js +1 -0
  112. package/lib/module/store/ticketPrompt.js +1 -0
  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 -198
  116. package/lib/module/store/transcriptPersistence.test.js +1 -184
  117. package/lib/module/store/turnRendering.test.js +1 -0
  118. package/lib/module/store/useAskBuoy.js +1 -394
  119. package/lib/module/store/useAskBuoySettings.js +1 -9
  120. package/lib/module/sync/askBuoySyncAdapter.js +1 -114
  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/blocks/DataBlocks.d.ts +11 -0
  125. package/lib/typescript/blocks/ExtraBlocks.d.ts +18 -2
  126. package/lib/typescript/blocks/blockText.d.ts +14 -0
  127. package/lib/typescript/blocks/blockText.test.d.ts +2 -0
  128. package/lib/typescript/blocks/primitives.d.ts +16 -1
  129. package/lib/typescript/components/ApprovalCard.d.ts +9 -1
  130. package/lib/typescript/components/AskBuoyHeader.d.ts +31 -1
  131. package/lib/typescript/components/Composer.d.ts +16 -1
  132. package/lib/typescript/components/EmptyState.d.ts +5 -1
  133. package/lib/typescript/components/KeyboardPad.d.ts +33 -0
  134. package/lib/typescript/components/Markdown.d.ts +0 -10
  135. package/lib/typescript/components/MessageList.d.ts +7 -2
  136. package/lib/typescript/components/QueuedMessages.d.ts +10 -0
  137. package/lib/typescript/components/markdownParse.d.ts +49 -0
  138. package/lib/typescript/components/markdownParse.test.d.ts +2 -0
  139. package/lib/typescript/preset.d.ts +4 -2
  140. package/lib/typescript/store/activityGroups.d.ts +29 -0
  141. package/lib/typescript/store/activityGroups.test.d.ts +2 -0
  142. package/lib/typescript/store/askBuoySettings.d.ts +22 -0
  143. package/lib/typescript/store/askBuoyStore.d.ts +174 -9
  144. package/lib/typescript/store/blockPlacement.d.ts +30 -0
  145. package/lib/typescript/store/blockPlacement.test.d.ts +2 -0
  146. package/lib/typescript/store/queue.test.d.ts +2 -0
  147. package/lib/typescript/store/resetConversation.d.ts +38 -0
  148. package/lib/typescript/store/restorePending.test.d.ts +2 -0
  149. package/lib/typescript/store/suggestions.d.ts +32 -0
  150. package/lib/typescript/store/suggestions.test.d.ts +2 -0
  151. package/lib/typescript/store/systemLine.test.d.ts +2 -0
  152. package/lib/typescript/store/ticketPrompt.d.ts +11 -0
  153. package/lib/typescript/store/transcriptPersistence.d.ts +41 -2
  154. package/lib/typescript/store/turnRendering.test.d.ts +2 -0
  155. package/lib/typescript/store/useAskBuoy.d.ts +26 -3
  156. package/lib/typescript/sync/askBuoySyncAdapter.d.ts +29 -6
  157. package/package.json +10 -10
  158. package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
  159. package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
  160. package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
  161. package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
  162. package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
  163. package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
  164. package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
  165. package/lib/commonjs/blocks/context.js.map +0 -1
  166. package/lib/commonjs/blocks/icons.js.map +0 -1
  167. package/lib/commonjs/blocks/index.js.map +0 -1
  168. package/lib/commonjs/blocks/listRow.test.js.map +0 -1
  169. package/lib/commonjs/blocks/pageState.js.map +0 -1
  170. package/lib/commonjs/blocks/pageState.test.js.map +0 -1
  171. package/lib/commonjs/blocks/primitives.js.map +0 -1
  172. package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
  173. package/lib/commonjs/components/ApprovalCard.js.map +0 -1
  174. package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
  175. package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
  176. package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
  177. package/lib/commonjs/components/AskBuoySettings.js.map +0 -1
  178. package/lib/commonjs/components/ChangesBar.js.map +0 -1
  179. package/lib/commonjs/components/Composer.js.map +0 -1
  180. package/lib/commonjs/components/EmptyState.js.map +0 -1
  181. package/lib/commonjs/components/Markdown.js.map +0 -1
  182. package/lib/commonjs/components/MessageList.js.map +0 -1
  183. package/lib/commonjs/components/ThinkingStrip.js.map +0 -1
  184. package/lib/commonjs/components/TypingDots.js.map +0 -1
  185. package/lib/commonjs/components/useCopyAction.js.map +0 -1
  186. package/lib/commonjs/index.js.map +0 -1
  187. package/lib/commonjs/preset.js.map +0 -1
  188. package/lib/commonjs/store/askBuoySettings.js.map +0 -1
  189. package/lib/commonjs/store/askBuoyStore.js.map +0 -1
  190. package/lib/commonjs/store/restoredIds.test.js.map +0 -1
  191. package/lib/commonjs/store/traceText.js.map +0 -1
  192. package/lib/commonjs/store/traceText.test.js.map +0 -1
  193. package/lib/commonjs/store/transcriptPersistence.js.map +0 -1
  194. package/lib/commonjs/store/transcriptPersistence.test.js.map +0 -1
  195. package/lib/commonjs/store/useAskBuoy.js.map +0 -1
  196. package/lib/commonjs/store/useAskBuoySettings.js.map +0 -1
  197. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
  198. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
  199. package/lib/commonjs/sync/wire.js.map +0 -1
  200. package/lib/commonjs/types.js.map +0 -1
  201. package/lib/module/blocks/AskBlocks.js.map +0 -1
  202. package/lib/module/blocks/BlockRenderer.js.map +0 -1
  203. package/lib/module/blocks/ChromePrototypes.js.map +0 -1
  204. package/lib/module/blocks/DataBlocks.js.map +0 -1
  205. package/lib/module/blocks/ExtraBlocks.js.map +0 -1
  206. package/lib/module/blocks/MediaBlocks.js.map +0 -1
  207. package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
  208. package/lib/module/blocks/context.js.map +0 -1
  209. package/lib/module/blocks/icons.js.map +0 -1
  210. package/lib/module/blocks/index.js.map +0 -1
  211. package/lib/module/blocks/listRow.test.js.map +0 -1
  212. package/lib/module/blocks/pageState.js.map +0 -1
  213. package/lib/module/blocks/pageState.test.js.map +0 -1
  214. package/lib/module/blocks/primitives.js.map +0 -1
  215. package/lib/module/blocks/primitivesIndex.js.map +0 -1
  216. package/lib/module/components/ApprovalCard.js.map +0 -1
  217. package/lib/module/components/AskBuoyHeader.js.map +0 -1
  218. package/lib/module/components/AskBuoyIcon.js.map +0 -1
  219. package/lib/module/components/AskBuoyModal.js.map +0 -1
  220. package/lib/module/components/AskBuoySettings.js.map +0 -1
  221. package/lib/module/components/ChangesBar.js.map +0 -1
  222. package/lib/module/components/Composer.js.map +0 -1
  223. package/lib/module/components/EmptyState.js.map +0 -1
  224. package/lib/module/components/Markdown.js.map +0 -1
  225. package/lib/module/components/MessageList.js.map +0 -1
  226. package/lib/module/components/ThinkingStrip.js.map +0 -1
  227. package/lib/module/components/TypingDots.js.map +0 -1
  228. package/lib/module/components/useCopyAction.js.map +0 -1
  229. package/lib/module/index.js.map +0 -1
  230. package/lib/module/preset.js.map +0 -1
  231. package/lib/module/store/askBuoySettings.js.map +0 -1
  232. package/lib/module/store/askBuoyStore.js.map +0 -1
  233. package/lib/module/store/restoredIds.test.js.map +0 -1
  234. package/lib/module/store/traceText.js.map +0 -1
  235. package/lib/module/store/traceText.test.js.map +0 -1
  236. package/lib/module/store/transcriptPersistence.js.map +0 -1
  237. package/lib/module/store/transcriptPersistence.test.js.map +0 -1
  238. package/lib/module/store/useAskBuoy.js.map +0 -1
  239. package/lib/module/store/useAskBuoySettings.js.map +0 -1
  240. package/lib/module/sync/askBuoySyncAdapter.js.map +0 -1
  241. package/lib/module/sync/askBuoySyncAdapter.test.js.map +0 -1
  242. package/lib/module/sync/wire.js.map +0 -1
  243. package/lib/module/types.js.map +0 -1
  244. package/lib/typescript/blocks/AskBlocks.d.ts.map +0 -1
  245. package/lib/typescript/blocks/BlockRenderer.d.ts.map +0 -1
  246. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +0 -1
  247. package/lib/typescript/blocks/DataBlocks.d.ts.map +0 -1
  248. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +0 -1
  249. package/lib/typescript/blocks/MediaBlocks.d.ts.map +0 -1
  250. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +0 -1
  251. package/lib/typescript/blocks/context.d.ts.map +0 -1
  252. package/lib/typescript/blocks/icons.d.ts.map +0 -1
  253. package/lib/typescript/blocks/index.d.ts.map +0 -1
  254. package/lib/typescript/blocks/listRow.test.d.ts.map +0 -1
  255. package/lib/typescript/blocks/pageState.d.ts.map +0 -1
  256. package/lib/typescript/blocks/pageState.test.d.ts.map +0 -1
  257. package/lib/typescript/blocks/primitives.d.ts.map +0 -1
  258. package/lib/typescript/blocks/primitivesIndex.d.ts.map +0 -1
  259. package/lib/typescript/components/ApprovalCard.d.ts.map +0 -1
  260. package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
  261. package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
  262. package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
  263. package/lib/typescript/components/AskBuoySettings.d.ts.map +0 -1
  264. package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
  265. package/lib/typescript/components/Composer.d.ts.map +0 -1
  266. package/lib/typescript/components/EmptyState.d.ts.map +0 -1
  267. package/lib/typescript/components/Markdown.d.ts.map +0 -1
  268. package/lib/typescript/components/MessageList.d.ts.map +0 -1
  269. package/lib/typescript/components/ThinkingStrip.d.ts.map +0 -1
  270. package/lib/typescript/components/TypingDots.d.ts.map +0 -1
  271. package/lib/typescript/components/useCopyAction.d.ts.map +0 -1
  272. package/lib/typescript/index.d.ts.map +0 -1
  273. package/lib/typescript/preset.d.ts.map +0 -1
  274. package/lib/typescript/store/askBuoySettings.d.ts.map +0 -1
  275. package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
  276. package/lib/typescript/store/restoredIds.test.d.ts.map +0 -1
  277. package/lib/typescript/store/traceText.d.ts.map +0 -1
  278. package/lib/typescript/store/traceText.test.d.ts.map +0 -1
  279. package/lib/typescript/store/transcriptPersistence.d.ts.map +0 -1
  280. package/lib/typescript/store/transcriptPersistence.test.d.ts.map +0 -1
  281. package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
  282. package/lib/typescript/store/useAskBuoySettings.d.ts.map +0 -1
  283. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
  284. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
  285. package/lib/typescript/sync/wire.d.ts.map +0 -1
  286. package/lib/typescript/types.d.ts.map +0 -1
@@ -1,64 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * The sheet's settings, reached from the header.
5
- *
6
- * A view inside the sheet rather than a second modal: a settings panel that
7
- * covers the conversation you are configuring makes the effect of a toggle
8
- * invisible until you dismiss it. Back returns to the chat with the
9
- * transcript exactly where it was.
10
- *
11
- * Sections are by subject, not by implementation. "Chat" is what a tester
12
- * calls the thing they are looking at.
13
- */
14
- import { ScrollView, StyleSheet, Text } from "react-native";
15
- import { night, ToggleRow } from "@buoy-gg/shared-ui";
16
- import { useAskBuoySettings } from "../store/useAskBuoySettings";
17
- import { askBuoySettings } from "../store/askBuoySettings";
18
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
- export function AskBuoySettings() {
20
- const settings = useAskBuoySettings();
21
- return /*#__PURE__*/_jsxs(ScrollView, {
22
- style: styles.scroll,
23
- contentContainerStyle: styles.content,
24
- testID: "buoy-ask-buoy-settings",
25
- children: [/*#__PURE__*/_jsx(Text, {
26
- style: styles.section,
27
- children: "CHAT"
28
- }), /*#__PURE__*/_jsx(ToggleRow, {
29
- testID: "buoy-ask-buoy-setting-thinking",
30
- label: "Show agent thinking",
31
- description: "Adds a collapsed strip under each answer: the model's reasoning, and every step it ran with its parameters, result, duration and token cost. Copy includes the steps and reasoning while this is on, so you can read the run outside the app.",
32
- value: settings.showThinking,
33
- onValueChange: next => askBuoySettings.set("showThinking", next)
34
- }), /*#__PURE__*/_jsx(Text, {
35
- style: styles.note,
36
- children: "Not every model reports reasoning. Claude thinks by default; most OpenAI models return none, and the strip then shows the steps alone."
37
- })]
38
- });
39
- }
40
- const styles = StyleSheet.create({
41
- scroll: {
42
- flex: 1
43
- },
44
- content: {
45
- padding: night.gutter,
46
- gap: 10,
47
- paddingBottom: 32
48
- },
49
- section: {
50
- color: night.color.textTertiary,
51
- fontSize: 10,
52
- fontWeight: "700",
53
- letterSpacing: 0.6,
54
- paddingHorizontal: 4,
55
- paddingTop: 4
56
- },
57
- note: {
58
- color: night.color.textTertiary,
59
- fontSize: night.font.micro,
60
- lineHeight: 16,
61
- paddingHorizontal: 4
62
- }
63
- });
64
- //# sourceMappingURL=AskBuoySettings.js.map
1
+ "use strict";import{Pressable,ScrollView,StyleSheet,Text,View}from"react-native";import{AlertTriangle,night,ToggleRow}from"@buoy-gg/shared-ui";import{useAskBuoySettings}from"../store/useAskBuoySettings";import{askBuoySettings}from"../store/askBuoySettings";import{askBuoyStore}from"../store/askBuoyStore";import{useAskBuoyState}from"../store/useAskBuoy";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function AskBuoySettings(){const e=useAskBuoySettings(),t=useAskBuoyState().trusted;return _jsxs(ScrollView,{style:styles.scroll,contentContainerStyle:styles.content,testID:"buoy-ask-buoy-settings",children:[_jsx(Text,{style:styles.section,children:"CHAT"}),_jsx(ToggleRow,{testID:"buoy-ask-buoy-setting-thinking",label:"Show agent thinking",description:"Adds a collapsed strip under each answer: the model's reasoning, and every step it ran with its parameters, result, duration and token cost. Copy includes the steps and reasoning while this is on, so you can read the run outside the app.",value:e.showThinking,onValueChange:e=>askBuoySettings.set("showThinking",e)}),_jsx(Text,{style:styles.note,children:"Not every model reports reasoning. Claude thinks by default; most OpenAI models return none, and the strip then shows the steps alone."}),_jsx(Text,{style:styles.section,children:"PERMISSIONS"}),_jsx(ToggleRow,{testID:"buoy-ask-buoy-setting-readonly",label:"Read only",description:"Inspect the app, change nothing. Every write and simulation is refused until this is off. Undo still works — putting things back is the safe direction.",value:e.readOnly,onValueChange:e=>askBuoySettings.set("readOnly",e)}),e.readOnly?_jsx(Text,{style:styles.note,testID:"buoy-ask-buoy-readonly-note",children:"On across reloads until you turn it off here. The header says “Read only” while it is on. It adds to whatever this app already restricts — it never loosens anything."}):null,_jsx(ToggleRow,{testID:"buoy-ask-buoy-setting-bypass",tone:"warning",emphasizeLabel:e.bypassApprovals,disabled:e.readOnly,label:"Skip approval prompts",description:e.readOnly?"Unavailable while Read only is on — nothing can be approved.":"Runs every action the moment the agent calls it, with no Allow card — including the destructive ones that wipe or reset data.",value:e.bypassApprovals,onValueChange:e=>askBuoySettings.set("bypassApprovals",e)}),e.bypassApprovals&&!e.readOnly?_jsxs(View,{style:styles.warning,testID:"buoy-ask-buoy-bypass-warning",children:[_jsx(AlertTriangle,{size:14,color:night.color.warning}),_jsx(Text,{style:styles.warningText,children:"Nothing will ask before a change lands. A wipe or a reset runs on the model's word alone, and Undo only reverses the changes that can be reversed — the bar tells you which. This stays on across reloads and app restarts until you turn it off here, so leave it off on any device holding data you care about. It does not widen what the agent may reach: read-only mode, this app's deny list and the release-build refusals still apply."})]}):_jsx(Text,{style:styles.note,children:"On by default for destructive actions only — reads and ordinary writes already run without asking, and the changes bar records them."}),t.length>0?_jsxs(View,{style:styles.trustedBox,testID:"buoy-ask-buoy-trusted",children:[_jsx(Text,{style:styles.section,children:"ALLOWED WITHOUT ASKING — THIS CHAT"}),t.map(e=>_jsxs(View,{style:styles.trustedRow,children:[_jsx(Text,{style:styles.trustedLabel,numberOfLines:2,children:e.label}),_jsx(Pressable,{testID:`buoy-ask-buoy-untrust-${e.key}`,accessibilityRole:"button",onPress:()=>askBuoyStore.untrust(e.key),style:({pressed:e})=>[styles.forget,e&&{opacity:.7}],hitSlop:6,children:_jsx(Text,{style:styles.forgetText,children:"Ask again"})})]},e.key))]}):null]})}const styles=StyleSheet.create({scroll:{flex:1},content:{padding:night.gutter,gap:10,paddingBottom:32},section:{color:night.color.textTertiary,fontSize:10,fontWeight:"700",letterSpacing:.6,paddingHorizontal:4,paddingTop:4},warning:{flexDirection:"row",gap:8,padding:night.cardPad,borderRadius:night.radius.card,borderWidth:StyleSheet.hairlineWidth,borderColor:night.color.warning,backgroundColor:night.color.surface},warningText:{flex:1,color:night.color.warning,fontSize:night.font.micro,lineHeight:16},trustedBox:{gap:6,paddingTop:6},trustedRow:{flexDirection:"row",alignItems:"center",gap:10,padding:night.cardPad,borderRadius:night.radius.card,borderWidth:StyleSheet.hairlineWidth,borderColor:night.color.border,backgroundColor:night.color.surface},trustedLabel:{flex:1,color:night.color.text,fontSize:night.font.caption,lineHeight:18},forget:{paddingHorizontal:10,paddingVertical:6,borderRadius:night.radius.row,backgroundColor:night.color.button},forgetText:{color:night.color.text,fontSize:night.font.micro,fontWeight:"600"},note:{color:night.color.textTertiary,fontSize:night.font.micro,lineHeight:16,paddingHorizontal:4}});
@@ -1,206 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * "The agent changed things" — the bar, and the list behind it.
5
- *
6
- * Ask Buoy mutates without asking, so this is what keeps the user in control:
7
- * if reality has been bent, you can never not know it. Same principle as the
8
- * impersonate and override banners.
9
- *
10
- * It counts REVERSIBLE and ONE-SHOT effects separately, which is the one place
11
- * this deliberately differs from the Scenarios banner. That one folds
12
- * transients into a single "N changes" total and then silently no-ops on them
13
- * at revert — a user who taps Undo, sees "4 changes", and finds three of them
14
- * still in place learns not to trust the bar. Better to say "1 undoable ·
15
- * 1 permanent" and be believed.
16
- */
17
- import { useSyncExternalStore } from "react";
18
- import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native";
19
- import { ChevronDown, ChevronRight, night } from "@buoy-gg/shared-ui";
20
- import { isReversible } from "@buoy-gg/agent-core";
21
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
- const EMPTY = [];
23
- function useLedgerEntries(ledger) {
24
- return useSyncExternalStore(fn => ledger?.subscribe(fn) ?? (() => {}), () => ledger?.list() ?? EMPTY, () => ledger?.list() ?? EMPTY);
25
- }
26
- export function ChangesBar({
27
- ledger,
28
- onUndoAll,
29
- expanded,
30
- onToggle
31
- }) {
32
- const entries = useLedgerEntries(ledger);
33
- const outstanding = entries.filter(e => !e.undoneAt);
34
- // Transients — navigation, taps — are one-shot ACTIONS, not changes. Counting
35
- // them here read "Changed this app · 9 permanent" after a read-only tour,
36
- // which is the bar lying in the alarming direction. They still appear in the
37
- // expanded panel's footnote, because honesty, but they raise no banner.
38
- const changes = outstanding.filter(e => e.effect.kind !== "transient");
39
- if (changes.length === 0) return null;
40
- const reversible = changes.filter(e => isReversible(e.effect));
41
- const permanent = changes.length - reversible.length;
42
- const transients = outstanding.length - changes.length;
43
- const Chevron = expanded ? ChevronDown : ChevronRight;
44
- const counts = [reversible.length > 0 ? `${reversible.length} undoable` : null, permanent > 0 ? `${permanent} permanent` : null].filter(Boolean).join(" · ");
45
- return /*#__PURE__*/_jsxs(View, {
46
- style: styles.wrap,
47
- children: [/*#__PURE__*/_jsxs(Pressable, {
48
- testID: "buoy-ask-buoy-changes-bar",
49
- accessibilityRole: "button",
50
- accessibilityState: {
51
- expanded
52
- },
53
- onPress: onToggle,
54
- style: styles.bar,
55
- children: [/*#__PURE__*/_jsx(View, {
56
- style: styles.dot
57
- }), /*#__PURE__*/_jsx(Text, {
58
- style: styles.summary,
59
- numberOfLines: 1,
60
- children: "Changed this app"
61
- }), /*#__PURE__*/_jsx(Text, {
62
- style: styles.counts,
63
- numberOfLines: 1,
64
- children: counts
65
- }), /*#__PURE__*/_jsx(Chevron, {
66
- size: 12,
67
- color: night.color.textSecondary
68
- })]
69
- }), expanded && /*#__PURE__*/_jsxs(View, {
70
- style: styles.panel,
71
- children: [/*#__PURE__*/_jsxs(ScrollView, {
72
- style: styles.panelScroll,
73
- testID: "buoy-ask-buoy-changes-scroll",
74
- keyboardShouldPersistTaps: "handled",
75
- children: [changes.map(entry => {
76
- const oneOff = !isReversible(entry.effect);
77
- return /*#__PURE__*/_jsxs(View, {
78
- style: styles.row,
79
- children: [/*#__PURE__*/_jsx(Text, {
80
- style: styles.rowLabel,
81
- children: entry.effect.label
82
- }), /*#__PURE__*/_jsx(Text, {
83
- style: [styles.rowTag, oneOff && styles.rowTagMuted],
84
- children: oneOff ? "Permanent" : "Undoable"
85
- })]
86
- }, entry.id);
87
- }), transients > 0 && /*#__PURE__*/_jsx(View, {
88
- style: styles.row,
89
- children: /*#__PURE__*/_jsxs(Text, {
90
- style: [styles.rowLabel, styles.rowLabelMuted],
91
- children: ["Also did ", transients, " one-shot action", transients === 1 ? "" : "s", " (navigation, taps) \u2014 nothing to undo."]
92
- })
93
- })]
94
- }), /*#__PURE__*/_jsxs(View, {
95
- style: styles.footer,
96
- children: [reversible.length > 0 && /*#__PURE__*/_jsx(Pressable, {
97
- testID: "buoy-ask-buoy-undo-all",
98
- accessibilityRole: "button",
99
- onPress: onUndoAll,
100
- style: ({
101
- pressed
102
- }) => [styles.undo, pressed && styles.pressed],
103
- children: /*#__PURE__*/_jsxs(Text, {
104
- style: styles.undoText,
105
- children: ["Undo ", reversible.length, " change", reversible.length === 1 ? "" : "s"]
106
- })
107
- }), permanent > 0 && /*#__PURE__*/_jsx(Text, {
108
- style: styles.footnote,
109
- children: "Permanent changes can't be undone from here."
110
- })]
111
- })]
112
- })]
113
- });
114
- }
115
- const styles = StyleSheet.create({
116
- wrap: {
117
- borderBottomWidth: StyleSheet.hairlineWidth,
118
- borderBottomColor: night.color.border,
119
- backgroundColor: night.color.warningSoft
120
- },
121
- bar: {
122
- flexDirection: "row",
123
- alignItems: "center",
124
- gap: 8,
125
- paddingHorizontal: night.gutter,
126
- paddingVertical: 10
127
- },
128
- dot: {
129
- width: 7,
130
- height: 7,
131
- borderRadius: 4,
132
- backgroundColor: night.color.warning
133
- },
134
- summary: {
135
- color: night.color.text,
136
- fontSize: night.font.caption,
137
- fontWeight: "600"
138
- },
139
- counts: {
140
- flex: 1,
141
- color: night.color.textSecondary,
142
- fontSize: night.font.caption
143
- },
144
- panel: {
145
- paddingHorizontal: night.gutter,
146
- paddingBottom: 12,
147
- gap: 10
148
- },
149
- panelScroll: {
150
- maxHeight: 180
151
- },
152
- row: {
153
- flexDirection: "row",
154
- alignItems: "flex-start",
155
- gap: 10,
156
- paddingVertical: 8,
157
- borderTopWidth: StyleSheet.hairlineWidth,
158
- borderTopColor: night.color.separator
159
- },
160
- rowLabel: {
161
- flex: 1,
162
- color: night.color.text,
163
- fontSize: night.font.caption,
164
- lineHeight: 18
165
- },
166
- rowTag: {
167
- color: night.color.accent,
168
- fontSize: night.font.micro,
169
- fontWeight: "600",
170
- letterSpacing: 0.6,
171
- textTransform: "uppercase",
172
- paddingTop: 2
173
- },
174
- rowTagMuted: {
175
- color: night.color.textTertiary
176
- },
177
- rowLabelMuted: {
178
- color: night.color.textTertiary
179
- },
180
- footer: {
181
- flexDirection: "row",
182
- alignItems: "center",
183
- gap: 12,
184
- flexWrap: "wrap"
185
- },
186
- undo: {
187
- paddingHorizontal: 14,
188
- paddingVertical: 8,
189
- borderRadius: night.radius.row,
190
- backgroundColor: night.color.button
191
- },
192
- undoText: {
193
- color: night.color.accent,
194
- fontSize: night.font.caption,
195
- fontWeight: "600"
196
- },
197
- footnote: {
198
- flex: 1,
199
- color: night.color.textTertiary,
200
- fontSize: night.font.micro
201
- },
202
- pressed: {
203
- opacity: 0.7
204
- }
205
- });
206
- //# sourceMappingURL=ChangesBar.js.map
1
+ "use strict";import{useSyncExternalStore}from"react";import{Pressable,ScrollView,StyleSheet,Text,View}from"react-native";import{ChevronDown,ChevronRight,night}from"@buoy-gg/shared-ui";import{isReversible}from"@buoy-gg/agent-core";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const EMPTY=[];function useLedgerEntries(e){return useSyncExternalStore(t=>e?.subscribe(t)??(()=>{}),()=>e?.list()??EMPTY,()=>e?.list()??EMPTY)}export function ChangesBar({ledger:e,onUndoAll:t,expanded:o,onToggle:n}){const r=useLedgerEntries(e).filter(e=>!e.undoneAt),s=r.filter(e=>"transient"!==e.effect.kind);if(0===s.length)return null;const l=s.filter(e=>isReversible(e.effect)),i=s.length-l.length,a=r.length-s.length,c=o?ChevronDown:ChevronRight,d=[l.length>0?`${l.length} undoable`:null,i>0?`${i} permanent`:null].filter(Boolean).join(" · ");return _jsxs(View,{style:styles.wrap,children:[_jsxs(Pressable,{testID:"buoy-ask-buoy-changes-bar",accessibilityRole:"button",accessibilityState:{expanded:o},onPress:n,style:styles.bar,children:[_jsx(View,{style:styles.dot}),_jsx(Text,{style:styles.summary,numberOfLines:1,children:"Changed this app"}),_jsx(Text,{style:styles.counts,numberOfLines:1,children:d}),_jsx(c,{size:12,color:night.color.textSecondary})]}),o&&_jsxs(View,{style:styles.panel,children:[_jsxs(ScrollView,{style:styles.panelScroll,testID:"buoy-ask-buoy-changes-scroll",keyboardShouldPersistTaps:"handled",children:[s.map(e=>{const t=!isReversible(e.effect);return _jsxs(View,{style:styles.row,children:[_jsx(Text,{style:styles.rowLabel,children:e.effect.label}),_jsx(Text,{style:[styles.rowTag,t&&styles.rowTagMuted],children:t?"Permanent":"Undoable"})]},e.id)}),a>0&&_jsx(View,{style:styles.row,children:_jsxs(Text,{style:[styles.rowLabel,styles.rowLabelMuted],children:["Also did ",a," one-shot action",1===a?"":"s"," (navigation, taps) — nothing to undo."]})})]}),_jsxs(View,{style:styles.footer,children:[l.length>0&&_jsx(Pressable,{testID:"buoy-ask-buoy-undo-all",accessibilityRole:"button",onPress:t,style:({pressed:e})=>[styles.undo,e&&styles.pressed],children:_jsxs(Text,{style:styles.undoText,children:["Undo ",l.length," change",1===l.length?"":"s"]})}),i>0&&_jsx(Text,{style:styles.footnote,children:"Permanent changes can't be undone from here."})]})]})]})}const styles=StyleSheet.create({wrap:{borderBottomWidth:StyleSheet.hairlineWidth,borderBottomColor:night.color.border,backgroundColor:night.color.warningSoft},bar:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:night.gutter,paddingVertical:10},dot:{width:7,height:7,borderRadius:4,backgroundColor:night.color.warning},summary:{color:night.color.text,fontSize:night.font.caption,fontWeight:"600"},counts:{flex:1,color:night.color.textSecondary,fontSize:night.font.caption},panel:{paddingHorizontal:night.gutter,paddingBottom:12,gap:10},panelScroll:{maxHeight:180},row:{flexDirection:"row",alignItems:"flex-start",gap:10,paddingVertical:8,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:night.color.separator},rowLabel:{flex:1,color:night.color.text,fontSize:night.font.caption,lineHeight:18},rowTag:{color:night.color.accent,fontSize:night.font.micro,fontWeight:"600",letterSpacing:.6,textTransform:"uppercase",paddingTop:2},rowTagMuted:{color:night.color.textTertiary},rowLabelMuted:{color:night.color.textTertiary},footer:{flexDirection:"row",alignItems:"center",gap:12,flexWrap:"wrap"},undo:{paddingHorizontal:14,paddingVertical:8,borderRadius:night.radius.row,backgroundColor:night.color.button},undoText:{color:night.color.accent,fontSize:night.font.caption,fontWeight:"600"},footnote:{flex:1,color:night.color.textTertiary,fontSize:night.font.micro},pressed:{opacity:.7}});
@@ -1,170 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * The message box.
5
- *
6
- * This is the first keyboard-safe BOTTOM input in Buoy, and the reason none
7
- * existed before is that JsModal has no keyboard handling at all: the sheet is
8
- * `position:absolute; bottom:0` inside the app tree, not an RN `Modal`, so on
9
- * iOS the keyboard simply draws over it. Two other tools hit this and chose to
10
- * dodge it — NetworkNumberPrompt and StorageValueEditModal both say so in
11
- * comments and pin their inputs to the TOP of the screen. A chat cannot.
12
- *
13
- * What makes it work:
14
- * - `KeyboardAvoidingView` with `behavior="padding"`, iOS only. On Android
15
- * Expo's default `softwareKeyboardLayoutMode: "resize"` shrinks the window
16
- * and a bottom-anchored view rides up for free; adding padding there would
17
- * lift it twice.
18
- * - The parent list carries `keyboardShouldPersistTaps="handled"`. Without it
19
- * the first tap after typing only dismisses the keyboard and Send never
20
- * fires — a real shipped bug in Time Machine, and invisible to Detox because
21
- * `replaceText` opens no keyboard.
22
- * - `keyboardType="ascii-capable"`, because iOS Smart Punctuation rewrites
23
- * straight quotes as curly ones. That permanently broke the raw-JSON editor
24
- * in Storage, and a tester pasting a JSON blob here would hit the same wall.
25
- *
26
- * While the agent is working the send button becomes a STOP button — a
27
- * square, the universal glyph — rather than a spinner in a circle, which
28
- * looked like a disabled control and gave no hint it was tappable.
29
- */
30
- import { useCallback, useState } from "react";
31
- import { Platform, Pressable, StyleSheet, Text, TextInput, View } from "react-native";
32
- import { night } from "@buoy-gg/shared-ui";
33
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
34
- export function Composer({
35
- onSend,
36
- onStop,
37
- busy,
38
- disabled,
39
- placeholder
40
- }) {
41
- const [text, setText] = useState("");
42
- const submit = useCallback(() => {
43
- const value = text.trim();
44
- if (!value) return;
45
- setText("");
46
- onSend(value);
47
- }, [text, onSend]);
48
- const canSend = text.trim().length > 0 && !busy && !disabled;
49
- return /*#__PURE__*/_jsxs(View, {
50
- style: styles.wrap,
51
- children: [/*#__PURE__*/_jsx(View, {
52
- style: [styles.field, disabled && styles.fieldDisabled],
53
- children: /*#__PURE__*/_jsx(TextInput, {
54
- testID: "buoy-ask-buoy-input",
55
- style: styles.input,
56
- value: text,
57
- onChangeText: setText,
58
- placeholder: placeholder ?? (disabled ? "Ask Buoy isn't set up yet" : "Ask, or tell it what to change…"),
59
- placeholderTextColor: night.color.placeholder,
60
- multiline: true,
61
- editable: !disabled
62
- // Straight quotes only — see the header note.
63
- ,
64
- keyboardType: "ascii-capable",
65
- autoCorrect: true,
66
- autoCapitalize: "sentences"
67
- // Enter sends; Shift-Enter is not a thing on a phone keyboard, and a
68
- // multiline box with no submit affordance strands people.
69
- ,
70
- blurOnSubmit: false,
71
- onSubmitEditing: submit,
72
- returnKeyType: "send",
73
- maxLength: 4000
74
- })
75
- }), busy ? /*#__PURE__*/_jsx(Pressable, {
76
- testID: "buoy-ask-buoy-stop",
77
- accessibilityRole: "button",
78
- accessibilityLabel: "Stop",
79
- onPress: onStop,
80
- style: ({
81
- pressed
82
- }) => [styles.button, styles.stop, pressed && styles.pressed],
83
- children: /*#__PURE__*/_jsx(View, {
84
- style: styles.stopGlyph
85
- })
86
- }) : /*#__PURE__*/_jsx(Pressable, {
87
- testID: "buoy-ask-buoy-send",
88
- accessibilityRole: "button",
89
- accessibilityLabel: "Send",
90
- disabled: !canSend,
91
- onPress: submit,
92
- style: ({
93
- pressed
94
- }) => [styles.button, canSend ? styles.sendOn : styles.sendOff, pressed && canSend && styles.pressed],
95
- children: /*#__PURE__*/_jsx(Text, {
96
- style: [styles.sendGlyph, {
97
- color: canSend ? night.color.onAccent : night.color.textTertiary
98
- }],
99
- children: "\u2191"
100
- })
101
- })]
102
- });
103
- }
104
- const styles = StyleSheet.create({
105
- wrap: {
106
- flexDirection: "row",
107
- alignItems: "flex-end",
108
- gap: 8,
109
- paddingHorizontal: night.gutter,
110
- paddingTop: 10,
111
- paddingBottom: 6,
112
- borderTopWidth: StyleSheet.hairlineWidth,
113
- borderTopColor: night.color.border,
114
- // Opaque: messages scroll UNDER the composer, and a translucent bar over
115
- // moving text is unreadable.
116
- backgroundColor: night.color.bg
117
- },
118
- field: {
119
- flex: 1,
120
- minHeight: 40,
121
- justifyContent: "center",
122
- borderRadius: 20,
123
- borderWidth: StyleSheet.hairlineWidth,
124
- borderColor: night.color.border,
125
- backgroundColor: night.color.surfaceElevated
126
- },
127
- fieldDisabled: {
128
- opacity: 0.6
129
- },
130
- input: {
131
- maxHeight: 120,
132
- paddingHorizontal: 16,
133
- paddingTop: Platform.OS === "ios" ? 10 : 6,
134
- paddingBottom: Platform.OS === "ios" ? 10 : 6,
135
- color: night.color.text,
136
- fontSize: night.font.row,
137
- lineHeight: 20
138
- },
139
- button: {
140
- width: 40,
141
- height: 40,
142
- borderRadius: 20,
143
- alignItems: "center",
144
- justifyContent: "center"
145
- },
146
- sendGlyph: {
147
- fontSize: 20,
148
- fontWeight: "700",
149
- lineHeight: 22
150
- },
151
- sendOn: {
152
- backgroundColor: night.color.accent
153
- },
154
- sendOff: {
155
- backgroundColor: night.color.fill
156
- },
157
- stop: {
158
- backgroundColor: night.color.fillTertiary
159
- },
160
- stopGlyph: {
161
- width: 12,
162
- height: 12,
163
- borderRadius: 2,
164
- backgroundColor: night.color.text
165
- },
166
- pressed: {
167
- opacity: 0.7
168
- }
169
- });
170
- //# sourceMappingURL=Composer.js.map
1
+ "use strict";import{useCallback,useEffect,useRef,useState}from"react";import{Platform,Pressable,StyleSheet,Text,TextInput,View}from"react-native";import{night}from"@buoy-gg/shared-ui";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const MIN_INPUT_HEIGHT=40,MAX_INPUT_HEIGHT=120,INPUT_PAD_V="ios"===Platform.OS?10:6,INPUT_PAD_H=16;export function Composer({onSend:e,onStop:t,busy:s,draft:o,onDraftTaken:r,disabled:l,placeholder:i,focusKey:n,canFocus:a=!0}){const[c,d]=useState(""),u=useRef(null);useEffect(()=>{n&&a&&!l&&u.current?.focus()},[n,a,l]),useEffect(()=>{o&&(d(e=>e?`${e} ${o}`:o),r?.())},[o,r]);const y=useCallback(()=>{const t=c.trim();t&&(d(""),e(t))},[c,e]),h=c.trim().length>0&&!s&&!l,b=c.trim().length>0&&s&&!l;return _jsxs(View,{style:styles.wrap,children:[_jsx(View,{style:[styles.field,l&&styles.fieldDisabled],children:_jsx(TextInput,{ref:u,testID:"buoy-ask-buoy-input",style:[styles.input,0===c.length&&styles.inputEmpty],value:c,onChangeText:d,placeholder:i??(l?"Ask Buoy isn't set up yet":"Ask, or tell it what to change…"),placeholderTextColor:night.color.placeholder,multiline:!0,editable:!l,keyboardType:"ascii-capable",autoCorrect:!0,autoCapitalize:"sentences",blurOnSubmit:!1,onSubmitEditing:y,returnKeyType:"send",maxLength:4e3})}),b&&_jsx(Pressable,{testID:"buoy-ask-buoy-queue",accessibilityRole:"button",accessibilityLabel:"Queue message",onPress:y,style:({pressed:e})=>[styles.button,styles.queue,e&&styles.pressed],children:_jsx(Text,{style:[styles.sendGlyph,{color:night.color.accent}],children:"↑"})}),_jsx(Pressable,s?{testID:"buoy-ask-buoy-stop",accessibilityRole:"button",accessibilityLabel:"Stop",onPress:t,style:({pressed:e})=>[styles.button,styles.stop,e&&styles.pressed],children:_jsx(View,{style:styles.stopGlyph})}:{testID:"buoy-ask-buoy-send",accessibilityRole:"button",accessibilityLabel:"Send",disabled:!h,onPress:y,style:({pressed:e})=>[styles.button,h?styles.sendOn:styles.sendOff,e&&h&&styles.pressed],children:_jsx(Text,{style:[styles.sendGlyph,{color:h?night.color.onAccent:night.color.textTertiary}],children:"↑"})})]})}const styles=StyleSheet.create({wrap:{flexDirection:"row",alignItems:"flex-end",gap:8,paddingHorizontal:night.gutter,paddingTop:10,paddingBottom:6,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:night.color.border,backgroundColor:night.color.bg},field:{flex:1,minHeight:40,justifyContent:"center",borderRadius:20,borderWidth:StyleSheet.hairlineWidth,borderColor:night.color.border,backgroundColor:night.color.surfaceElevated},fieldDisabled:{opacity:.6},input:{maxHeight:120,paddingHorizontal:16,paddingTop:INPUT_PAD_V,paddingBottom:INPUT_PAD_V,color:night.color.text,fontSize:night.font.row},inputEmpty:{height:40},button:{width:40,height:40,borderRadius:20,alignItems:"center",justifyContent:"center"},sendGlyph:{fontSize:20,fontWeight:"700",lineHeight:22},sendOn:{backgroundColor:night.color.accent},sendOff:{backgroundColor:night.color.fill},stop:{backgroundColor:night.color.fillTertiary},queue:{backgroundColor:"transparent",borderWidth:StyleSheet.hairlineWidth,borderColor:night.color.accentBorderStrong},stopGlyph:{width:12,height:12,borderRadius:2,backgroundColor:night.color.text},pressed:{opacity:.7}});
@@ -1,149 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * The first screen.
5
- *
6
- * Written for someone who has never used a devtool. The suggestions are not
7
- * decoration — they are the fastest way to teach a tester what kind of sentence
8
- * works here, and they are phrased as outcomes ("why is this screen empty?")
9
- * rather than as tool names, because the tools are the thing this feature
10
- * exists to hide.
11
- */
12
- import { Pressable, StyleSheet, Text, View } from "react-native";
13
- import { ChevronRight, night, NightSectionLabel } from "@buoy-gg/shared-ui";
14
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- const isRelease = typeof __DEV__ !== "undefined" && !__DEV__;
16
- const SUGGESTIONS = ["Why is this screen empty?", "What did the last few network calls return?", "Show me what's saved for this user", "Make the next request to this screen fail with a 500"];
17
- export function EmptyState({
18
- configured,
19
- onPick
20
- }) {
21
- if (!configured) {
22
- return /*#__PURE__*/_jsxs(View, {
23
- style: styles.wrap,
24
- testID: "buoy-ask-buoy-unconfigured",
25
- children: [/*#__PURE__*/_jsx(Text, {
26
- style: styles.title,
27
- children: "Not set up yet"
28
- }), /*#__PURE__*/_jsxs(Text, {
29
- style: styles.body,
30
- children: ["Ask Buoy talks to your own company's AI endpoint \u2014 nothing goes to Buoy. A developer needs to add the ", /*#__PURE__*/_jsx(Text, {
31
- style: styles.code,
32
- children: "askBuoy"
33
- }), " prop to", " ", /*#__PURE__*/_jsx(Text, {
34
- style: styles.code,
35
- children: "<FloatingDevTools />"
36
- }), " with your team's endpoint and model."]
37
- })]
38
- });
39
- }
40
- return /*#__PURE__*/_jsxs(View, {
41
- style: styles.wrap,
42
- testID: "buoy-ask-buoy-empty",
43
- children: [/*#__PURE__*/_jsx(Text, {
44
- style: styles.title,
45
- children: "Ask about this app"
46
- }), /*#__PURE__*/_jsx(Text, {
47
- style: styles.body,
48
- children: "Ask what the app is doing right now, or tell it to change something. Anything it changes shows up in a bar at the top, and you can undo it."
49
- }), /*#__PURE__*/_jsx(Text, {
50
- style: styles.buildLine,
51
- testID: "buoy-ask-buoy-build-line",
52
- children: isRelease ? "Release build — reading, impersonation and navigation work; simulations (forcing server responses, driving the screen) need a dev build." : "Dev build — full simulation available."
53
- }), /*#__PURE__*/_jsxs(View, {
54
- style: styles.group,
55
- children: [/*#__PURE__*/_jsx(NightSectionLabel, {
56
- children: "Try asking"
57
- }), /*#__PURE__*/_jsx(View, {
58
- style: styles.card,
59
- children: SUGGESTIONS.map((s, i) => /*#__PURE__*/_jsx(Suggestion, {
60
- text: s,
61
- onPick: onPick,
62
- last: i === SUGGESTIONS.length - 1
63
- }, s))
64
- })]
65
- })]
66
- });
67
- }
68
- function Suggestion({
69
- text,
70
- onPick,
71
- last
72
- }) {
73
- return /*#__PURE__*/_jsxs(Pressable, {
74
- testID: `buoy-ask-buoy-suggestion-${text.slice(0, 12)}`,
75
- accessibilityRole: "button",
76
- onPress: () => onPick(text),
77
- style: ({
78
- pressed
79
- }) => [styles.row, !last && styles.rowDivider, pressed && styles.pressed],
80
- children: [/*#__PURE__*/_jsx(Text, {
81
- style: styles.rowText,
82
- children: text
83
- }), /*#__PURE__*/_jsx(ChevronRight, {
84
- size: 14,
85
- color: night.color.textTertiary
86
- })]
87
- });
88
- }
89
- const styles = StyleSheet.create({
90
- wrap: {
91
- flex: 1,
92
- justifyContent: "center",
93
- paddingHorizontal: night.gutter,
94
- paddingVertical: 24,
95
- gap: 8
96
- },
97
- title: {
98
- color: night.color.text,
99
- fontSize: 22,
100
- fontWeight: "700",
101
- letterSpacing: -0.3
102
- },
103
- body: {
104
- color: night.color.textSecondary,
105
- fontSize: night.font.body,
106
- lineHeight: 20
107
- },
108
- code: {
109
- color: night.color.text,
110
- fontFamily: "Menlo"
111
- },
112
- buildLine: {
113
- marginTop: 8,
114
- color: night.color.textTertiary,
115
- fontSize: night.font.micro,
116
- lineHeight: 15
117
- },
118
- group: {
119
- marginTop: night.groupGap - 8
120
- },
121
- card: {
122
- borderRadius: night.radius.card,
123
- borderWidth: StyleSheet.hairlineWidth,
124
- borderColor: night.color.border,
125
- backgroundColor: night.color.surface,
126
- overflow: "hidden"
127
- },
128
- row: {
129
- flexDirection: "row",
130
- alignItems: "center",
131
- gap: 10,
132
- paddingHorizontal: night.rowPadH,
133
- paddingVertical: 13
134
- },
135
- rowDivider: {
136
- borderBottomWidth: StyleSheet.hairlineWidth,
137
- borderBottomColor: night.color.separator
138
- },
139
- rowText: {
140
- flex: 1,
141
- color: night.color.text,
142
- fontSize: night.font.body,
143
- lineHeight: 19
144
- },
145
- pressed: {
146
- backgroundColor: night.color.fill
147
- }
148
- });
149
- //# sourceMappingURL=EmptyState.js.map
1
+ "use strict";import{Pressable,StyleSheet,Text,View}from"react-native";import{ChevronRight,night,NightSectionLabel}from"@buoy-gg/shared-ui";import{pickSuggestions}from"../store/suggestions";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const isRelease="undefined"!=typeof __DEV__&&!__DEV__;export function EmptyState({configured:e,onPick:t,availableToolIds:o=[],readOnly:i=!1}){const s=pickSuggestions({availableToolIds:o,readOnly:i,isRelease:isRelease});return _jsxs(View,e?{style:styles.wrap,testID:"buoy-ask-buoy-empty",children:[_jsx(Text,{style:styles.title,children:"Ask about this app"}),_jsx(Text,{style:styles.body,children:"Ask what the app is doing right now, or tell it to change something. Anything it changes shows up in a bar at the top, with what can be undone."}),_jsx(Text,{style:styles.buildLine,testID:"buoy-ask-buoy-build-line",children:isRelease?"Release build — reading, impersonation and navigation work; simulations (forcing server responses, driving the screen) need a dev build.":"Dev build — full simulation available."}),_jsxs(View,{style:styles.group,children:[_jsx(NightSectionLabel,{children:"Try asking"}),_jsx(View,{style:styles.card,children:s.map((e,o)=>_jsx(Suggestion,{text:e,onPick:t,last:o===s.length-1},e))})]})]}:{style:styles.wrap,testID:"buoy-ask-buoy-unconfigured",children:[_jsx(Text,{style:styles.title,children:"Not set up yet"}),_jsxs(Text,{style:styles.body,children:["Ask Buoy talks to your own company's AI endpoint — nothing goes to Buoy. A developer needs to add the ",_jsx(Text,{style:styles.code,children:"askBuoy"})," prop to"," ",_jsx(Text,{style:styles.code,children:"<FloatingDevTools />"})," with your team's endpoint and model."]})]})}function Suggestion({text:e,onPick:t,last:o}){return _jsxs(Pressable,{testID:`buoy-ask-buoy-suggestion-${e.slice(0,12)}`,accessibilityRole:"button",onPress:()=>t(e),style:({pressed:e})=>[styles.row,!o&&styles.rowDivider,e&&styles.pressed],children:[_jsx(Text,{style:styles.rowText,children:e}),_jsx(ChevronRight,{size:14,color:night.color.textTertiary})]})}const styles=StyleSheet.create({wrap:{flex:1,justifyContent:"center",paddingHorizontal:night.gutter,paddingVertical:24,gap:8},title:{color:night.color.text,fontSize:22,fontWeight:"700",letterSpacing:-.3},body:{color:night.color.textSecondary,fontSize:night.font.body,lineHeight:20},code:{color:night.color.text,fontFamily:"Menlo"},buildLine:{marginTop:8,color:night.color.textTertiary,fontSize:night.font.micro,lineHeight:15},group:{marginTop:night.groupGap-8},card:{borderRadius:night.radius.card,borderWidth:StyleSheet.hairlineWidth,borderColor:night.color.border,backgroundColor:night.color.surface,overflow:"hidden"},row:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:night.rowPadH,paddingVertical:13},rowDivider:{borderBottomWidth:StyleSheet.hairlineWidth,borderBottomColor:night.color.separator},rowText:{flex:1,color:night.color.text,fontSize:night.font.body,lineHeight:19},pressed:{backgroundColor:night.color.fill}});
@@ -0,0 +1 @@
1
+ "use strict";import{useEffect,useRef}from"react";import{Animated,Easing,Keyboard,Platform,StyleSheet}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";export function KeyboardPad({children:e}){const t=useRef(null),r=useRef(new Animated.Value(0)).current;return useEffect(()=>{if("ios"!==Platform.OS)return;const e=(e,t)=>{Animated.timing(r,{toValue:e,duration:t.duration||250,easing:Easing.bezier(.17,.59,.4,.77),useNativeDriver:!1}).start()},a=[Keyboard.addListener("keyboardWillChangeFrame",r=>{const a=t.current;a&&a.measureInWindow((t,a,n,i)=>{const s=a+i-r.endCoordinates.screenY;e(Math.max(0,s),r)})}),Keyboard.addListener("keyboardWillHide",t=>e(0,t))];return()=>a.forEach(e=>e.remove())},[r]),_jsx(Animated.View,{ref:t,style:[styles.flex,{paddingBottom:r}],children:e})}const styles=StyleSheet.create({flex:{flex:1}});