@buoy-gg/ask-buoy 7.0.40 → 7.0.42

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 (314) hide show
  1. package/README.md +13 -94
  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 +2 -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/blocks/ruleStates.js +1 -0
  20. package/lib/commonjs/components/ApprovalCard.js +1 -297
  21. package/lib/commonjs/components/AskBuoyHeader.js +1 -196
  22. package/lib/commonjs/components/AskBuoyIcon.js +1 -19
  23. package/lib/commonjs/components/AskBuoyModal.js +2 -478
  24. package/lib/commonjs/components/AskBuoySettings.js +1 -181
  25. package/lib/commonjs/components/ChangesBar.js +1 -211
  26. package/lib/commonjs/components/Composer.js +1 -255
  27. package/lib/commonjs/components/EmptyState.js +1 -161
  28. package/lib/commonjs/components/KeyboardPad.js +1 -80
  29. package/lib/commonjs/components/Markdown.js +1 -310
  30. package/lib/commonjs/components/MessageList.js +1 -970
  31. package/lib/commonjs/components/QueuedMessages.js +1 -145
  32. package/lib/commonjs/components/ThinkingStrip.js +1 -223
  33. package/lib/commonjs/components/TypingDots.js +1 -63
  34. package/lib/commonjs/components/markdownParse.js +1 -131
  35. package/lib/commonjs/components/markdownParse.test.js +1 -99
  36. package/lib/commonjs/components/useCopyAction.js +1 -50
  37. package/lib/commonjs/index.js +1 -252
  38. package/lib/commonjs/preset.js +1 -91
  39. package/lib/commonjs/store/activityGroups.js +1 -110
  40. package/lib/commonjs/store/activityGroups.test.js +1 -78
  41. package/lib/commonjs/store/askBuoySettings.js +1 -72
  42. package/lib/commonjs/store/askBuoyStore.js +2 -588
  43. package/lib/commonjs/store/blockPlacement.js +1 -64
  44. package/lib/commonjs/store/blockPlacement.test.js +1 -123
  45. package/lib/commonjs/store/queue.test.js +1 -150
  46. package/lib/commonjs/store/resetConversation.js +1 -77
  47. package/lib/commonjs/store/restorePending.test.js +1 -63
  48. package/lib/commonjs/store/restoredIds.test.js +1 -47
  49. package/lib/commonjs/store/suggestions.js +1 -54
  50. package/lib/commonjs/store/suggestions.test.js +1 -58
  51. package/lib/commonjs/store/systemLine.test.js +1 -77
  52. package/lib/commonjs/store/ticketPrompt.js +1 -17
  53. package/lib/commonjs/store/traceText.js +1 -81
  54. package/lib/commonjs/store/traceText.test.js +1 -112
  55. package/lib/commonjs/store/transcriptPersistence.js +1 -297
  56. package/lib/commonjs/store/transcriptPersistence.test.js +1 -333
  57. package/lib/commonjs/store/turnRendering.test.js +1 -151
  58. package/lib/commonjs/store/useAskBuoy.js +1 -651
  59. package/lib/commonjs/store/useAskBuoySettings.js +1 -14
  60. package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -153
  61. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +1 -141
  62. package/lib/commonjs/sync/wire.js +1 -58
  63. package/lib/commonjs/types.js +1 -6
  64. package/lib/module/blocks/AskBlocks.js +1 -331
  65. package/lib/module/blocks/BlockRenderer.js +1 -257
  66. package/lib/module/blocks/ChromePrototypes.js +1 -503
  67. package/lib/module/blocks/DataBlocks.js +1 -767
  68. package/lib/module/blocks/ExtraBlocks.js +1 -1833
  69. package/lib/module/blocks/MediaBlocks.js +1 -151
  70. package/lib/module/blocks/ReceiptBlocks.js +2 -574
  71. package/lib/module/blocks/blockText.js +1 -55
  72. package/lib/module/blocks/blockText.test.js +1 -53
  73. package/lib/module/blocks/context.js +1 -35
  74. package/lib/module/blocks/icons.js +1 -91
  75. package/lib/module/blocks/index.js +1 -8
  76. package/lib/module/blocks/listRow.test.js +1 -56
  77. package/lib/module/blocks/pageState.js +1 -30
  78. package/lib/module/blocks/pageState.test.js +1 -56
  79. package/lib/module/blocks/primitives.js +1 -445
  80. package/lib/module/blocks/primitivesIndex.js +1 -5
  81. package/lib/module/blocks/ruleStates.js +1 -0
  82. package/lib/module/components/ApprovalCard.js +1 -292
  83. package/lib/module/components/AskBuoyHeader.js +1 -193
  84. package/lib/module/components/AskBuoyIcon.js +1 -8
  85. package/lib/module/components/AskBuoyModal.js +2 -473
  86. package/lib/module/components/AskBuoySettings.js +1 -176
  87. package/lib/module/components/ChangesBar.js +1 -206
  88. package/lib/module/components/Composer.js +1 -250
  89. package/lib/module/components/EmptyState.js +1 -156
  90. package/lib/module/components/KeyboardPad.js +1 -75
  91. package/lib/module/components/Markdown.js +1 -305
  92. package/lib/module/components/MessageList.js +1 -964
  93. package/lib/module/components/QueuedMessages.js +1 -140
  94. package/lib/module/components/ThinkingStrip.js +1 -218
  95. package/lib/module/components/TypingDots.js +1 -58
  96. package/lib/module/components/markdownParse.js +1 -125
  97. package/lib/module/components/markdownParse.test.js +1 -98
  98. package/lib/module/components/useCopyAction.js +1 -46
  99. package/lib/module/index.js +1 -34
  100. package/lib/module/preset.js +1 -74
  101. package/lib/module/store/activityGroups.js +1 -103
  102. package/lib/module/store/activityGroups.test.js +1 -77
  103. package/lib/module/store/askBuoySettings.js +1 -67
  104. package/lib/module/store/askBuoyStore.js +2 -582
  105. package/lib/module/store/blockPlacement.js +1 -59
  106. package/lib/module/store/blockPlacement.test.js +1 -122
  107. package/lib/module/store/queue.test.js +1 -149
  108. package/lib/module/store/resetConversation.js +1 -72
  109. package/lib/module/store/restorePending.test.js +1 -62
  110. package/lib/module/store/restoredIds.test.js +1 -46
  111. package/lib/module/store/suggestions.js +1 -49
  112. package/lib/module/store/suggestions.test.js +1 -57
  113. package/lib/module/store/systemLine.test.js +1 -76
  114. package/lib/module/store/ticketPrompt.js +1 -13
  115. package/lib/module/store/traceText.js +1 -75
  116. package/lib/module/store/traceText.test.js +1 -111
  117. package/lib/module/store/transcriptPersistence.js +1 -287
  118. package/lib/module/store/transcriptPersistence.test.js +1 -332
  119. package/lib/module/store/turnRendering.test.js +1 -150
  120. package/lib/module/store/useAskBuoy.js +1 -646
  121. package/lib/module/store/useAskBuoySettings.js +1 -9
  122. package/lib/module/sync/askBuoySyncAdapter.js +1 -148
  123. package/lib/module/sync/askBuoySyncAdapter.test.js +1 -140
  124. package/lib/module/sync/wire.js +1 -47
  125. package/lib/module/types.js +1 -4
  126. package/lib/typescript/blocks/context.d.ts +3 -0
  127. package/lib/typescript/blocks/ruleStates.d.ts +15 -0
  128. package/lib/typescript/components/ChangesBar.d.ts +2 -1
  129. package/lib/typescript/sync/askBuoySyncAdapter.d.ts +2 -2
  130. package/lib/web/index.mjs +15 -0
  131. package/package.json +44 -11
  132. package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
  133. package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
  134. package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
  135. package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
  136. package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
  137. package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
  138. package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
  139. package/lib/commonjs/blocks/blockText.js.map +0 -1
  140. package/lib/commonjs/blocks/blockText.test.js.map +0 -1
  141. package/lib/commonjs/blocks/context.js.map +0 -1
  142. package/lib/commonjs/blocks/icons.js.map +0 -1
  143. package/lib/commonjs/blocks/index.js.map +0 -1
  144. package/lib/commonjs/blocks/listRow.test.js.map +0 -1
  145. package/lib/commonjs/blocks/pageState.js.map +0 -1
  146. package/lib/commonjs/blocks/pageState.test.js.map +0 -1
  147. package/lib/commonjs/blocks/primitives.js.map +0 -1
  148. package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
  149. package/lib/commonjs/components/ApprovalCard.js.map +0 -1
  150. package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
  151. package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
  152. package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
  153. package/lib/commonjs/components/AskBuoySettings.js.map +0 -1
  154. package/lib/commonjs/components/ChangesBar.js.map +0 -1
  155. package/lib/commonjs/components/Composer.js.map +0 -1
  156. package/lib/commonjs/components/EmptyState.js.map +0 -1
  157. package/lib/commonjs/components/KeyboardPad.js.map +0 -1
  158. package/lib/commonjs/components/Markdown.js.map +0 -1
  159. package/lib/commonjs/components/MessageList.js.map +0 -1
  160. package/lib/commonjs/components/QueuedMessages.js.map +0 -1
  161. package/lib/commonjs/components/ThinkingStrip.js.map +0 -1
  162. package/lib/commonjs/components/TypingDots.js.map +0 -1
  163. package/lib/commonjs/components/markdownParse.js.map +0 -1
  164. package/lib/commonjs/components/markdownParse.test.js.map +0 -1
  165. package/lib/commonjs/components/useCopyAction.js.map +0 -1
  166. package/lib/commonjs/index.js.map +0 -1
  167. package/lib/commonjs/preset.js.map +0 -1
  168. package/lib/commonjs/store/activityGroups.js.map +0 -1
  169. package/lib/commonjs/store/activityGroups.test.js.map +0 -1
  170. package/lib/commonjs/store/askBuoySettings.js.map +0 -1
  171. package/lib/commonjs/store/askBuoyStore.js.map +0 -1
  172. package/lib/commonjs/store/blockPlacement.js.map +0 -1
  173. package/lib/commonjs/store/blockPlacement.test.js.map +0 -1
  174. package/lib/commonjs/store/queue.test.js.map +0 -1
  175. package/lib/commonjs/store/resetConversation.js.map +0 -1
  176. package/lib/commonjs/store/restorePending.test.js.map +0 -1
  177. package/lib/commonjs/store/restoredIds.test.js.map +0 -1
  178. package/lib/commonjs/store/suggestions.js.map +0 -1
  179. package/lib/commonjs/store/suggestions.test.js.map +0 -1
  180. package/lib/commonjs/store/systemLine.test.js.map +0 -1
  181. package/lib/commonjs/store/ticketPrompt.js.map +0 -1
  182. package/lib/commonjs/store/traceText.js.map +0 -1
  183. package/lib/commonjs/store/traceText.test.js.map +0 -1
  184. package/lib/commonjs/store/transcriptPersistence.js.map +0 -1
  185. package/lib/commonjs/store/transcriptPersistence.test.js.map +0 -1
  186. package/lib/commonjs/store/turnRendering.test.js.map +0 -1
  187. package/lib/commonjs/store/useAskBuoy.js.map +0 -1
  188. package/lib/commonjs/store/useAskBuoySettings.js.map +0 -1
  189. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
  190. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
  191. package/lib/commonjs/sync/wire.js.map +0 -1
  192. package/lib/commonjs/types.js.map +0 -1
  193. package/lib/module/blocks/AskBlocks.js.map +0 -1
  194. package/lib/module/blocks/BlockRenderer.js.map +0 -1
  195. package/lib/module/blocks/ChromePrototypes.js.map +0 -1
  196. package/lib/module/blocks/DataBlocks.js.map +0 -1
  197. package/lib/module/blocks/ExtraBlocks.js.map +0 -1
  198. package/lib/module/blocks/MediaBlocks.js.map +0 -1
  199. package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
  200. package/lib/module/blocks/blockText.js.map +0 -1
  201. package/lib/module/blocks/blockText.test.js.map +0 -1
  202. package/lib/module/blocks/context.js.map +0 -1
  203. package/lib/module/blocks/icons.js.map +0 -1
  204. package/lib/module/blocks/index.js.map +0 -1
  205. package/lib/module/blocks/listRow.test.js.map +0 -1
  206. package/lib/module/blocks/pageState.js.map +0 -1
  207. package/lib/module/blocks/pageState.test.js.map +0 -1
  208. package/lib/module/blocks/primitives.js.map +0 -1
  209. package/lib/module/blocks/primitivesIndex.js.map +0 -1
  210. package/lib/module/components/ApprovalCard.js.map +0 -1
  211. package/lib/module/components/AskBuoyHeader.js.map +0 -1
  212. package/lib/module/components/AskBuoyIcon.js.map +0 -1
  213. package/lib/module/components/AskBuoyModal.js.map +0 -1
  214. package/lib/module/components/AskBuoySettings.js.map +0 -1
  215. package/lib/module/components/ChangesBar.js.map +0 -1
  216. package/lib/module/components/Composer.js.map +0 -1
  217. package/lib/module/components/EmptyState.js.map +0 -1
  218. package/lib/module/components/KeyboardPad.js.map +0 -1
  219. package/lib/module/components/Markdown.js.map +0 -1
  220. package/lib/module/components/MessageList.js.map +0 -1
  221. package/lib/module/components/QueuedMessages.js.map +0 -1
  222. package/lib/module/components/ThinkingStrip.js.map +0 -1
  223. package/lib/module/components/TypingDots.js.map +0 -1
  224. package/lib/module/components/markdownParse.js.map +0 -1
  225. package/lib/module/components/markdownParse.test.js.map +0 -1
  226. package/lib/module/components/useCopyAction.js.map +0 -1
  227. package/lib/module/index.js.map +0 -1
  228. package/lib/module/preset.js.map +0 -1
  229. package/lib/module/store/activityGroups.js.map +0 -1
  230. package/lib/module/store/activityGroups.test.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/blockPlacement.js.map +0 -1
  234. package/lib/module/store/blockPlacement.test.js.map +0 -1
  235. package/lib/module/store/queue.test.js.map +0 -1
  236. package/lib/module/store/resetConversation.js.map +0 -1
  237. package/lib/module/store/restorePending.test.js.map +0 -1
  238. package/lib/module/store/restoredIds.test.js.map +0 -1
  239. package/lib/module/store/suggestions.js.map +0 -1
  240. package/lib/module/store/suggestions.test.js.map +0 -1
  241. package/lib/module/store/systemLine.test.js.map +0 -1
  242. package/lib/module/store/ticketPrompt.js.map +0 -1
  243. package/lib/module/store/traceText.js.map +0 -1
  244. package/lib/module/store/traceText.test.js.map +0 -1
  245. package/lib/module/store/transcriptPersistence.js.map +0 -1
  246. package/lib/module/store/transcriptPersistence.test.js.map +0 -1
  247. package/lib/module/store/turnRendering.test.js.map +0 -1
  248. package/lib/module/store/useAskBuoy.js.map +0 -1
  249. package/lib/module/store/useAskBuoySettings.js.map +0 -1
  250. package/lib/module/sync/askBuoySyncAdapter.js.map +0 -1
  251. package/lib/module/sync/askBuoySyncAdapter.test.js.map +0 -1
  252. package/lib/module/sync/wire.js.map +0 -1
  253. package/lib/module/types.js.map +0 -1
  254. package/lib/typescript/blocks/AskBlocks.d.ts.map +0 -1
  255. package/lib/typescript/blocks/BlockRenderer.d.ts.map +0 -1
  256. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +0 -1
  257. package/lib/typescript/blocks/DataBlocks.d.ts.map +0 -1
  258. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +0 -1
  259. package/lib/typescript/blocks/MediaBlocks.d.ts.map +0 -1
  260. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +0 -1
  261. package/lib/typescript/blocks/blockText.d.ts.map +0 -1
  262. package/lib/typescript/blocks/blockText.test.d.ts.map +0 -1
  263. package/lib/typescript/blocks/context.d.ts.map +0 -1
  264. package/lib/typescript/blocks/icons.d.ts.map +0 -1
  265. package/lib/typescript/blocks/index.d.ts.map +0 -1
  266. package/lib/typescript/blocks/listRow.test.d.ts.map +0 -1
  267. package/lib/typescript/blocks/pageState.d.ts.map +0 -1
  268. package/lib/typescript/blocks/pageState.test.d.ts.map +0 -1
  269. package/lib/typescript/blocks/primitives.d.ts.map +0 -1
  270. package/lib/typescript/blocks/primitivesIndex.d.ts.map +0 -1
  271. package/lib/typescript/components/ApprovalCard.d.ts.map +0 -1
  272. package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
  273. package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
  274. package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
  275. package/lib/typescript/components/AskBuoySettings.d.ts.map +0 -1
  276. package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
  277. package/lib/typescript/components/Composer.d.ts.map +0 -1
  278. package/lib/typescript/components/EmptyState.d.ts.map +0 -1
  279. package/lib/typescript/components/KeyboardPad.d.ts.map +0 -1
  280. package/lib/typescript/components/Markdown.d.ts.map +0 -1
  281. package/lib/typescript/components/MessageList.d.ts.map +0 -1
  282. package/lib/typescript/components/QueuedMessages.d.ts.map +0 -1
  283. package/lib/typescript/components/ThinkingStrip.d.ts.map +0 -1
  284. package/lib/typescript/components/TypingDots.d.ts.map +0 -1
  285. package/lib/typescript/components/markdownParse.d.ts.map +0 -1
  286. package/lib/typescript/components/markdownParse.test.d.ts.map +0 -1
  287. package/lib/typescript/components/useCopyAction.d.ts.map +0 -1
  288. package/lib/typescript/index.d.ts.map +0 -1
  289. package/lib/typescript/preset.d.ts.map +0 -1
  290. package/lib/typescript/store/activityGroups.d.ts.map +0 -1
  291. package/lib/typescript/store/activityGroups.test.d.ts.map +0 -1
  292. package/lib/typescript/store/askBuoySettings.d.ts.map +0 -1
  293. package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
  294. package/lib/typescript/store/blockPlacement.d.ts.map +0 -1
  295. package/lib/typescript/store/blockPlacement.test.d.ts.map +0 -1
  296. package/lib/typescript/store/queue.test.d.ts.map +0 -1
  297. package/lib/typescript/store/resetConversation.d.ts.map +0 -1
  298. package/lib/typescript/store/restorePending.test.d.ts.map +0 -1
  299. package/lib/typescript/store/restoredIds.test.d.ts.map +0 -1
  300. package/lib/typescript/store/suggestions.d.ts.map +0 -1
  301. package/lib/typescript/store/suggestions.test.d.ts.map +0 -1
  302. package/lib/typescript/store/systemLine.test.d.ts.map +0 -1
  303. package/lib/typescript/store/ticketPrompt.d.ts.map +0 -1
  304. package/lib/typescript/store/traceText.d.ts.map +0 -1
  305. package/lib/typescript/store/traceText.test.d.ts.map +0 -1
  306. package/lib/typescript/store/transcriptPersistence.d.ts.map +0 -1
  307. package/lib/typescript/store/transcriptPersistence.test.d.ts.map +0 -1
  308. package/lib/typescript/store/turnRendering.test.d.ts.map +0 -1
  309. package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
  310. package/lib/typescript/store/useAskBuoySettings.d.ts.map +0 -1
  311. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
  312. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
  313. package/lib/typescript/sync/wire.d.ts.map +0 -1
  314. package/lib/typescript/types.d.ts.map +0 -1
