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