@buoy-gg/network 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 (272) hide show
  1. package/README.md +11 -85
  2. package/lib/commonjs/index.js +1 -332
  3. package/lib/commonjs/index.web.js +1 -420
  4. package/lib/commonjs/network/components/DataViewer.web.js +1 -879
  5. package/lib/commonjs/network/components/NetworkCopyScreen.web.js +1 -48
  6. package/lib/commonjs/network/components/NetworkCopySettingsView.js +27 -755
  7. package/lib/commonjs/network/components/NetworkCopySettingsView.web.js +14 -1242
  8. package/lib/commonjs/network/components/NetworkDetailScreen.web.js +1 -101
  9. package/lib/commonjs/network/components/NetworkDetailStepper.js +1 -108
  10. package/lib/commonjs/network/components/NetworkDetailStepper.web.js +1 -298
  11. package/lib/commonjs/network/components/NetworkEventDetailView.js +15 -1130
  12. package/lib/commonjs/network/components/NetworkEventDetailView.web.js +15 -1484
  13. package/lib/commonjs/network/components/NetworkEventItemCompact.js +2 -401
  14. package/lib/commonjs/network/components/NetworkEventItemCompact.web.js +2 -820
  15. package/lib/commonjs/network/components/NetworkFilterScreen.web.js +1 -55
  16. package/lib/commonjs/network/components/NetworkFilterViewV3.js +1 -442
  17. package/lib/commonjs/network/components/NetworkFilterViewV3.web.js +1 -1310
  18. package/lib/commonjs/network/components/NetworkHeaderLive.js +1 -375
  19. package/lib/commonjs/network/components/NetworkHeaderLive.web.js +1 -623
  20. package/lib/commonjs/network/components/NetworkHeaderMenu.js +1 -190
  21. package/lib/commonjs/network/components/NetworkListScreen.js +1 -403
  22. package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -624
  23. package/lib/commonjs/network/components/NetworkModal.js +1 -786
  24. package/lib/commonjs/network/components/NetworkNumberPrompt.js +1 -178
  25. package/lib/commonjs/network/components/NetworkNumberPrompt.web.js +1 -232
  26. package/lib/commonjs/network/components/NetworkOverrideEditor.js +1 -814
  27. package/lib/commonjs/network/components/NetworkOverrideEditor.web.js +1 -942
  28. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.js +1 -107
  29. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.web.js +1 -133
  30. package/lib/commonjs/network/components/NetworkOverridesButton.js +1 -90
  31. package/lib/commonjs/network/components/NetworkOverridesButton.web.js +1 -143
  32. package/lib/commonjs/network/components/NetworkOverridesScreen.js +1 -543
  33. package/lib/commonjs/network/components/NetworkOverridesScreen.web.js +1 -830
  34. package/lib/commonjs/network/components/NetworkSavedScreen.js +1 -226
  35. package/lib/commonjs/network/components/NetworkSavedScreen.web.js +1 -463
  36. package/lib/commonjs/network/components/NetworkUpgradeBanner.js +1 -76
  37. package/lib/commonjs/network/components/response-editor/Explorer.js +1 -973
  38. package/lib/commonjs/network/components/response-editor/Explorer.web.js +1 -1136
  39. package/lib/commonjs/network/components/response-editor/deleteNestedDataByPath.js +1 -56
  40. package/lib/commonjs/network/components/response-editor/editorContext.js +1 -33
  41. package/lib/commonjs/network/components/response-editor/updateNestedDataByPath.js +1 -61
  42. package/lib/commonjs/network/conditions/NetworkConditionsControl.js +1 -235
  43. package/lib/commonjs/network/conditions/NetworkConditionsControl.test.js +1 -136
  44. package/lib/commonjs/network/conditions/NetworkConditionsIcon.js +1 -33
  45. package/lib/commonjs/network/conditions/NetworkFloatingTool.js +1 -310
  46. package/lib/commonjs/network/conditions/NetworkFloatingTool.test.js +1 -219
  47. package/lib/commonjs/network/conditions/store.js +1 -75
  48. package/lib/commonjs/network/conditions/wait.js +1 -43
  49. package/lib/commonjs/network/conditions/xhr.js +1 -135
  50. package/lib/commonjs/network/hooks/useLiveNetworkEvent.js +1 -62
  51. package/lib/commonjs/network/hooks/useNetworkBadgeCounts.js +1 -83
  52. package/lib/commonjs/network/hooks/useNetworkEventList.js +1 -108
  53. package/lib/commonjs/network/hooks/useNetworkEvents.js +1 -318
  54. package/lib/commonjs/network/hooks/useNetworkHasMatches.js +1 -56
  55. package/lib/commonjs/network/hooks/useNetworkSaved.js +1 -38
  56. package/lib/commonjs/network/hooks/useNetworkSelection.js +1 -53
  57. package/lib/commonjs/network/hooks/useOverrideRules.js +1 -36
  58. package/lib/commonjs/network/hooks/useTickEveryMinute.js +1 -21
  59. package/lib/commonjs/network/overrides/applyToFetch.js +1 -80
  60. package/lib/commonjs/network/overrides/applyToXhr.js +2 -510
  61. package/lib/commonjs/network/overrides/engine.js +1 -93
  62. package/lib/commonjs/network/overrides/matchRule.js +1 -87
  63. package/lib/commonjs/network/overrides/overriddenRows.js +1 -37
  64. package/lib/commonjs/network/overrides/overrideRulesStore.js +1 -550
  65. package/lib/commonjs/network/overrides/presets.js +1 -70
  66. package/lib/commonjs/network/overrides/resolveOverride.js +1 -158
  67. package/lib/commonjs/network/overrides/types.js +1 -90
  68. package/lib/commonjs/network/sync/networkBodyResolver.js +1 -39
  69. package/lib/commonjs/network/sync/networkSyncAdapter.js +1 -882
  70. package/lib/commonjs/network/sync/overrideHonesty.release.test.js +1 -36
  71. package/lib/commonjs/network/types/index.js +1 -5
  72. package/lib/commonjs/network/utils/extractOperationName.js +1 -80
  73. package/lib/commonjs/network/utils/filterNetworkEvents.js +1 -96
  74. package/lib/commonjs/network/utils/formatGraphQLVariables.js +1 -219
  75. package/lib/commonjs/network/utils/formatting.js +1 -30
  76. package/lib/commonjs/network/utils/generateCurl.js +2 -71
  77. package/lib/commonjs/network/utils/generateNetworkCopyText.js +37 -166
  78. package/lib/commonjs/network/utils/httpCompletion.js +1 -37
  79. package/lib/commonjs/network/utils/networkEventStore.js +1 -411
  80. package/lib/commonjs/network/utils/networkListener.js +4 -1352
  81. package/lib/commonjs/network/utils/networkSavedStore.js +3 -577
  82. package/lib/commonjs/network/utils/networkSelectionStore.js +1 -193
  83. package/lib/commonjs/network/utils/realNow.js +1 -0
  84. package/lib/commonjs/network/utils/requestId.js +1 -16
  85. package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -15
  86. package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
  87. package/lib/commonjs/network/utils/startNetworkCapture.js +1 -24
  88. package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
  89. package/lib/commonjs/preset.js +1 -93
  90. package/lib/module/index.js +1 -104
  91. package/lib/module/index.web.js +1 -82
  92. package/lib/module/network/components/DataViewer.web.js +1 -875
  93. package/lib/module/network/components/NetworkCopyScreen.web.js +1 -44
  94. package/lib/module/network/components/NetworkCopySettingsView.js +27 -750
  95. package/lib/module/network/components/NetworkCopySettingsView.web.js +14 -1237
  96. package/lib/module/network/components/NetworkDetailScreen.web.js +1 -97
  97. package/lib/module/network/components/NetworkDetailStepper.js +1 -104
  98. package/lib/module/network/components/NetworkDetailStepper.web.js +1 -296
  99. package/lib/module/network/components/NetworkEventDetailView.js +15 -1129
  100. package/lib/module/network/components/NetworkEventDetailView.web.js +15 -1482
  101. package/lib/module/network/components/NetworkEventItemCompact.js +2 -398
  102. package/lib/module/network/components/NetworkEventItemCompact.web.js +2 -818
  103. package/lib/module/network/components/NetworkFilterScreen.web.js +1 -51
  104. package/lib/module/network/components/NetworkFilterViewV3.js +1 -438
  105. package/lib/module/network/components/NetworkFilterViewV3.web.js +1 -1306
  106. package/lib/module/network/components/NetworkHeaderLive.js +1 -366
  107. package/lib/module/network/components/NetworkHeaderLive.web.js +1 -617
  108. package/lib/module/network/components/NetworkHeaderMenu.js +1 -184
  109. package/lib/module/network/components/NetworkListScreen.js +1 -399
  110. package/lib/module/network/components/NetworkListScreen.web.js +1 -622
  111. package/lib/module/network/components/NetworkModal.js +1 -781
  112. package/lib/module/network/components/NetworkNumberPrompt.js +1 -174
  113. package/lib/module/network/components/NetworkNumberPrompt.web.js +1 -230
  114. package/lib/module/network/components/NetworkOverrideEditor.js +1 -811
  115. package/lib/module/network/components/NetworkOverrideEditor.web.js +1 -939
  116. package/lib/module/network/components/NetworkOverrideHeaderButton.js +1 -104
  117. package/lib/module/network/components/NetworkOverrideHeaderButton.web.js +1 -131
  118. package/lib/module/network/components/NetworkOverridesButton.js +1 -87
  119. package/lib/module/network/components/NetworkOverridesButton.web.js +1 -141
  120. package/lib/module/network/components/NetworkOverridesScreen.js +1 -539
  121. package/lib/module/network/components/NetworkOverridesScreen.web.js +1 -826
  122. package/lib/module/network/components/NetworkSavedScreen.js +1 -222
  123. package/lib/module/network/components/NetworkSavedScreen.web.js +1 -461
  124. package/lib/module/network/components/NetworkUpgradeBanner.js +1 -72
  125. package/lib/module/network/components/response-editor/Explorer.js +1 -972
  126. package/lib/module/network/components/response-editor/Explorer.web.js +1 -1133
  127. package/lib/module/network/components/response-editor/deleteNestedDataByPath.js +1 -51
  128. package/lib/module/network/components/response-editor/editorContext.js +1 -29
  129. package/lib/module/network/components/response-editor/updateNestedDataByPath.js +1 -56
  130. package/lib/module/network/conditions/NetworkConditionsControl.js +1 -231
  131. package/lib/module/network/conditions/NetworkConditionsControl.test.js +1 -135
  132. package/lib/module/network/conditions/NetworkConditionsIcon.js +1 -29
  133. package/lib/module/network/conditions/NetworkFloatingTool.js +1 -304
  134. package/lib/module/network/conditions/NetworkFloatingTool.test.js +1 -218
  135. package/lib/module/network/conditions/store.js +1 -65
  136. package/lib/module/network/conditions/wait.js +1 -38
  137. package/lib/module/network/conditions/xhr.js +1 -131
  138. package/lib/module/network/hooks/useLiveNetworkEvent.js +1 -58
  139. package/lib/module/network/hooks/useNetworkBadgeCounts.js +1 -79
  140. package/lib/module/network/hooks/useNetworkEventList.js +1 -104
  141. package/lib/module/network/hooks/useNetworkEvents.js +1 -314
  142. package/lib/module/network/hooks/useNetworkHasMatches.js +1 -52
  143. package/lib/module/network/hooks/useNetworkSaved.js +1 -34
  144. package/lib/module/network/hooks/useNetworkSelection.js +1 -46
  145. package/lib/module/network/hooks/useOverrideRules.js +1 -32
  146. package/lib/module/network/hooks/useTickEveryMinute.js +1 -11
  147. package/lib/module/network/overrides/applyToFetch.js +1 -72
  148. package/lib/module/network/overrides/applyToXhr.js +2 -502
  149. package/lib/module/network/overrides/engine.js +1 -85
  150. package/lib/module/network/overrides/matchRule.js +1 -81
  151. package/lib/module/network/overrides/overriddenRows.js +1 -33
  152. package/lib/module/network/overrides/overrideRulesStore.js +1 -547
  153. package/lib/module/network/overrides/presets.js +1 -65
  154. package/lib/module/network/overrides/resolveOverride.js +1 -152
  155. package/lib/module/network/overrides/types.js +1 -86
  156. package/lib/module/network/sync/networkBodyResolver.js +1 -34
  157. package/lib/module/network/sync/networkSyncAdapter.js +1 -880
  158. package/lib/module/network/sync/overrideHonesty.release.test.js +1 -35
  159. package/lib/module/network/types/index.js +1 -3
  160. package/lib/module/network/utils/extractOperationName.js +1 -76
  161. package/lib/module/network/utils/filterNetworkEvents.js +1 -92
  162. package/lib/module/network/utils/formatGraphQLVariables.js +1 -213
  163. package/lib/module/network/utils/formatting.js +1 -9
  164. package/lib/module/network/utils/generateCurl.js +2 -67
  165. package/lib/module/network/utils/generateNetworkCopyText.js +37 -162
  166. package/lib/module/network/utils/httpCompletion.js +1 -32
  167. package/lib/module/network/utils/networkEventStore.js +1 -409
  168. package/lib/module/network/utils/networkListener.js +4 -1341
  169. package/lib/module/network/utils/networkSavedStore.js +3 -572
  170. package/lib/module/network/utils/networkSelectionStore.js +1 -188
  171. package/lib/module/network/utils/realNow.js +1 -0
  172. package/lib/module/network/utils/requestId.js +1 -12
  173. package/lib/module/network/utils/resolveRequestUrl.js +1 -11
  174. package/lib/module/network/utils/selectSavedEvents.js +1 -35
  175. package/lib/module/network/utils/startNetworkCapture.js +1 -21
  176. package/lib/module/network/utils/withPinnedFirst.js +1 -28
  177. package/lib/module/preset.js +1 -91
  178. package/lib/typescript/network/overrides/engine.d.ts +1 -1
  179. package/lib/typescript/network/overrides/matchRule.d.ts +1 -1
  180. package/lib/typescript/network/overrides/resolveOverride.d.ts +2 -2
  181. package/lib/typescript/network/overrides/types.d.ts +9 -0
  182. package/lib/typescript/network/utils/networkListener.d.ts +11 -0
  183. package/lib/typescript/network/utils/realNow.d.ts +18 -0
  184. package/lib/web/index.mjs +73 -74
  185. package/package.json +2 -2
  186. package/lib/typescript/index.d.ts.map +0 -1
  187. package/lib/typescript/index.web.d.ts.map +0 -1
  188. package/lib/typescript/network/components/DataViewer.web.d.ts.map +0 -1
  189. package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +0 -1
  190. package/lib/typescript/network/components/NetworkCopySettingsView.d.ts.map +0 -1
  191. package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +0 -1
  192. package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +0 -1
  193. package/lib/typescript/network/components/NetworkDetailStepper.d.ts.map +0 -1
  194. package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +0 -1
  195. package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +0 -1
  196. package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +0 -1
  197. package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +0 -1
  198. package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +0 -1
  199. package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +0 -1
  200. package/lib/typescript/network/components/NetworkFilterViewV3.d.ts.map +0 -1
  201. package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +0 -1
  202. package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +0 -1
  203. package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +0 -1
  204. package/lib/typescript/network/components/NetworkHeaderMenu.d.ts.map +0 -1
  205. package/lib/typescript/network/components/NetworkListScreen.d.ts.map +0 -1
  206. package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +0 -1
  207. package/lib/typescript/network/components/NetworkModal.d.ts.map +0 -1
  208. package/lib/typescript/network/components/NetworkNumberPrompt.d.ts.map +0 -1
  209. package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +0 -1
  210. package/lib/typescript/network/components/NetworkOverrideEditor.d.ts.map +0 -1
  211. package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +0 -1
  212. package/lib/typescript/network/components/NetworkOverrideHeaderButton.d.ts.map +0 -1
  213. package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +0 -1
  214. package/lib/typescript/network/components/NetworkOverridesButton.d.ts.map +0 -1
  215. package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +0 -1
  216. package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +0 -1
  217. package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +0 -1
  218. package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +0 -1
  219. package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +0 -1
  220. package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +0 -1
  221. package/lib/typescript/network/components/response-editor/Explorer.d.ts.map +0 -1
  222. package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +0 -1
  223. package/lib/typescript/network/components/response-editor/deleteNestedDataByPath.d.ts.map +0 -1
  224. package/lib/typescript/network/components/response-editor/editorContext.d.ts.map +0 -1
  225. package/lib/typescript/network/components/response-editor/updateNestedDataByPath.d.ts.map +0 -1
  226. package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts.map +0 -1
  227. package/lib/typescript/network/conditions/NetworkConditionsControl.test.d.ts.map +0 -1
  228. package/lib/typescript/network/conditions/NetworkConditionsIcon.d.ts.map +0 -1
  229. package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts.map +0 -1
  230. package/lib/typescript/network/conditions/NetworkFloatingTool.test.d.ts.map +0 -1
  231. package/lib/typescript/network/conditions/store.d.ts.map +0 -1
  232. package/lib/typescript/network/conditions/wait.d.ts.map +0 -1
  233. package/lib/typescript/network/conditions/xhr.d.ts.map +0 -1
  234. package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +0 -1
  235. package/lib/typescript/network/hooks/useNetworkBadgeCounts.d.ts.map +0 -1
  236. package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +0 -1
  237. package/lib/typescript/network/hooks/useNetworkEvents.d.ts.map +0 -1
  238. package/lib/typescript/network/hooks/useNetworkHasMatches.d.ts.map +0 -1
  239. package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +0 -1
  240. package/lib/typescript/network/hooks/useNetworkSelection.d.ts.map +0 -1
  241. package/lib/typescript/network/hooks/useOverrideRules.d.ts.map +0 -1
  242. package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +0 -1
  243. package/lib/typescript/network/overrides/applyToFetch.d.ts.map +0 -1
  244. package/lib/typescript/network/overrides/applyToXhr.d.ts.map +0 -1
  245. package/lib/typescript/network/overrides/engine.d.ts.map +0 -1
  246. package/lib/typescript/network/overrides/matchRule.d.ts.map +0 -1
  247. package/lib/typescript/network/overrides/overriddenRows.d.ts.map +0 -1
  248. package/lib/typescript/network/overrides/overrideRulesStore.d.ts.map +0 -1
  249. package/lib/typescript/network/overrides/presets.d.ts.map +0 -1
  250. package/lib/typescript/network/overrides/resolveOverride.d.ts.map +0 -1
  251. package/lib/typescript/network/overrides/types.d.ts.map +0 -1
  252. package/lib/typescript/network/sync/networkBodyResolver.d.ts.map +0 -1
  253. package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +0 -1
  254. package/lib/typescript/network/sync/overrideHonesty.release.test.d.ts.map +0 -1
  255. package/lib/typescript/network/types/index.d.ts.map +0 -1
  256. package/lib/typescript/network/utils/extractOperationName.d.ts.map +0 -1
  257. package/lib/typescript/network/utils/filterNetworkEvents.d.ts.map +0 -1
  258. package/lib/typescript/network/utils/formatGraphQLVariables.d.ts.map +0 -1
  259. package/lib/typescript/network/utils/formatting.d.ts.map +0 -1
  260. package/lib/typescript/network/utils/generateCurl.d.ts.map +0 -1
  261. package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +0 -1
  262. package/lib/typescript/network/utils/httpCompletion.d.ts.map +0 -1
  263. package/lib/typescript/network/utils/networkEventStore.d.ts.map +0 -1
  264. package/lib/typescript/network/utils/networkListener.d.ts.map +0 -1
  265. package/lib/typescript/network/utils/networkSavedStore.d.ts.map +0 -1
  266. package/lib/typescript/network/utils/networkSelectionStore.d.ts.map +0 -1
  267. package/lib/typescript/network/utils/requestId.d.ts.map +0 -1
  268. package/lib/typescript/network/utils/resolveRequestUrl.d.ts.map +0 -1
  269. package/lib/typescript/network/utils/selectSavedEvents.d.ts.map +0 -1
  270. package/lib/typescript/network/utils/startNetworkCapture.d.ts.map +0 -1
  271. package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +0 -1
  272. package/lib/typescript/preset.d.ts.map +0 -1