@@ -1,574 +1,2 @@
1
- "use strict";
2
-
3
- /**
4
- * Receipts — engine-made blocks for the tools people ask about most.
5
- * Each one is a card the matching Buoy tool could have drawn, with one tap
6
- * into that tool where the host supports it.
7
- */
8
- import { useState } from "react";
9
- import { Pressable, StyleSheet, Text, View } from "react-native";
10
- import { AlertTriangle, ChevronRight, Eye, night, NightSegmented } from "@buoy-gg/shared-ui";
11
- import { CAPS } from "@buoy-gg/agent-core";
12
- import { useBlockHandlers } from "./context";
13
- import { ActionRow, blockStyles as b, Card, More, usePaged } from "./primitives";
14
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- function statusColor(status) {
16
- if (status === undefined) return night.color.textTertiary;
17
- if (status >= 500) return night.color.danger;
18
- if (status >= 400) return night.color.warning;
19
- if (status >= 300) return night.color.info;
20
- return night.color.accent;
21
- }
22
- function pathOf(url) {
23
- try {
24
- const u = new URL(url);
25
- return u.pathname + (u.search ? "?…" : "");
26
- } catch {
27
- return url;
28
- }
29
- }
30
- function StatusPill({
31
- status
32
- }) {
33
- return /*#__PURE__*/_jsx(View, {
34
- style: [b.pill, {
35
- backgroundColor: `${statusColor(status)}22`
36
- }],
37
- children: /*#__PURE__*/_jsx(Text, {
38
- style: [b.pillText, {
39
- color: statusColor(status)
40
- }],
41
- children: status ?? "…"
42
- })
43
- });
44
- }
45
- export function RequestList({
46
- block
47
- }) {
48
- const h = useBlockHandlers();
49
- const canOpen = h.supports?.openTool !== false;
50
- const paged = usePaged(block.requests, CAPS.listItems);
51
- const {
52
- visible
53
- } = paged;
54
- return /*#__PURE__*/_jsxs(Card, {
55
- title: block.title ?? "Network requests",
56
- source: block.source,
57
- testID: `buoy-block-requests-${block.id}`,
58
- children: [visible.map((r, i) => /*#__PURE__*/_jsxs(Pressable, {
59
- disabled: !canOpen,
60
- onPress: () => void h.runAction({
61
- label: "Open in Network",
62
- openTool: {
63
- toolId: "network",
64
- select: r.id
65
- }
66
- }, block.id),
67
- style: [b.row, i > 0 && b.rowDivider],
68
- accessibilityRole: canOpen ? "button" : undefined,
69
- children: [/*#__PURE__*/_jsx(Text, {
70
- style: styles.method,
71
- children: r.method
72
- }), /*#__PURE__*/_jsx(Text, {
73
- style: b.rowTitle,
74
- numberOfLines: 1,
75
- children: pathOf(r.url)
76
- }), r.mocked ? /*#__PURE__*/_jsx(Text, {
77
- style: styles.mockedChip,
78
- children: "MOCKED"
79
- }) : null, r.durationMs !== undefined ? /*#__PURE__*/_jsxs(Text, {
80
- style: b.rowTrailing,
81
- children: [r.durationMs, " ms"]
82
- }) : null, /*#__PURE__*/_jsx(StatusPill, {
83
- status: r.status
84
- }), canOpen ? /*#__PURE__*/_jsx(ChevronRight, {
85
- size: 12,
86
- color: night.color.textTertiary
87
- }) : null]
88
- }, `${r.id}-${i}`)), /*#__PURE__*/_jsx(More, {
89
- paged: paged
90
- })]
91
- });
92
- }
93
-
94
- /** Module scope — a fresh array per render is a new prop identity for nothing. */
95
- const REQUEST_TABS = [{
96
- key: "response",
97
- label: "Response"
98
- }, {
99
- key: "request",
100
- label: "Request"
101
- }];
102
- export function RequestCard({
103
- block
104
- }) {
105
- const [tab, setTab] = useState("response");
106
- const body = tab === "response" ? block.responseBody : block.requestBody;
107
- const text = body === undefined ? "(none)" : typeof body === "string" ? body : JSON.stringify(body, null, 2);
108
- const h = useBlockHandlers();
109
- return /*#__PURE__*/_jsxs(Card, {
110
- source: block.source,
111
- testID: `buoy-block-request-${block.id}`,
112
- children: [/*#__PURE__*/_jsxs(View, {
113
- style: [b.row, styles.reqHead],
114
- children: [/*#__PURE__*/_jsx(Text, {
115
- style: styles.method,
116
- children: block.request.method
117
- }), /*#__PURE__*/_jsx(Text, {
118
- style: b.rowTitle,
119
- numberOfLines: 2,
120
- children: pathOf(block.request.url)
121
- }), block.request.mocked ? /*#__PURE__*/_jsx(Text, {
122
- style: styles.mockedChip,
123
- children: "MOCKED"
124
- }) : null, /*#__PURE__*/_jsx(StatusPill, {
125
- status: block.request.status
126
- })]
127
- }), /*#__PURE__*/_jsx(View, {
128
- style: styles.tabs,
129
- children: /*#__PURE__*/_jsx(NightSegmented, {
130
- tabs: REQUEST_TABS,
131
- activeKey: tab,
132
- onChange: key => setTab(key),
133
- size: "sm"
134
- })
135
- }), /*#__PURE__*/_jsx(Text, {
136
- style: [b.mono, styles.body],
137
- numberOfLines: 14,
138
- selectable: true,
139
- children: text.length > 1600 ? `${text.slice(0, 1600)}\n…` : text
140
- }), /*#__PURE__*/_jsx(ActionRow, {
141
- blockId: block.id,
142
- actions: [{
143
- label: "Open in Network",
144
- openTool: {
145
- toolId: "network",
146
- select: block.request.id
147
- }
148
- }]
149
- }), h.supports?.openTool === false ? null : null]
150
- });
151
- }
152
- export function RuleCard({
153
- block
154
- }) {
155
- const r = block.rule;
156
- const outcome = r.kind === "fail" ? "fails (no network)" : r.kind === "delay" ? `delayed ${r.delayMs ?? 0} ms` : `returns ${r.status ?? 200}`;
157
- return /*#__PURE__*/_jsxs(Card, {
158
- title: r.name ?? "Network override",
159
- source: block.source,
160
- testID: `buoy-block-rule-${block.id}`,
161
- tone: r.enabled ? "warning" : undefined,
162
- children: [/*#__PURE__*/_jsxs(View, {
163
- style: styles.ruleBody,
164
- children: [/*#__PURE__*/_jsxs(Text, {
165
- style: styles.ruleLine,
166
- children: [/*#__PURE__*/_jsxs(Text, {
167
- style: styles.ruleKey,
168
- children: [r.methods?.length ? r.methods.join("/") : "ANY", " "]
169
- }), /*#__PURE__*/_jsx(Text, {
170
- style: b.mono,
171
- children: r.urlPattern
172
- })]
173
- }), /*#__PURE__*/_jsxs(Text, {
174
- style: styles.ruleLine,
175
- children: [/*#__PURE__*/_jsx(Text, {
176
- style: styles.ruleKey,
177
- children: "\u2192 "
178
- }), outcome, r.times ? ` · ${r.times === 1 ? "once" : `${r.times} times`}` : " · every time", r.hits !== undefined ? ` · ${r.hits} hit${r.hits === 1 ? "" : "s"}` : ""]
179
- }), /*#__PURE__*/_jsx(View, {
180
- style: [b.pill, r.enabled ? styles.on : styles.off],
181
- children: /*#__PURE__*/_jsx(Text, {
182
- style: [b.pillText, {
183
- color: r.enabled ? night.color.onAccent : night.color.textSecondary
184
- }],
185
- children: r.enabled ? "ON" : "OFF"
186
- })
187
- })]
188
- }), /*#__PURE__*/_jsx(ActionRow, {
189
- blockId: block.id,
190
- actions: [r.enabled ? {
191
- label: "Turn off",
192
- dispatch: {
193
- toolId: "network",
194
- action: "setOverrideRuleEnabled",
195
- params: {
196
- id: r.id,
197
- enabled: false
198
- }
199
- }
200
- } : {
201
- label: "Turn on",
202
- primary: true,
203
- dispatch: {
204
- toolId: "network",
205
- action: "setOverrideRuleEnabled",
206
- params: {
207
- id: r.id,
208
- enabled: true
209
- }
210
- }
211
- }, {
212
- label: "Delete",
213
- dispatch: {
214
- toolId: "network",
215
- action: "deleteOverrideRule",
216
- params: {
217
- id: r.id
218
- }
219
- }
220
- }]
221
- })]
222
- });
223
- }
224
- export function ScreenElements({
225
- block
226
- }) {
227
- const h = useBlockHandlers();
228
- const paged = usePaged(block.elements, CAPS.chips);
229
- const {
230
- visible
231
- } = paged;
232
- return /*#__PURE__*/_jsxs(Card, {
233
- title: block.title ?? "On screen right now",
234
- source: block.source,
235
- testID: `buoy-block-screen-${block.id}`,
236
- children: [visible.map((e, i) => /*#__PURE__*/_jsxs(Pressable, {
237
- onPress: () => void h.runAction({
238
- label: "Highlight",
239
- dispatch: {
240
- toolId: "highlight-updates",
241
- action: "setSpotlight",
242
- params: {
243
- nativeTag: e.nativeTag
244
- }
245
- }
246
- }, block.id),
247
- disabled: h.supports?.dispatch === false,
248
- style: [b.row, i > 0 && b.rowDivider],
249
- accessibilityRole: "button",
250
- children: [/*#__PURE__*/_jsx(Eye, {
251
- size: 12,
252
- color: night.color.textTertiary
253
- }), /*#__PURE__*/_jsx(Text, {
254
- style: b.rowTitle,
255
- numberOfLines: 1,
256
- children: e.label ?? e.testID ?? e.name
257
- }), /*#__PURE__*/_jsx(Text, {
258
- style: b.rowTrailing,
259
- numberOfLines: 1,
260
- children: e.name
261
- })]
262
- }, `${e.nativeTag}-${i}`)), /*#__PURE__*/_jsx(More, {
263
- paged: paged
264
- })]
265
- });
266
- }
267
- export function RouteChips({
268
- block
269
- }) {
270
- const h = useBlockHandlers();
271
- const paged = usePaged(block.routes, CAPS.chips);
272
- const routes = paged.visible;
273
- return /*#__PURE__*/_jsxs(Card, {
274
- title: block.current ? `Routes · you're on ${block.current}` : "Routes",
275
- source: block.source,
276
- testID: `buoy-block-routes-${block.id}`,
277
- children: [/*#__PURE__*/_jsx(View, {
278
- style: styles.chips,
279
- children: routes.map((r, i) => /*#__PURE__*/_jsx(Pressable, {
280
- disabled: h.supports?.dispatch === false,
281
- onPress: () => r.dynamic ? h.answer({
282
- blockId: block.id,
283
- kind: "input",
284
- value: `Open ${r.path} — which id?`
285
- }) : void h.runAction({
286
- label: `Open ${r.path}`,
287
- dispatch: {
288
- toolId: "route-events",
289
- action: "navigate",
290
- params: {
291
- path: r.path
292
- }
293
- }
294
- }, block.id),
295
- style: [styles.chip, r.path === block.current && styles.chipCurrent],
296
- accessibilityRole: "button",
297
- children: /*#__PURE__*/_jsx(Text, {
298
- style: [styles.chipText, r.dynamic && styles.chipDynamic],
299
- children: r.path
300
- })
301
- }, `${r.path}-${i}`))
302
- }), /*#__PURE__*/_jsx(More, {
303
- paged: paged
304
- })]
305
- });
306
- }
307
- const LEVEL_COLOR = {
308
- error: night.color.danger,
309
- warn: night.color.warning,
310
- warning: night.color.warning,
311
- info: night.color.info
312
- };
313
- export function LogList({
314
- block
315
- }) {
316
- const paged = usePaged(block.entries, CAPS.listItems);
317
- const {
318
- visible
319
- } = paged;
320
- return /*#__PURE__*/_jsxs(Card, {
321
- title: "Console",
322
- source: block.source,
323
- testID: `buoy-block-logs-${block.id}`,
324
- children: [visible.map((e, i) => /*#__PURE__*/_jsxs(View, {
325
- style: [b.row, i > 0 && b.rowDivider, styles.logRow],
326
- children: [/*#__PURE__*/_jsx(View, {
327
- style: [b.pill, {
328
- backgroundColor: `${LEVEL_COLOR[e.level] ?? night.color.textTertiary}22`
329
- }],
330
- children: /*#__PURE__*/_jsx(Text, {
331
- style: [b.pillText, {
332
- color: LEVEL_COLOR[e.level] ?? night.color.textSecondary
333
- }],
334
- children: e.level.toUpperCase()
335
- })
336
- }), /*#__PURE__*/_jsx(Text, {
337
- style: [b.rowTitle, b.mono],
338
- numberOfLines: 3,
339
- children: e.message
340
- }), e.count > 1 ? /*#__PURE__*/_jsxs(Text, {
341
- style: b.rowTrailing,
342
- children: ["\xD7", e.count]
343
- }) : null]
344
- }, `${e.level}-${e.message}-${i}`)), /*#__PURE__*/_jsx(More, {
345
- paged: paged
346
- })]
347
- });
348
- }
349
- export function Crash({
350
- block
351
- }) {
352
- return /*#__PURE__*/_jsxs(Card, {
353
- tone: "danger",
354
- testID: `buoy-block-crash-${block.id}`,
355
- children: [/*#__PURE__*/_jsxs(View, {
356
- style: styles.crashHead,
357
- children: [/*#__PURE__*/_jsx(AlertTriangle, {
358
- size: 14,
359
- color: night.color.danger
360
- }), /*#__PURE__*/_jsxs(Text, {
361
- style: styles.crashTitle,
362
- children: ["The app crashed", block.route ? ` on ${block.route}` : ""]
363
- })]
364
- }), /*#__PURE__*/_jsx(Text, {
365
- style: [b.mono, styles.crashMsg],
366
- numberOfLines: 4,
367
- selectable: true,
368
- children: block.message
369
- }), block.suspect ? /*#__PURE__*/_jsxs(Text, {
370
- style: styles.suspect,
371
- children: ["Most likely cause: ", block.suspect.label]
372
- }) : null, /*#__PURE__*/_jsx(ActionRow, {
373
- blockId: block.id,
374
- actions: [...(block.suspect?.action ? [{
375
- ...block.suspect.action,
376
- primary: true
377
- }] : []), ...(block.actions ?? [])].slice(0, 2)
378
- })]
379
- });
380
- }
381
-
382
- /** A chip, not a card: the agent moved the app; let the user look. */
383
- export function Peek({
384
- block
385
- }) {
386
- const h = useBlockHandlers();
387
- const can = h.supports?.minimize !== false;
388
- return /*#__PURE__*/_jsxs(Pressable, {
389
- testID: `buoy-block-peek-${block.id}`,
390
- disabled: !can,
391
- onPress: () => void h.runAction({
392
- label: "Look",
393
- minimize: true
394
- }, block.id),
395
- style: ({
396
- pressed
397
- }) => [styles.peek, pressed && {
398
- opacity: 0.7
399
- }],
400
- accessibilityRole: "button",
401
- accessibilityLabel: `${block.label}. Look at the app`,
402
- children: [/*#__PURE__*/_jsx(Text, {
403
- style: styles.peekText,
404
- children: block.label
405
- }), can ? /*#__PURE__*/_jsxs(View, {
406
- style: styles.peekLook,
407
- children: [/*#__PURE__*/_jsx(Eye, {
408
- size: 12,
409
- color: night.color.accent
410
- }), /*#__PURE__*/_jsx(Text, {
411
- style: styles.peekLookText,
412
- children: "Look"
413
- })]
414
- }) : null]
415
- });
416
- }
417
- const styles = StyleSheet.create({
418
- method: {
419
- color: night.color.textSecondary,
420
- fontSize: night.font.micro,
421
- fontWeight: "700",
422
- letterSpacing: 0.4,
423
- width: 44
424
- },
425
- // The provenance chip for a response an override rule synthesized. Loud on
426
- // purpose: mocked data rendered like live data is how testers file bugs
427
- // against reality that never existed.
428
- mockedChip: {
429
- color: night.color.warning,
430
- backgroundColor: night.color.warningSoft,
431
- fontSize: 9,
432
- fontWeight: "700",
433
- letterSpacing: 0.6,
434
- paddingHorizontal: 5,
435
- paddingVertical: 1,
436
- borderRadius: night.radius.badge,
437
- overflow: "hidden"
438
- },
439
- reqHead: {
440
- paddingTop: 12
441
- },
442
- // The segmented control draws its own track; this is only its gutter.
443
- tabs: {
444
- paddingHorizontal: 12,
445
- paddingTop: 4,
446
- paddingBottom: 8
447
- },
448
- tab: {
449
- paddingHorizontal: 10,
450
- paddingVertical: 5,
451
- borderRadius: night.radius.badge,
452
- backgroundColor: night.color.fill
453
- },
454
- tabOn: {
455
- backgroundColor: night.color.accentSoft
456
- },
457
- tabText: {
458
- color: night.color.textSecondary,
459
- fontSize: night.font.micro,
460
- fontWeight: "600"
461
- },
462
- tabTextOn: {
463
- color: night.color.accent
464
- },
465
- body: {
466
- paddingHorizontal: 12,
467
- paddingBottom: 4,
468
- lineHeight: 16,
469
- color: night.color.textSecondary
470
- },
471
- ruleBody: {
472
- paddingHorizontal: 12,
473
- paddingTop: 4,
474
- paddingBottom: 4,
475
- gap: 4
476
- },
477
- ruleLine: {
478
- color: night.color.text,
479
- fontSize: night.font.caption,
480
- lineHeight: 18
481
- },
482
- ruleKey: {
483
- color: night.color.textSecondary,
484
- fontWeight: "700"
485
- },
486
- on: {
487
- alignSelf: "flex-start",
488
- backgroundColor: night.color.accent,
489
- marginTop: 4
490
- },
491
- off: {
492
- alignSelf: "flex-start",
493
- backgroundColor: night.color.fillTertiary,
494
- marginTop: 4
495
- },
496
- chips: {
497
- flexDirection: "row",
498
- flexWrap: "wrap",
499
- gap: 6,
500
- padding: 12
501
- },
502
- chip: {
503
- paddingHorizontal: 10,
504
- paddingVertical: 6,
505
- borderRadius: night.radius.chip,
506
- backgroundColor: night.color.fill,
507
- borderWidth: StyleSheet.hairlineWidth,
508
- borderColor: night.color.border
509
- },
510
- chipCurrent: {
511
- backgroundColor: night.color.accentSoft,
512
- borderColor: night.color.accentBorderStrong
513
- },
514
- chipText: {
515
- color: night.color.text,
516
- fontSize: night.font.caption,
517
- fontFamily: "Menlo"
518
- },
519
- chipDynamic: {
520
- color: night.color.textSecondary
521
- },
522
- logRow: {
523
- alignItems: "flex-start"
524
- },
525
- crashHead: {
526
- flexDirection: "row",
527
- alignItems: "center",
528
- gap: 8,
529
- paddingHorizontal: 12,
530
- paddingTop: 12
531
- },
532
- crashTitle: {
533
- color: night.color.danger,
534
- fontSize: night.font.row,
535
- fontWeight: "600"
536
- },
537
- crashMsg: {
538
- paddingHorizontal: 12,
539
- paddingTop: 6,
540
- color: night.color.text
541
- },
542
- suspect: {
543
- color: night.color.textSecondary,
544
- fontSize: night.font.caption,
545
- paddingHorizontal: 12,
546
- paddingTop: 6
547
- },
548
- peek: {
549
- alignSelf: "flex-start",
550
- flexDirection: "row",
551
- alignItems: "center",
552
- gap: 10,
553
- paddingLeft: 12,
554
- paddingRight: 10,
555
- paddingVertical: 7,
556
- borderRadius: night.radius.chip,
557
- backgroundColor: night.color.fill
558
- },
559
- peekText: {
560
- color: night.color.textSecondary,
561
- fontSize: night.font.caption
562
- },
563
- peekLook: {
564
- flexDirection: "row",
565
- alignItems: "center",
566
- gap: 4
567
- },
568
- peekLookText: {
569
- color: night.color.accent,
570
- fontSize: night.font.caption,
571
- fontWeight: "600"
572
- }
573
- });
574
- //# sourceMappingURL=ReceiptBlocks.js.map
1
+ "use strict";import{useState as R}from"react";import{Pressable as y,StyleSheet as w,Text as l,View as p}from"react-native";import{AlertTriangle as I,ChevronRight as O,Eye as S,night as t,NightSegmented as z}from"@buoy-gg/shared-ui";import{CAPS as m}from"@buoy-gg/agent-core";import{useBlockHandlers as g}from"./context";import{ActionRow as T,blockStyles as s,Card as h,More as b,usePaged as x}from"./primitives";import{jsx as r,jsxs as d}from"react/jsx-runtime";function C(e){if(e===void 0)return t.color.textTertiary;if(e>=500)return t.color.danger;if(e>=400)return t.color.warning;if(e>=300)return t.color.info;return t.color.accent}function $(e){try{const a=new URL(e);return a.pathname+(a.search?"?\u2026":"")}catch{return e}}function v({status:e}){return r(p,{style:[s.pill,{backgroundColor:`${C(e)}22`}],children:r(l,{style:[s.pillText,{color:C(e)}],children:e??"\u2026"})})}export function RequestList({block:e}){const a=g();const c=a.supports?.openTool!==false;const i=x(e.requests,m.listItems);const{visible:o}=i;return d(h,{title:e.title??"Network requests",source:e.source,testID:`buoy-block-requests-${e.id}`,children:[o.map((u,f)=>d(y,{disabled:!c,onPress:()=>void a.runAction({label:"Open in Network",openTool:{toolId:"network",select:u.id}},e.id),style:[s.row,f>0&&s.rowDivider],accessibilityRole:c?"button":void 0,children:[r(l,{style:n.method,children:u.method}),r(l,{style:s.rowTitle,numberOfLines:1,children:$(u.url)}),u.mocked?r(l,{style:n.mockedChip,children:"MOCKED"}):null,u.durationMs!==void 0?d(l,{style:s.rowTrailing,children:[u.durationMs," ms"]}):null,r(v,{status:u.status}),c?r(O,{size:12,color:t.color.textTertiary}):null]},`${u.id}-${f}`)),r(b,{paged:i})]})}const D=[{key:"response",label:"Response"},{key:"request",label:"Request"}];export function RequestCard({block:e}){const[a,c]=R("response");const i=a==="response"?e.responseBody:e.requestBody;const o=i===void 0?"(none)":typeof i==="string"?i:JSON.stringify(i,null,2);const u=g();return d(h,{source:e.source,testID:`buoy-block-request-${e.id}`,children:[d(p,{style:[s.row,n.reqHead],children:[r(l,{style:n.method,children:e.request.method}),r(l,{style:s.rowTitle,numberOfLines:2,children:$(e.request.url)}),e.request.mocked?r(l,{style:n.mockedChip,children:"MOCKED"}):null,r(v,{status:e.request.status})]}),r(p,{style:n.tabs,children:r(z,{tabs:D,activeKey:a,onChange:f=>c(f),size:"sm"})}),r(l,{style:[s.mono,n.body],numberOfLines:14,selectable:true,children:o.length>1600?`${o.slice(0,1600)}
2
+ \u2026`:o}),r(T,{blockId:e.id,actions:[{label:"Open in Network",openTool:{toolId:"network",select:e.request.id}}]}),u.supports?.openTool===false?null:null]})}export function RuleCard({block:e}){const a=g();const c=a.rules?.[e.rule.id];const i=c?.deleted===true;const o={...e.rule,enabled:i?false:c?.enabled??e.rule.enabled};const u=o.kind==="fail"?"fails (no network)":o.kind==="delay"?`delayed ${o.delayMs??0} ms`:`returns ${o.status??200}`;return d(h,{title:o.name??"Network override",source:e.source,testID:`buoy-block-rule-${e.id}`,tone:o.enabled?"warning":void 0,children:[d(p,{style:n.ruleBody,children:[d(l,{style:n.ruleLine,children:[d(l,{style:n.ruleKey,children:[o.methods?.length?o.methods.join("/"):"ANY"," "]}),r(l,{style:s.mono,children:o.urlPattern})]}),d(l,{style:n.ruleLine,children:[r(l,{style:n.ruleKey,children:"\u2192 "}),u,o.times?` \xB7 ${o.times===1?"once":`${o.times} times`}`:" \xB7 every time",o.hits!==void 0?` \xB7 ${o.hits} hit${o.hits===1?"":"s"}`:""]}),r(p,{style:[s.pill,o.enabled?n.on:n.off],children:r(l,{style:[s.pillText,{color:o.enabled?t.color.onAccent:t.color.textSecondary}],children:i?"DELETED":o.enabled?"ON":"OFF"})})]}),i?null:r(T,{blockId:e.id,actions:[o.enabled?{label:"Turn off",dispatch:{toolId:"network",action:"setOverrideRuleEnabled",params:{id:o.id,enabled:false}}}:{label:"Turn on",primary:true,dispatch:{toolId:"network",action:"setOverrideRuleEnabled",params:{id:o.id,enabled:true}}},{label:"Delete",dispatch:{toolId:"network",action:"deleteOverrideRule",params:{id:o.id}}}]})]})}export function ScreenElements({block:e}){const a=g();const c=x(e.elements,m.chips);const{visible:i}=c;return d(h,{title:e.title??"On screen right now",source:e.source,testID:`buoy-block-screen-${e.id}`,children:[i.map((o,u)=>d(y,{onPress:()=>void a.runAction({label:"Highlight",dispatch:{toolId:"highlight-updates",action:"setSpotlight",params:{nativeTag:o.nativeTag}}},e.id),disabled:a.supports?.dispatch===false,style:[s.row,u>0&&s.rowDivider],accessibilityRole:"button",children:[r(S,{size:12,color:t.color.textTertiary}),r(l,{style:s.rowTitle,numberOfLines:1,children:o.label??o.testID??o.name}),r(l,{style:s.rowTrailing,numberOfLines:1,children:o.name})]},`${o.nativeTag}-${u}`)),r(b,{paged:c})]})}export function RouteChips({block:e}){const a=g();const c=x(e.routes,m.chips);const i=c.visible;return d(h,{title:e.current?`Routes \xB7 you're on ${e.current}`:"Routes",source:e.source,testID:`buoy-block-routes-${e.id}`,children:[r(p,{style:n.chips,children:i.map((o,u)=>r(y,{disabled:a.supports?.dispatch===false,onPress:()=>o.dynamic?a.answer({blockId:e.id,kind:"input",value:`Open ${o.path} \u2014 which id?`}):void a.runAction({label:`Open ${o.path}`,dispatch:{toolId:"route-events",action:"navigate",params:{path:o.path}}},e.id),style:[n.chip,o.path===e.current&&n.chipCurrent],accessibilityRole:"button",children:r(l,{style:[n.chipText,o.dynamic&&n.chipDynamic],children:o.path})},`${o.path}-${u}`))}),r(b,{paged:c})]})}const L={error:t.color.danger,warn:t.color.warning,warning:t.color.warning,info:t.color.info};export function LogList({block:e}){const a=x(e.entries,m.listItems);const{visible:c}=a;return d(h,{title:"Console",source:e.source,testID:`buoy-block-logs-${e.id}`,children:[c.map((i,o)=>d(p,{style:[s.row,o>0&&s.rowDivider,n.logRow],children:[r(p,{style:[s.pill,{backgroundColor:`${L[i.level]??t.color.textTertiary}22`}],children:r(l,{style:[s.pillText,{color:L[i.level]??t.color.textSecondary}],children:i.level.toUpperCase()})}),r(l,{style:[s.rowTitle,s.mono],numberOfLines:3,children:i.message}),i.count>1?d(l,{style:s.rowTrailing,children:["\xD7",i.count]}):null]},`${i.level}-${i.message}-${o}`)),r(b,{paged:a})]})}export function Crash({block:e}){return d(h,{tone:"danger",testID:`buoy-block-crash-${e.id}`,children:[d(p,{style:n.crashHead,children:[r(I,{size:14,color:t.color.danger}),d(l,{style:n.crashTitle,children:["The app crashed",e.route?` on ${e.route}`:""]})]}),r(l,{style:[s.mono,n.crashMsg],numberOfLines:4,selectable:true,children:e.message}),e.suspect?d(l,{style:n.suspect,children:["Most likely cause: ",e.suspect.label]}):null,r(T,{blockId:e.id,actions:[...e.suspect?.action?[{...e.suspect.action,primary:true}]:[],...e.actions??[]].slice(0,2)})]})}export function Peek({block:e}){const a=g();const c=a.supports?.minimize!==false;return d(y,{testID:`buoy-block-peek-${e.id}`,disabled:!c,onPress:()=>void a.runAction({label:"Look",minimize:true},e.id),style:({pressed:i})=>[n.peek,i&&{opacity:.7}],accessibilityRole:"button",accessibilityLabel:`${e.label}. Look at the app`,children:[r(l,{style:n.peekText,children:e.label}),c?d(p,{style:n.peekLook,children:[r(S,{size:12,color:t.color.accent}),r(l,{style:n.peekLookText,children:"Look"})]}):null]})}const n=w.create({method:{color:t.color.textSecondary,fontSize:t.font.micro,fontWeight:"700",letterSpacing:.4,width:44},mockedChip:{color:t.color.warning,backgroundColor:t.color.warningSoft,fontSize:9,fontWeight:"700",letterSpacing:.6,paddingHorizontal:5,paddingVertical:1,borderRadius:t.radius.badge,overflow:"hidden"},reqHead:{paddingTop:12},tabs:{paddingHorizontal:12,paddingTop:4,paddingBottom:8},tab:{paddingHorizontal:10,paddingVertical:5,borderRadius:t.radius.badge,backgroundColor:t.color.fill},tabOn:{backgroundColor:t.color.accentSoft},tabText:{color:t.color.textSecondary,fontSize:t.font.micro,fontWeight:"600"},tabTextOn:{color:t.color.accent},body:{paddingHorizontal:12,paddingBottom:4,lineHeight:16,color:t.color.textSecondary},ruleBody:{paddingHorizontal:12,paddingTop:4,paddingBottom:4,gap:4},ruleLine:{color:t.color.text,fontSize:t.font.caption,lineHeight:18},ruleKey:{color:t.color.textSecondary,fontWeight:"700"},on:{alignSelf:"flex-start",backgroundColor:t.color.accent,marginTop:4},off:{alignSelf:"flex-start",backgroundColor:t.color.fillTertiary,marginTop:4},chips:{flexDirection:"row",flexWrap:"wrap",gap:6,padding:12},chip:{paddingHorizontal:10,paddingVertical:6,borderRadius:t.radius.chip,backgroundColor:t.color.fill,borderWidth:w.hairlineWidth,borderColor:t.color.border},chipCurrent:{backgroundColor:t.color.accentSoft,borderColor:t.color.accentBorderStrong},chipText:{color:t.color.text,fontSize:t.font.caption,fontFamily:"Menlo"},chipDynamic:{color:t.color.textSecondary},logRow:{alignItems:"flex-start"},crashHead:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingTop:12},crashTitle:{color:t.color.danger,fontSize:t.font.row,fontWeight:"600"},crashMsg:{paddingHorizontal:12,paddingTop:6,color:t.color.text},suspect:{color:t.color.textSecondary,fontSize:t.font.caption,paddingHorizontal:12,paddingTop:6},peek:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",gap:10,paddingLeft:12,paddingRight:10,paddingVertical:7,borderRadius:t.radius.chip,backgroundColor:t.color.fill},peekText:{color:t.color.textSecondary,fontSize:t.font.caption},peekLook:{flexDirection:"row",alignItems:"center",gap:4},peekLookText:{color:t.color.accent,fontSize:t.font.caption,fontWeight:"600"}});
@@ -1,55 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Blocks as plain text — for Copy, and for the ticket draft's own Copy.
5
- *
6
- * `transcriptToText` used to serialise prose and tool rows only, so a
7
- * conversation whose whole point was the finding card at the end pasted into
8
- * Jira WITHOUT the finding. Covers the kinds that carry facts a person would
9
- * paste; everything else becomes one line naming what was on screen, so the
10
- * paste says a card existed rather than silently skipping it.
11
- */
12
-
13
- const cellText = c => typeof c === "string" ? c : c.text;
14
- export function blockToText(block) {
15
- switch (block.kind) {
16
- case "finding":
17
- return [block.title, ...block.evidence.map(e => `${e.label}: ${e.value}`)].join("\n");
18
- case "keyValue":
19
- return [block.title, ...block.pairs.map(p => `${p.key}: ${typeof p.value === "string" ? p.value : JSON.stringify(p.value)}`)].filter(Boolean).join("\n");
20
- case "table":
21
- {
22
- const head = block.columns.join(" | ");
23
- const rows = block.rows.map(r => r.map(cellText).join(" | "));
24
- const more = block.total && block.total > block.rows.length ? `… ${block.total - block.rows.length} more rows` : null;
25
- return [block.title, head, ...rows, more].filter(Boolean).join("\n");
26
- }
27
- case "list":
28
- {
29
- const rows = block.items.map(i => `- ${i.title}${i.subtitle ? ` — ${i.subtitle}` : ""}${i.trailing ? ` (${i.trailing})` : ""}`);
30
- const more = block.total && block.total > block.items.length ? `… ${block.total - block.items.length} more` : null;
31
- return [block.title, ...rows, more].filter(Boolean).join("\n");
32
- }
33
- case "notice":
34
- return block.text;
35
- case "claim":
36
- return block.text;
37
- case "diff":
38
- case "chart":
39
- case "imageGrid":
40
- case "requestList":
41
- case "requestCard":
42
- case "logList":
43
- case "crash":
44
- case "screenElements":
45
- return `[${block.kind} card${"title" in block && typeof block.title === "string" ? `: ${block.title}` : ""}]`;
46
- default:
47
- return null;
48
- }
49
- }
50
-
51
- /** Several blocks, blank-line separated, skipping the ones with nothing to say. */
52
- export function blocksToText(blocks) {
53
- return blocks.map(blockToText).filter(t => !!t);
54
- }
55
- //# sourceMappingURL=blockText.js.map
1
+ "use strict";const a=t=>typeof t==="string"?t:t.text;export function blockToText(t){switch(t.kind){case"finding":return[t.title,...t.evidence.map(e=>`${e.label}: ${e.value}`)].join("\n");case"keyValue":return[t.title,...t.pairs.map(e=>`${e.key}: ${typeof e.value==="string"?e.value:JSON.stringify(e.value)}`)].filter(Boolean).join("\n");case"table":{const e=t.columns.join(" | ");const r=t.rows.map(s=>s.map(a).join(" | "));const n=t.total&&t.total>t.rows.length?`\u2026 ${t.total-t.rows.length} more rows`:null;return[t.title,e,...r,n].filter(Boolean).join("\n")}case"list":{const e=t.items.map(n=>`- ${n.title}${n.subtitle?` \u2014 ${n.subtitle}`:""}${n.trailing?` (${n.trailing})`:""}`);const r=t.total&&t.total>t.items.length?`\u2026 ${t.total-t.items.length} more`:null;return[t.title,...e,r].filter(Boolean).join("\n")}case"notice":return t.text;case"claim":return t.text;case"diff":case"chart":case"imageGrid":case"requestList":case"requestCard":case"logList":case"crash":case"screenElements":return`[${t.kind} card${"title"in t&&typeof t.title==="string"?`: ${t.title}`:""}]`;default:return null}}export function blocksToText(t){return t.map(blockToText).filter(e=>!!e)}