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