@@ -1,188 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Which request the detail view is showing, and where it sits in the list —
5
- * the prev/next CURSOR.
6
- *
7
- * ## Why this is a store and not `useState` in the modal
8
- *
9
- * It used to be `useState` in `NetworkModalInner`. Every tap on Previous/Next
10
- * therefore dirtied the modal ROOT, which re-rendered `JsModal` (1833 lines,
11
- * nine useStates, animations/gestures/persistence — and it can never bail out,
12
- * because its `header` prop is a fresh object literal every render), the whole
13
- * header, and all five screens. None of them care which request is selected;
14
- * they only care THAT one is.
15
- *
16
- * This is the same argument `NetworkModal`'s own header comment already makes
17
- * about network events ("with the subscription here, 15 events re-rendered
18
- * JsModal + every header button 15×"). Stepping is that same class of
19
- * high-frequency churn, and it was sitting in the same wrong place. Now the
20
- * root subscribes to `hasSelection` — a boolean that flips twice a session —
21
- * while the footer, the body and the header's pin actions subscribe to the
22
- * parts they actually render.
23
- *
24
- * ## The three cursors
25
- *
26
- * `selectedId` is where the USER is. It moves on the tap, synchronously.
27
- *
28
- * `bodyId` is what the detail body is allowed to render, and it deliberately
29
- * LAGS: drawing a request means handing its payload to the virtualized data
30
- * viewer to flatten, and that has no business blocking the next tap. It
31
- * catches up only once the selection has held still for `settleMs`, so a
32
- * burst of taps renders the request you land on and none of the ones you flew
33
- * past. (`useDeferredValue` was tried here first and is the wrong tool — it
34
- * lowers the priority of that work without preventing it, so every settled
35
- * step still queued a flatten and each one delayed the touch behind it.)
36
- *
37
- * `renderedId` is what actually made it to the screen, reported by the detail
38
- * screen after commit. Nothing in the product reads it; it exists so the
39
- * benchmark harness can measure "time until request N was really painted"
40
- * separately from "time until the cursor reached N".
41
- */
42
-
43
- /**
44
- * How long the selection must hold still before the body renders it. Short
45
- * enough that a single step reads as immediate (the footer and header have
46
- * already moved), long enough that a burst collapses to one render.
47
- */
48
- export const DEFAULT_SETTLE_MS = 120;
49
- class NetworkSelectionStore {
50
- ids = [];
51
- index = -1;
52
- selectedId = null;
53
- bodyId = null;
54
- renderedId = null;
55
- settleMs = DEFAULT_SETTLE_MS;
56
- settleTimer = null;
57
- subscribers = new Set();
58
- snapshot = this.buildSnapshot();
59
- buildSnapshot() {
60
- return {
61
- ids: this.ids,
62
- index: this.index,
63
- selectedId: this.selectedId,
64
- bodyId: this.bodyId,
65
- renderedId: this.renderedId
66
- };
67
- }
68
-
69
- /**
70
- * One immutable snapshot per mutation, so subscribers can identity-compare
71
- * and `useSyncExternalStore` stays happy.
72
- */
73
- emit() {
74
- this.snapshot = this.buildSnapshot();
75
- for (const subscriber of this.subscribers) subscriber(this.snapshot);
76
- }
77
- getState() {
78
- return this.snapshot;
79
- }
80
- subscribe(subscriber) {
81
- this.subscribers.add(subscriber);
82
- return () => {
83
- this.subscribers.delete(subscriber);
84
- };
85
- }
86
-
87
- /**
88
- * Publish the navigable order. Called by the stepper whenever its derived
89
- * list changes (filter, search, pins, new requests arriving).
90
- *
91
- * The cursor is re-anchored BY ID, not by position: the live list is
92
- * newest-first and new requests are prepended, so holding an index would
93
- * silently slide the selection onto a different request every time one
94
- * landed.
95
- */
96
- setIds(ids) {
97
- const sameIds = ids.length === this.ids.length && ids.every((id, i) => id === this.ids[i]);
98
- if (sameIds) return;
99
- this.ids = ids;
100
- this.index = this.selectedId == null ? -1 : ids.indexOf(this.selectedId);
101
- this.emit();
102
- }
103
- select(id) {
104
- if (id === this.selectedId) return;
105
- this.selectedId = id;
106
- this.index = id == null ? -1 : this.ids.indexOf(id);
107
- this.scheduleBody(id);
108
- this.emit();
109
- }
110
- clear() {
111
- this.select(null);
112
- }
113
-
114
- /**
115
- * Move the cursor. O(1) — the whole reason `index` is stored rather than
116
- * re-derived with a `findIndex` on every render.
117
- *
118
- * Returns the id it landed on, or null if the move was out of bounds (the
119
- * footer disables its arrows at the ends, but the benchmark driver calls
120
- * this directly and needs to know when it has run off the end).
121
- */
122
- step(delta) {
123
- if (this.index < 0) return null;
124
- const next = this.index + delta;
125
- if (next < 0 || next >= this.ids.length) return null;
126
- const id = this.ids[next];
127
- this.selectedId = id;
128
- this.index = next;
129
- this.scheduleBody(id);
130
- this.emit();
131
- return id;
132
- }
133
-
134
- /**
135
- * Opening and closing skip the settle delay: there is no in-flight render to
136
- * protect on a null↔id transition, and waiting there just reads as a hang.
137
- * Only id → id steps debounce.
138
- */
139
- scheduleBody(id) {
140
- if (this.settleTimer != null) {
141
- clearTimeout(this.settleTimer);
142
- this.settleTimer = null;
143
- }
144
- if (id == null || this.bodyId == null || this.settleMs <= 0) {
145
- this.bodyId = id;
146
- return;
147
- }
148
- this.settleTimer = setTimeout(() => {
149
- this.settleTimer = null;
150
- if (this.bodyId === this.selectedId) return;
151
- this.bodyId = this.selectedId;
152
- this.emit();
153
- }, this.settleMs);
154
- }
155
-
156
- /** Benchmark toggle — `?settle=0` measures the gate's contribution. */
157
- setSettleMs(ms) {
158
- this.settleMs = Math.max(0, ms);
159
- }
160
- getSettleMs() {
161
- return this.settleMs;
162
- }
163
-
164
- /** Reported by the detail screen after commit. Instrumentation only. */
165
- reportRendered(id) {
166
- if (id === this.renderedId) return;
167
- this.renderedId = id;
168
- this.emit();
169
- }
170
-
171
- /** Test/bench helper — drop all cursor state without touching the events. */
172
- reset() {
173
- if (this.settleTimer != null) clearTimeout(this.settleTimer);
174
- this.settleTimer = null;
175
- this.ids = [];
176
- this.index = -1;
177
- this.selectedId = null;
178
- this.bodyId = null;
179
- this.renderedId = null;
180
- this.emit();
181
- }
182
- }
183
- export const networkSelectionStore = new NetworkSelectionStore();
184
-
185
- /** Convenience for publishing an event list as the navigable order. */
186
- export function toSelectionIds(events) {
187
- return events.map(event => event.id);
188
- }
1
+ "use strict";export const DEFAULT_SETTLE_MS=120;class l{ids=[];index=-1;selectedId=null;bodyId=null;renderedId=null;settleMs=DEFAULT_SETTLE_MS;settleTimer=null;subscribers=new Set;snapshot=this.buildSnapshot();buildSnapshot(){return{ids:this.ids,index:this.index,selectedId:this.selectedId,bodyId:this.bodyId,renderedId:this.renderedId}}emit(){this.snapshot=this.buildSnapshot();for(const e of this.subscribers)e(this.snapshot)}getState(){return this.snapshot}subscribe(e){this.subscribers.add(e);return()=>{this.subscribers.delete(e)}}setIds(e){const t=e.length===this.ids.length&&e.every((s,d)=>s===this.ids[d]);if(t)return;this.ids=e;this.index=this.selectedId==null?-1:e.indexOf(this.selectedId);this.emit()}select(e){if(e===this.selectedId)return;this.selectedId=e;this.index=e==null?-1:this.ids.indexOf(e);this.scheduleBody(e);this.emit()}clear(){this.select(null)}step(e){if(this.index<0)return null;const t=this.index+e;if(t<0||t>=this.ids.length)return null;const s=this.ids[t];this.selectedId=s;this.index=t;this.scheduleBody(s);this.emit();return s}scheduleBody(e){if(this.settleTimer!=null){clearTimeout(this.settleTimer);this.settleTimer=null}if(e==null||this.bodyId==null||this.settleMs<=0){this.bodyId=e;return}this.settleTimer=setTimeout(()=>{this.settleTimer=null;if(this.bodyId===this.selectedId)return;this.bodyId=this.selectedId;this.emit()},this.settleMs)}setSettleMs(e){this.settleMs=Math.max(0,e)}getSettleMs(){return this.settleMs}reportRendered(e){if(e===this.renderedId)return;this.renderedId=e;this.emit()}reset(){if(this.settleTimer!=null)clearTimeout(this.settleTimer);this.settleTimer=null;this.ids=[];this.index=-1;this.selectedId=null;this.bodyId=null;this.renderedId=null;this.emit()}}export const networkSelectionStore=new l;export function toSelectionIds(i){return i.map(e=>e.id)}
@@ -0,0 +1 @@
1
+ "use strict";export function realNow(){const e=globalThis.__buoyRealNow;return typeof e==="function"?e():Date.now()}function t(){const e=globalThis.__buoyRealTimers;return e??globalThis}export function realSetTimeout(e,o){return t().setTimeout(e,o)}export function realClearTimeout(e){t().clearTimeout(e)}
@@ -1,12 +1 @@
1
- "use strict";
2
-
3
- const runtime = globalThis;
4
-
5
- // Keep identity across Fast Refresh; distinguish requests from earlier app runs.
6
- export function nextRequestId(client) {
7
- const sequence = runtime.__BUOY_NETWORK_REQUEST_SEQUENCE__ ??= {
8
- session: `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,
9
- next: 0
10
- };
11
- return `${client}_${sequence.session}_${++sequence.next}`;
12
- }
1
+ "use strict";const n=globalThis;export function nextRequestId(e){const t=n.__BUOY_NETWORK_REQUEST_SEQUENCE__??={session:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,next:0};return`${e}_${t.session}_${++t.next}`}
@@ -1,11 +1 @@
1
- "use strict";
2
-
3
- /** Resolve browser-relative URLs for capture without changing the request arguments. */
4
- export function resolveRequestUrl(url) {
5
- if (typeof document === "undefined") return url;
6
- try {
7
- return new URL(url, document.baseURI).href;
8
- } catch {
9
- return url;
10
- }
11
- }
1
+ "use strict";export function resolveRequestUrl(e){if(typeof document==="undefined")return e;try{return new URL(e,document.baseURI).href}catch{return e}}
@@ -1,35 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * The SAVED screen's visible list, as a pure function.
5
- *
6
- * Two places need the exact same list: the screen that renders it
7
- * (`NetworkSavedScreen`) and the detail footer that steps through it
8
- * (`NetworkDetailStepper`). If they derived it independently, "Next" would
9
- * eventually disagree with the row below — the same drift `withPinnedFirst`
10
- * exists to prevent for the live list.
11
- */
12
-
13
- import { filterNetworkEvents } from "./filterNetworkEvents";
14
- import { MAX_SAVED } from "./networkSavedStore";
15
- export function selectSavedEvents(savedRecords,
16
- /**
17
- * How many saves this tier may see — `useLimit("network.saved")`. Takes a
18
- * number rather than `isPro` because Pro's cap is 50, not unlimited, and a
19
- * boolean cannot express that.
20
- */
21
- limit, search) {
22
- /**
23
- * A downgrade (or a limit change) can leave a user holding more saves than
24
- * their tier allows. Rather than deleting their data, the overflow is
25
- * LOCKED — oldest first, so the newest saves stay reachable.
26
- */
27
- const unlocked = savedRecords.slice(0, Math.min(limit, MAX_SAVED));
28
- const events = unlocked.map(record => record.event);
29
- return {
30
- events: search ? filterNetworkEvents(events, {
31
- searchText: search
32
- }) : events,
33
- lockedCount: savedRecords.length - unlocked.length
34
- };
35
- }
1
+ "use strict";import{filterNetworkEvents as c}from"./filterNetworkEvents";import{MAX_SAVED as i}from"./networkSavedStore";export function selectSavedEvents(t,r,e){const n=t.slice(0,Math.min(r,i));const o=n.map(s=>s.event);return{events:e?c(o,{searchText:e}):o,lockedCount:t.length-n.length}}
@@ -1,21 +1 @@
1
- "use strict";
2
-
3
- import { networkEventStore } from "./networkEventStore";
4
- import { overrideRulesStore } from "../overrides/overrideRulesStore";
5
-
6
- /**
7
- * Keep local capture active while the Network panel is closed.
8
- * Call in the app being inspected and dispose during unmount or HMR cleanup.
9
- */
10
- export function startNetworkCapture() {
11
- const native = typeof navigator !== "undefined" && navigator.product === "ReactNative";
12
- if (!native && (typeof window === "undefined" || typeof document === "undefined")) return () => {};
13
- void overrideRulesStore.ensureLoaded();
14
- const unsubscribe = networkEventStore.subscribeToEvents(() => {});
15
- let stopped = false;
16
- return () => {
17
- if (stopped) return;
18
- stopped = true;
19
- unsubscribe();
20
- };
21
- }
1
+ "use strict";import{networkEventStore as o}from"./networkEventStore";import{overrideRulesStore as n}from"../overrides/overrideRulesStore";export function startNetworkCapture(){const t=typeof navigator!=="undefined"&&navigator.product==="ReactNative";if(!t&&(typeof window==="undefined"||typeof document==="undefined"))return()=>{};void n.ensureLoaded();const r=o.subscribeToEvents(()=>{});let e=false;return()=>{if(e)return;e=true;r()}}
@@ -1,28 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Split a filtered event list into its PINNED section and the rest.
5
- *
6
- * Lives as a pure function because there are TWO list implementations — the
7
- * mobile modal's `NetworkListScreen` and the desktop dashboard's hand-mirrored
8
- * `NetworkInline` — and pin ordering silently diverging between them is
9
- * exactly the drift `buoy.tools.json` exists to prevent.
10
- *
11
- * Pins are deliberately NOT filtered: they come straight from the saved store,
12
- * so a pinned request stays visible no matter what the search box or the
13
- * status chips say. The only thing the filtered list contributes is the
14
- * dedupe — a pinned request that is still live must not render twice.
15
- */
16
-
17
- const EMPTY = [];
18
- export function splitPinned(filtered, pinnedEvents, /** Live IDs pinned in THIS session — from `networkSavedStore.getState()`. */
19
- pinnedLiveIds) {
20
- if (pinnedEvents.length === 0) return {
21
- pinned: EMPTY,
22
- rest: filtered
23
- };
24
- return {
25
- pinned: pinnedEvents,
26
- rest: pinnedLiveIds.size === 0 ? filtered : filtered.filter(event => !pinnedLiveIds.has(event.id))
27
- };
28
- }
1
+ "use strict";const i=[];export function splitPinned(t,n,r){if(n.length===0)return{pinned:i,rest:t};return{pinned:n,rest:r.size===0?t:t.filter(s=>!r.has(s.id))}}
@@ -1,91 +1 @@
1
- "use strict";
2
-
3
- import { NetworkConditionsIcon } from "./network/conditions/NetworkConditionsIcon";
4
- /**
5
- * Pre-configured network monitoring tool for FloatingDevTools
6
- *
7
- * This preset provides a zero-config way to add network request monitoring to your dev tools.
8
- * Just import and add it to your apps array!
9
- *
10
- * @example
11
- * ```tsx
12
- * import { networkToolPreset } from '@buoy-gg/network';
13
- *
14
- * const installedApps = [
15
- * networkToolPreset, // That's it!
16
- * // ...other tools
17
- * ];
18
- * ```
19
- */
20
-
21
- import { createToolFactory, defineToolPreset } from "@buoy-gg/shared-ui";
22
- import { NetworkModal } from "./network/components/NetworkModal";
23
- import { overrideRulesStore } from "./network/overrides/overrideRulesStore";
24
- import { networkEventStore } from "./network/utils/networkEventStore";
25
-
26
- /**
27
- * Install interception at IMPORT time and buffer boot traffic.
28
- *
29
- * Capture used to start with the first subscriber (Network modal open,
30
- * dashboard/MCP watch) — long after the app's startup requests (module-scope
31
- * fetches, session bootstrap, the first query) had fired, so boot traffic was
32
- * permanently invisible. The boot buffer holds those raw events until the
33
- * first consumer subscribes, then flushes them into the store; if nothing
34
- * ever subscribes, nothing is flushed (see startBootCapture).
35
- *
36
- * Guards:
37
- * - `navigator.product === "ReactNative"` — a real RN runtime only. The
38
- * desktop dashboard and web mirrors also evaluate this module and must
39
- * never intercept their OWN process's traffic.
40
- * - Dev-only, like the rest of the automatic capture behavior.
41
- */
42
- import { jsx as _jsx } from "react/jsx-runtime";
43
- const isReactNativeRuntime = typeof navigator !== "undefined" && navigator.product === "ReactNative";
44
- // Browser capture initializes persisted rules explicitly through startNetworkCapture.
45
- if (isReactNativeRuntime) void overrideRulesStore.ensureLoaded();
46
- if (isReactNativeRuntime && typeof __DEV__ !== "undefined" && __DEV__) {
47
- networkEventStore.startBootCapture();
48
- }
49
-
50
- /**
51
- * Pre-configured network monitoring tool for FloatingDevTools.
52
- * Includes:
53
- * - Live network request monitoring
54
- * - Request/response inspection
55
- * - Filter by status, method, URL
56
- * - Timing information
57
- */
58
- export const networkToolPreset = defineToolPreset({
59
- id: "network",
60
- name: "NET",
61
- description: "Network request logger",
62
- slot: "both",
63
- icon: ({
64
- size
65
- }) => /*#__PURE__*/_jsx(NetworkConditionsIcon, {
66
- size: size
67
- }),
68
- component: NetworkModal,
69
- props: {
70
- enableSharedModalDimensions: false
71
- }
72
- });
73
-
74
- /**
75
- * Create a custom network monitoring tool configuration.
76
- * Use this if you want to override default settings.
77
- *
78
- * @example
79
- * ```tsx
80
- * import { createNetworkTool } from '@buoy-gg/network';
81
- *
82
- * const myNetworkTool = createNetworkTool({
83
- * name: "REQUESTS",
84
- * iconColor: "#9945FF", // Purple color
85
- * enableSharedModalDimensions: true,
86
- * });
87
- * ```
88
- */
89
- export const createNetworkTool = createToolFactory(networkToolPreset, options => ({
90
- enableSharedModalDimensions: options.enableSharedModalDimensions ?? false
91
- }));
1
+ "use strict";import{NetworkConditionsIcon as t}from"./network/conditions/NetworkConditionsIcon";import{createToolFactory as r,defineToolPreset as i}from"@buoy-gg/shared-ui";import{NetworkModal as n}from"./network/components/NetworkModal";import{overrideRulesStore as a}from"./network/overrides/overrideRulesStore";import{networkEventStore as s}from"./network/utils/networkEventStore";import{jsx as d}from"react/jsx-runtime";const e=typeof navigator!=="undefined"&&navigator.product==="ReactNative";if(e)void a.ensureLoaded();if(e&&typeof __DEV__!=="undefined"&&__DEV__){s.startBootCapture()}export const networkToolPreset=i({id:"network",name:"NET",description:"Network request logger",slot:"both",icon:({size:o})=>d(t,{size:o}),component:n,props:{enableSharedModalDimensions:false}});export const createNetworkTool=r(networkToolPreset,o=>({enableSharedModalDimensions:o.enableSharedModalDimensions??false}));
@@ -50,5 +50,5 @@ export declare function inspectEngine(url: string, method: string): {
50
50
  * broken dev tool, so the gate is here — at the single entry point — rather
51
51
  * than trusted to every call site.
52
52
  */
53
- export declare function overrideForRequest(url: string, method: string): OverrideOutcome | null;
53
+ export declare function overrideForRequest(url: string, method: string, headers?: Record<string, string>): OverrideOutcome | null;
54
54
  //# sourceMappingURL=engine.d.ts.map
@@ -18,5 +18,5 @@ import type { OverrideRule } from "./types";
18
18
  export declare function escapeRegex(pattern: string): string;
19
19
  export declare function compilePattern(pattern: string): RegExp;
20
20
  /** Does this rule apply to this request? Ignores `enabled` — callers check it. */
21
- export declare function ruleMatches(rule: OverrideRule, url: string, method: string): boolean;
21
+ export declare function ruleMatches(rule: OverrideRule, url: string, method: string, headers?: Record<string, string>): boolean;
22
22
  //# sourceMappingURL=matchRule.d.ts.map
@@ -28,7 +28,7 @@ export declare function shouldApply(rule: OverrideRule): boolean;
28
28
  * its phase on the requests it deliberately skips — the caller needs the rule
29
29
  * back even when the answer is "not this time".
30
30
  */
31
- export declare function findMatchingRule(url: string, method: string, rules: readonly OverrideRule[]): OverrideRule | null;
31
+ export declare function findMatchingRule(url: string, method: string, rules: readonly OverrideRule[], headers?: Record<string, string>): OverrideRule | null;
32
32
  /**
33
33
  * First ENABLED matching rule wins outright — no merging across rules.
34
34
  *
@@ -41,6 +41,6 @@ export declare function findMatchingRule(url: string, method: string, rules: rea
41
41
  * @param method HTTP method as the caller sent it (case-insensitive).
42
42
  * @param rules Ordered rule list; earlier entries win.
43
43
  */
44
- export declare function resolveOverride(url: string, method: string, rules: readonly OverrideRule[]): OverrideOutcome | null;
44
+ export declare function resolveOverride(url: string, method: string, rules: readonly OverrideRule[], headers?: Record<string, string>): OverrideOutcome | null;
45
45
  export { toOutcome };
46
46
  //# sourceMappingURL=resolveOverride.d.ts.map
@@ -72,6 +72,15 @@ export interface OverrideRule {
72
72
  urlPattern: string;
73
73
  /** Uppercase methods. Absent or empty means "any method". */
74
74
  methods?: string[];
75
+ /**
76
+ * Only requests that SEND this header (name, case-insensitive). Absent
77
+ * means any request.
78
+ *
79
+ * For failures aimed at an authenticated call: the Clock tool's "fail the
80
+ * next request" sets `authorization`, so the 401 lands on a request that
81
+ * carried the token and never on the app's own token request.
82
+ */
83
+ requireHeader?: string;
75
84
  kind: OverrideRuleKind;
76
85
  /** `respond` only. Clamped to [STATUS_MIN, STATUS_MAX]. Defaults to 200. */
77
86
  status?: number;
@@ -163,6 +163,17 @@ declare class NetworkListener {
163
163
  * effectively disabling network monitoring.
164
164
  */
165
165
  stopListening(): void;
166
+ /**
167
+ * Take over the requests `@buoy-gg/core/web/register` recorded before this
168
+ * listener existed, so the page's startup traffic shows up. Finished requests
169
+ * are emitted now, with their real start time and duration. Requests still
170
+ * in flight are emitted when they finish. The recorder stops recording on
171
+ * the first call, so each request is reported once. See
172
+ * core/src/earlyNetwork.ts for the record shapes.
173
+ */
174
+ adoptEarlyRequests(): void;
175
+ private adoptEarlyFetch;
176
+ private adoptEarlyXhr;
166
177
  /**
167
178
  * Add a listener for network events
168
179
  *
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The device's real clock.
3
+ *
4
+ * @buoy-gg/clock can override the APP's clock (Date.now, new Date). Buoy's
5
+ * own bookkeeping must keep real time regardless: license expiry, sync
6
+ * throttles and request deadlines would otherwise lock tools or stall when
7
+ * someone travels a month ahead. The clock package publishes the real clock
8
+ * on `globalThis.__buoyRealNow`; without it, Date.now is already real.
9
+ */
10
+ export declare function realNow(): number;
11
+ /**
12
+ * setTimeout that a clock jump never fires early. @buoy-gg/clock tracks the
13
+ * app's timers so a jump ahead can run the ones that come due; Buoy's own
14
+ * deadlines and heartbeats must not be among them.
15
+ */
16
+ export declare function realSetTimeout(callback: () => void, ms: number): ReturnType<typeof setTimeout>;
17
+ export declare function realClearTimeout(handle: unknown): void;
18
+ //# sourceMappingURL=realNow.d.ts.map