@buoy-gg/ask-buoy 7.0.40 → 7.0.42

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