react-native-debug-toolkit 3.3.4 → 3.5.0

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 (258) hide show
  1. package/README.md +48 -46
  2. package/README.zh-CN.md +48 -46
  3. package/android/src/main/java/com/reactnativedebugtoolkit/DebugToolkitDevConnectModule.java +0 -187
  4. package/bin/debug-toolkit.js +0 -16
  5. package/ios/DebugToolkitDevConnect.h +0 -12
  6. package/ios/DebugToolkitDevConnect.mm +0 -321
  7. package/lib/commonjs/constants/logLevels.js +19 -0
  8. package/lib/commonjs/constants/logLevels.js.map +1 -0
  9. package/lib/commonjs/core/initialize.js +36 -18
  10. package/lib/commonjs/core/initialize.js.map +1 -1
  11. package/lib/commonjs/features/console/ConsoleLogTab.js +4 -15
  12. package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -1
  13. package/lib/commonjs/features/console/index.js +15 -8
  14. package/lib/commonjs/features/console/index.js.map +1 -1
  15. package/lib/commonjs/features/devConnect/DevConnectTab.js +18 -470
  16. package/lib/commonjs/features/devConnect/DevConnectTab.js.map +1 -1
  17. package/lib/commonjs/features/devConnect/devConnectPreferences.js +0 -12
  18. package/lib/commonjs/features/devConnect/devConnectPreferences.js.map +1 -1
  19. package/lib/commonjs/features/devConnect/devConnectUtils.js +2 -57
  20. package/lib/commonjs/features/devConnect/devConnectUtils.js.map +1 -1
  21. package/lib/commonjs/features/devConnect/index.js +1 -23
  22. package/lib/commonjs/features/devConnect/index.js.map +1 -1
  23. package/lib/commonjs/features/devConnect/nativeDevConnect.js +1 -103
  24. package/lib/commonjs/features/devConnect/nativeDevConnect.js.map +1 -1
  25. package/lib/commonjs/features/network/NetworkLogTab.js +91 -93
  26. package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -1
  27. package/lib/commonjs/features/network/index.js +7 -4
  28. package/lib/commonjs/features/network/index.js.map +1 -1
  29. package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js +1044 -0
  30. package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js.map +1 -0
  31. package/lib/commonjs/features/sessionHistory/index.js +103 -0
  32. package/lib/commonjs/features/sessionHistory/index.js.map +1 -0
  33. package/lib/commonjs/features/track/index.js +4 -3
  34. package/lib/commonjs/features/track/index.js.map +1 -1
  35. package/lib/commonjs/index.js +27 -0
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/commonjs/ui/DebugView.js +3 -0
  38. package/lib/commonjs/ui/DebugView.js.map +1 -1
  39. package/lib/commonjs/ui/panel/DebugPanel.js +67 -34
  40. package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -1
  41. package/lib/commonjs/ui/panel/FeatureIntroCard.js +131 -0
  42. package/lib/commonjs/ui/panel/FeatureIntroCard.js.map +1 -0
  43. package/lib/commonjs/ui/panel/FeatureRail.js +163 -0
  44. package/lib/commonjs/ui/panel/FeatureRail.js.map +1 -0
  45. package/lib/commonjs/ui/panel/FloatPanelView.js +169 -32
  46. package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -1
  47. package/lib/commonjs/ui/panel/buildFeatureSummary.js +207 -0
  48. package/lib/commonjs/ui/panel/buildFeatureSummary.js.map +1 -0
  49. package/lib/commonjs/ui/panel/filterFeatureSnapshot.js +43 -0
  50. package/lib/commonjs/ui/panel/filterFeatureSnapshot.js.map +1 -0
  51. package/lib/commonjs/ui/panel/tabPersistence.js +17 -0
  52. package/lib/commonjs/ui/panel/tabPersistence.js.map +1 -0
  53. package/lib/commonjs/ui/theme/colors.js +6 -0
  54. package/lib/commonjs/ui/theme/colors.js.map +1 -1
  55. package/lib/commonjs/utils/DaemonClient.js +30 -8
  56. package/lib/commonjs/utils/DaemonClient.js.map +1 -1
  57. package/lib/commonjs/utils/SessionManager.js +132 -0
  58. package/lib/commonjs/utils/SessionManager.js.map +1 -0
  59. package/lib/commonjs/utils/StorageAdapter.js +104 -0
  60. package/lib/commonjs/utils/StorageAdapter.js.map +1 -0
  61. package/lib/commonjs/utils/createChannelFeature.js +22 -5
  62. package/lib/commonjs/utils/createChannelFeature.js.map +1 -1
  63. package/lib/commonjs/utils/createDebugTab.js +21 -0
  64. package/lib/commonjs/utils/createDebugTab.js.map +1 -0
  65. package/lib/commonjs/utils/createPersistedObservableStore.js +14 -8
  66. package/lib/commonjs/utils/createPersistedObservableStore.js.map +1 -1
  67. package/lib/commonjs/utils/debugPreferences.js +28 -6
  68. package/lib/commonjs/utils/debugPreferences.js.map +1 -1
  69. package/lib/commonjs/utils/deviceReport.js +5 -1
  70. package/lib/commonjs/utils/deviceReport.js.map +1 -1
  71. package/lib/commonjs/utils/logRuntime.js +32 -0
  72. package/lib/commonjs/utils/logRuntime.js.map +1 -0
  73. package/lib/module/constants/logLevels.js +15 -0
  74. package/lib/module/constants/logLevels.js.map +1 -0
  75. package/lib/module/core/initialize.js +36 -18
  76. package/lib/module/core/initialize.js.map +1 -1
  77. package/lib/module/features/console/ConsoleLogTab.js +1 -12
  78. package/lib/module/features/console/ConsoleLogTab.js.map +1 -1
  79. package/lib/module/features/console/index.js +15 -8
  80. package/lib/module/features/console/index.js.map +1 -1
  81. package/lib/module/features/devConnect/DevConnectTab.js +21 -473
  82. package/lib/module/features/devConnect/DevConnectTab.js.map +1 -1
  83. package/lib/module/features/devConnect/devConnectPreferences.js +1 -12
  84. package/lib/module/features/devConnect/devConnectPreferences.js.map +1 -1
  85. package/lib/module/features/devConnect/devConnectUtils.js +1 -53
  86. package/lib/module/features/devConnect/devConnectUtils.js.map +1 -1
  87. package/lib/module/features/devConnect/index.js +5 -9
  88. package/lib/module/features/devConnect/index.js.map +1 -1
  89. package/lib/module/features/devConnect/nativeDevConnect.js +1 -100
  90. package/lib/module/features/devConnect/nativeDevConnect.js.map +1 -1
  91. package/lib/module/features/network/NetworkLogTab.js +91 -93
  92. package/lib/module/features/network/NetworkLogTab.js.map +1 -1
  93. package/lib/module/features/network/index.js +7 -4
  94. package/lib/module/features/network/index.js.map +1 -1
  95. package/lib/module/features/sessionHistory/SessionHistoryTab.js +1039 -0
  96. package/lib/module/features/sessionHistory/SessionHistoryTab.js.map +1 -0
  97. package/lib/module/features/sessionHistory/index.js +99 -0
  98. package/lib/module/features/sessionHistory/index.js.map +1 -0
  99. package/lib/module/features/track/index.js +4 -3
  100. package/lib/module/features/track/index.js.map +1 -1
  101. package/lib/module/index.js +4 -0
  102. package/lib/module/index.js.map +1 -1
  103. package/lib/module/ui/DebugView.js +3 -0
  104. package/lib/module/ui/DebugView.js.map +1 -1
  105. package/lib/module/ui/panel/DebugPanel.js +67 -34
  106. package/lib/module/ui/panel/DebugPanel.js.map +1 -1
  107. package/lib/module/ui/panel/FeatureIntroCard.js +126 -0
  108. package/lib/module/ui/panel/FeatureIntroCard.js.map +1 -0
  109. package/lib/module/ui/panel/FeatureRail.js +158 -0
  110. package/lib/module/ui/panel/FeatureRail.js.map +1 -0
  111. package/lib/module/ui/panel/FloatPanelView.js +170 -33
  112. package/lib/module/ui/panel/FloatPanelView.js.map +1 -1
  113. package/lib/module/ui/panel/buildFeatureSummary.js +203 -0
  114. package/lib/module/ui/panel/buildFeatureSummary.js.map +1 -0
  115. package/lib/module/ui/panel/filterFeatureSnapshot.js +39 -0
  116. package/lib/module/ui/panel/filterFeatureSnapshot.js.map +1 -0
  117. package/lib/module/ui/panel/tabPersistence.js +13 -0
  118. package/lib/module/ui/panel/tabPersistence.js.map +1 -0
  119. package/lib/module/ui/theme/colors.js +6 -0
  120. package/lib/module/ui/theme/colors.js.map +1 -1
  121. package/lib/module/utils/DaemonClient.js +30 -8
  122. package/lib/module/utils/DaemonClient.js.map +1 -1
  123. package/lib/module/utils/SessionManager.js +127 -0
  124. package/lib/module/utils/SessionManager.js.map +1 -0
  125. package/lib/module/utils/StorageAdapter.js +96 -0
  126. package/lib/module/utils/StorageAdapter.js.map +1 -0
  127. package/lib/module/utils/createChannelFeature.js +22 -5
  128. package/lib/module/utils/createChannelFeature.js.map +1 -1
  129. package/lib/module/utils/createDebugTab.js +17 -0
  130. package/lib/module/utils/createDebugTab.js.map +1 -0
  131. package/lib/module/utils/createPersistedObservableStore.js +14 -8
  132. package/lib/module/utils/createPersistedObservableStore.js.map +1 -1
  133. package/lib/module/utils/debugPreferences.js +27 -6
  134. package/lib/module/utils/debugPreferences.js.map +1 -1
  135. package/lib/module/utils/deviceReport.js +4 -1
  136. package/lib/module/utils/deviceReport.js.map +1 -1
  137. package/lib/module/utils/logRuntime.js +26 -0
  138. package/lib/module/utils/logRuntime.js.map +1 -0
  139. package/lib/typescript/src/constants/logLevels.d.ts +3 -0
  140. package/lib/typescript/src/constants/logLevels.d.ts.map +1 -0
  141. package/lib/typescript/src/core/initialize.d.ts +6 -0
  142. package/lib/typescript/src/core/initialize.d.ts.map +1 -1
  143. package/lib/typescript/src/features/console/ConsoleLogTab.d.ts.map +1 -1
  144. package/lib/typescript/src/features/console/index.d.ts +2 -1
  145. package/lib/typescript/src/features/console/index.d.ts.map +1 -1
  146. package/lib/typescript/src/features/devConnect/DevConnectTab.d.ts.map +1 -1
  147. package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts +0 -2
  148. package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts.map +1 -1
  149. package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts +0 -20
  150. package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts.map +1 -1
  151. package/lib/typescript/src/features/devConnect/index.d.ts +2 -2
  152. package/lib/typescript/src/features/devConnect/index.d.ts.map +1 -1
  153. package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts +0 -25
  154. package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts.map +1 -1
  155. package/lib/typescript/src/features/devConnect/types.d.ts +1 -3
  156. package/lib/typescript/src/features/devConnect/types.d.ts.map +1 -1
  157. package/lib/typescript/src/features/network/NetworkLogTab.d.ts.map +1 -1
  158. package/lib/typescript/src/features/network/index.d.ts +2 -1
  159. package/lib/typescript/src/features/network/index.d.ts.map +1 -1
  160. package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts +20 -0
  161. package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts.map +1 -0
  162. package/lib/typescript/src/features/sessionHistory/index.d.ts +4 -0
  163. package/lib/typescript/src/features/sessionHistory/index.d.ts.map +1 -0
  164. package/lib/typescript/src/features/track/index.d.ts +2 -1
  165. package/lib/typescript/src/features/track/index.d.ts.map +1 -1
  166. package/lib/typescript/src/index.d.ts +6 -0
  167. package/lib/typescript/src/index.d.ts.map +1 -1
  168. package/lib/typescript/src/types/feature.d.ts +1 -1
  169. package/lib/typescript/src/types/feature.d.ts.map +1 -1
  170. package/lib/typescript/src/types/index.d.ts +2 -0
  171. package/lib/typescript/src/types/index.d.ts.map +1 -1
  172. package/lib/typescript/src/ui/DebugView.d.ts +4 -2
  173. package/lib/typescript/src/ui/DebugView.d.ts.map +1 -1
  174. package/lib/typescript/src/ui/panel/DebugPanel.d.ts +3 -1
  175. package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -1
  176. package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts +11 -0
  177. package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts.map +1 -0
  178. package/lib/typescript/src/ui/panel/FeatureRail.d.ts +16 -0
  179. package/lib/typescript/src/ui/panel/FeatureRail.d.ts.map +1 -0
  180. package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -1
  181. package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts +13 -0
  182. package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts.map +1 -0
  183. package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts +3 -0
  184. package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts.map +1 -0
  185. package/lib/typescript/src/ui/panel/tabPersistence.d.ts +3 -0
  186. package/lib/typescript/src/ui/panel/tabPersistence.d.ts.map +1 -0
  187. package/lib/typescript/src/ui/theme/colors.d.ts +5 -0
  188. package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -1
  189. package/lib/typescript/src/utils/DaemonClient.d.ts +7 -1
  190. package/lib/typescript/src/utils/DaemonClient.d.ts.map +1 -1
  191. package/lib/typescript/src/utils/SessionManager.d.ts +30 -0
  192. package/lib/typescript/src/utils/SessionManager.d.ts.map +1 -0
  193. package/lib/typescript/src/utils/StorageAdapter.d.ts +38 -0
  194. package/lib/typescript/src/utils/StorageAdapter.d.ts.map +1 -0
  195. package/lib/typescript/src/utils/createChannelFeature.d.ts +2 -0
  196. package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -1
  197. package/lib/typescript/src/utils/createDebugTab.d.ts +18 -0
  198. package/lib/typescript/src/utils/createDebugTab.d.ts.map +1 -0
  199. package/lib/typescript/src/utils/createPersistedObservableStore.d.ts +4 -1
  200. package/lib/typescript/src/utils/createPersistedObservableStore.d.ts.map +1 -1
  201. package/lib/typescript/src/utils/debugPreferences.d.ts +1 -4
  202. package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -1
  203. package/lib/typescript/src/utils/deviceReport.d.ts +1 -0
  204. package/lib/typescript/src/utils/deviceReport.d.ts.map +1 -1
  205. package/lib/typescript/src/utils/logRuntime.d.ts +13 -0
  206. package/lib/typescript/src/utils/logRuntime.d.ts.map +1 -0
  207. package/package.json +10 -6
  208. package/src/constants/logLevels.ts +13 -0
  209. package/src/core/initialize.ts +61 -21
  210. package/src/features/console/ConsoleLogTab.tsx +1 -14
  211. package/src/features/console/index.ts +18 -8
  212. package/src/features/devConnect/DevConnectTab.tsx +17 -381
  213. package/src/features/devConnect/devConnectPreferences.ts +0 -15
  214. package/src/features/devConnect/devConnectUtils.ts +1 -81
  215. package/src/features/devConnect/index.ts +2 -9
  216. package/src/features/devConnect/nativeDevConnect.ts +1 -136
  217. package/src/features/devConnect/types.ts +1 -3
  218. package/src/features/network/NetworkLogTab.tsx +61 -71
  219. package/src/features/network/index.ts +12 -3
  220. package/src/features/sessionHistory/SessionHistoryTab.tsx +691 -0
  221. package/src/features/sessionHistory/index.ts +102 -0
  222. package/src/features/track/index.ts +10 -3
  223. package/src/index.ts +13 -0
  224. package/src/types/feature.ts +2 -1
  225. package/src/types/index.ts +10 -0
  226. package/src/ui/DebugView.tsx +6 -1
  227. package/src/ui/panel/DebugPanel.tsx +60 -30
  228. package/src/ui/panel/FeatureIntroCard.tsx +127 -0
  229. package/src/ui/panel/FeatureRail.tsx +165 -0
  230. package/src/ui/panel/FloatPanelView.tsx +176 -25
  231. package/src/ui/panel/buildFeatureSummary.ts +288 -0
  232. package/src/ui/panel/filterFeatureSnapshot.ts +51 -0
  233. package/src/ui/panel/tabPersistence.ts +22 -0
  234. package/src/ui/theme/colors.ts +7 -0
  235. package/src/utils/DaemonClient.ts +33 -5
  236. package/src/utils/SessionManager.ts +174 -0
  237. package/src/utils/StorageAdapter.ts +135 -0
  238. package/src/utils/createChannelFeature.ts +28 -6
  239. package/src/utils/createDebugTab.ts +32 -0
  240. package/src/utils/createPersistedObservableStore.ts +18 -10
  241. package/src/utils/debugPreferences.ts +38 -8
  242. package/src/utils/deviceReport.ts +5 -1
  243. package/src/utils/logRuntime.ts +39 -0
  244. package/app.plugin.js +0 -51
  245. package/dev-client.js +0 -3
  246. package/lib/commonjs/ui/panel/FeatureTabBar.js +0 -182
  247. package/lib/commonjs/ui/panel/FeatureTabBar.js.map +0 -1
  248. package/lib/module/ui/panel/FeatureTabBar.js +0 -177
  249. package/lib/module/ui/panel/FeatureTabBar.js.map +0 -1
  250. package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts +0 -13
  251. package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts.map +0 -1
  252. package/scripts/bundle/android.js +0 -101
  253. package/scripts/bundle/cli.js +0 -57
  254. package/scripts/bundle/doctor.js +0 -38
  255. package/scripts/bundle/ios.js +0 -179
  256. package/scripts/bundle/setup.js +0 -39
  257. package/scripts/debug-bundle.gradle +0 -147
  258. package/src/ui/panel/FeatureTabBar.tsx +0 -204
@@ -1 +1 @@
1
- {"version":3,"file":"createPersistedObservableStore.d.ts","sourceRoot":"","sources":["../../../../src/utils/createPersistedObservableStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAGtF,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACrE,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,8BAA8B,CAAC,CAAC,SAAS;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,EACtE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAChC,wBAAwB,CAAC,CAAC,CAAC,CAsE7B"}
1
+ {"version":3,"file":"createPersistedObservableStore.d.ts","sourceRoot":"","sources":["../../../../src/utils/createPersistedObservableStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACrE,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,8BAA8B,CAAC,CAAC,SAAS;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,EACtE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAChC,wBAAwB,CAAC,CAAC,CAAC,CA4E7B"}
@@ -1,13 +1,10 @@
1
1
  export declare function setPreference(key: string, value: string): Promise<void>;
2
2
  export declare function getPreference(key: string): Promise<string | null>;
3
+ export declare function removePreference(key: string): Promise<void>;
3
4
  export declare const KEYS: {
4
5
  readonly fabPosition: "@react_native_debug_toolkit/fab_position";
5
6
  readonly lastTab: "@react_native_debug_toolkit/last_tab";
6
- readonly consoleLogs: "@react_native_debug_toolkit/console_logs";
7
- readonly networkLogs: "@react_native_debug_toolkit/network_logs";
8
- readonly trackLogs: "@react_native_debug_toolkit/track_logs";
9
7
  readonly computerHost: "@react_native_debug_toolkit/computer_host";
10
- readonly metroPort: "@react_native_debug_toolkit/metro_port";
11
8
  readonly daemonPort: "@react_native_debug_toolkit/daemon_port";
12
9
  };
13
10
  //# sourceMappingURL=debugPreferences.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debugPreferences.d.ts","sourceRoot":"","sources":["../../../../src/utils/debugPreferences.ts"],"names":[],"mappings":"AAkCA,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB7E;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BvE;AAED,eAAO,MAAM,IAAI;;;;;;;;;CASP,CAAC"}
1
+ {"version":3,"file":"debugPreferences.d.ts","sourceRoot":"","sources":["../../../../src/utils/debugPreferences.ts"],"names":[],"mappings":"AA0CA,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB7E;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BvE;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBjE;AAED,eAAO,MAAM,IAAI;;;;;CAKP,CAAC"}
@@ -20,6 +20,7 @@ export interface DebugDeviceReport {
20
20
  session?: SessionInfo;
21
21
  logs: Record<string, unknown[] | undefined>;
22
22
  }
23
+ export declare function sanitizeDebugLogEntry(value: unknown, maxBodyBytes?: number): unknown;
23
24
  export declare function createDebugDeviceReport(options?: DebugDeviceReportOptions & {
24
25
  featureProvider?: FeatureDataProvider;
25
26
  session?: SessionInfo;
@@ -1 +1 @@
1
- {"version":3,"file":"deviceReport.d.ts","sourceRoot":"","sources":["../../../../src/utils/deviceReport.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAOpD,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC;CAC7C;AAuID,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAAwB,GAAG;IAAE,eAAe,CAAC,EAAE,mBAAmB,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAO,GACxG,iBAAiB,CAyCnB"}
1
+ {"version":3,"file":"deviceReport.d.ts","sourceRoot":"","sources":["../../../../src/utils/deviceReport.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAOpD,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC;CAC7C;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,SAAyB,GAAG,OAAO,CAEpG;AAuID,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAAwB,GAAG;IAAE,eAAe,CAAC,EAAE,mBAAmB,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAO,GACxG,iBAAiB,CAyCnB"}
@@ -0,0 +1,13 @@
1
+ import { SessionManager, type SessionManagerOptions } from './SessionManager';
2
+ import { type StorageAdapter } from './StorageAdapter';
3
+ export interface LogRuntimeContext {
4
+ logStorage: StorageAdapter;
5
+ sessionManager: SessionManager;
6
+ }
7
+ export interface LogRuntimeOptions extends SessionManagerOptions {
8
+ logStorage?: StorageAdapter;
9
+ }
10
+ export declare function createLogRuntime(options?: LogRuntimeOptions): LogRuntimeContext;
11
+ export declare function setDefaultLogRuntime(runtime: LogRuntimeContext | null): void;
12
+ export declare function getDefaultLogRuntime(): LogRuntimeContext;
13
+ //# sourceMappingURL=logRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logRuntime.d.ts","sourceRoot":"","sources":["../../../../src/utils/logRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,cAAc,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAID,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,iBAAiB,CASnF;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAE5E;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,CAMxD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-debug-toolkit",
3
- "version": "3.3.4",
3
+ "version": "3.5.0",
4
4
  "description": "A local-first React Native debug toolkit with Web Console, HTTP API, and MCP support for AI-readable app logs",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -10,9 +10,6 @@
10
10
  "lib",
11
11
  "bin",
12
12
  "node",
13
- "scripts",
14
- "app.plugin.js",
15
- "dev-client.js",
16
13
  "ios",
17
14
  "android",
18
15
  "react-native-debug-toolkit.podspec",
@@ -57,12 +54,20 @@
57
54
  },
58
55
  "peerDependencies": {
59
56
  "@react-native-clipboard/clipboard": ">=1.0.0",
57
+ "@react-native-async-storage/async-storage": ">=1.0.0",
58
+ "react-native-mmkv": ">=2.0.0",
60
59
  "react": ">=18.0.0",
61
60
  "react-native": ">=0.72.0"
62
61
  },
63
62
  "peerDependenciesMeta": {
63
+ "@react-native-async-storage/async-storage": {
64
+ "optional": true
65
+ },
64
66
  "@react-native-clipboard/clipboard": {
65
67
  "optional": true
68
+ },
69
+ "react-native-mmkv": {
70
+ "optional": true
66
71
  }
67
72
  },
68
73
  "devDependencies": {
@@ -96,7 +101,6 @@
96
101
  ]
97
102
  },
98
103
  "dependencies": {
99
- "@babel/runtime": "^7.29.2",
100
- "xcode": "^3.0.1"
104
+ "@babel/runtime": "^7.29.2"
101
105
  }
102
106
  }
@@ -0,0 +1,13 @@
1
+ export const LEVEL_COLORS: Record<string, string> = {
2
+ log: '#8E8E93',
3
+ info: '#007AFF',
4
+ warn: '#FF9500',
5
+ error: '#FF3B30',
6
+ };
7
+
8
+ export const LEVEL_ICONS: Record<string, string> = {
9
+ log: '●',
10
+ info: 'ℹ',
11
+ warn: '⚠',
12
+ error: '✕',
13
+ };
@@ -12,8 +12,15 @@ import type { TrackFeatureConfig } from '../features/track';
12
12
  import { createEnvironmentFeature } from '../features/environment';
13
13
  import { createClipboardFeature } from '../features/clipboard';
14
14
  import { createDevConnectFeature, restoreDevConnectSettingsToDaemon, nativeIsDebugBuild } from '../features/devConnect';
15
+ import { createSessionHistoryFeature } from '../features/sessionHistory';
15
16
  import { daemonClient } from '../utils/DaemonClient';
16
17
  import type { AnyDebugFeature, BuiltInFeatureName } from '../types';
18
+ import type { StorageAdapter } from '../utils/StorageAdapter';
19
+ import {
20
+ createLogRuntime,
21
+ setDefaultLogRuntime,
22
+ type LogRuntimeContext,
23
+ } from '../utils/logRuntime';
17
24
 
18
25
  const isDebugMode = __DEV__;
19
26
 
@@ -27,25 +34,31 @@ export interface FeatureConfigs {
27
34
  environment?: Parameters<typeof createEnvironmentFeature>[0];
28
35
  clipboard?: boolean;
29
36
  devConnect?: boolean;
37
+ sessionHistory?: boolean;
30
38
  }
31
39
 
32
40
  export interface InitializeOptions {
33
41
  features?: FeatureConfigs;
42
+ customFeatures?: AnyDebugFeature[];
34
43
  enabled?: boolean;
44
+ logStorage?: StorageAdapter;
45
+ maxLogSessions?: number;
35
46
  }
36
47
 
48
+ type EnvironmentFeatureConfig = Parameters<typeof createEnvironmentFeature>[0];
49
+ type BuiltInFeatureCreator = (config?: unknown, runtime?: LogRuntimeContext) => AnyDebugFeature;
50
+
37
51
  /** Registry mapping feature names to creator functions */
38
- // Config param requires `any` — each factory accepts a different config type.
39
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
- const featureRegistry: Record<BuiltInFeatureName, (config?: any) => AnyDebugFeature> = {
41
- network: createNetworkFeature,
42
- console: createConsoleLogFeature,
43
- zustand: createZustandLogFeature,
44
- navigation: createNavigationLogFeature,
45
- track: createTrackFeature,
46
- environment: createEnvironmentFeature,
47
- clipboard: createClipboardFeature,
48
- devConnect: createDevConnectFeature,
52
+ const featureRegistry: Record<BuiltInFeatureName, BuiltInFeatureCreator> = {
53
+ network: (config, runtime) => createNetworkFeature(config as NetworkFeatureConfig | undefined, runtime),
54
+ console: (config, runtime) => createConsoleLogFeature(config as ConsoleFeatureConfig | undefined, runtime),
55
+ zustand: (config) => createZustandLogFeature(config as ZustandFeatureConfig | undefined),
56
+ navigation: (config) => createNavigationLogFeature(config as NavigationFeatureConfig | undefined),
57
+ track: (config, runtime) => createTrackFeature(config as TrackFeatureConfig | undefined, runtime),
58
+ environment: (config) => createEnvironmentFeature(config as EnvironmentFeatureConfig | undefined),
59
+ clipboard: () => createClipboardFeature(),
60
+ devConnect: () => createDevConnectFeature(),
61
+ sessionHistory: (_config, runtime) => createSessionHistoryFeature(runtime),
49
62
  };
50
63
 
51
64
  const DEFAULT_FEATURES: BuiltInFeatureName[] = [
@@ -56,14 +69,17 @@ const DEFAULT_FEATURES: BuiltInFeatureName[] = [
56
69
  'track',
57
70
  'clipboard',
58
71
  'devConnect',
72
+ 'sessionHistory',
59
73
  ];
60
74
 
61
- function resolveFeatureConfigs(configs: FeatureConfigs): AnyDebugFeature[] {
75
+ function resolveFeatureConfigs(configs: FeatureConfigs, runtime: LogRuntimeContext): AnyDebugFeature[] {
62
76
  const features: AnyDebugFeature[] = [];
63
77
  const entries = Object.entries(configs) as [BuiltInFeatureName, unknown][];
64
78
 
65
79
  for (const [name, config] of entries) {
66
- if (config === false) continue;
80
+ if (config === false) {
81
+ continue;
82
+ }
67
83
 
68
84
  const creator = featureRegistry[name];
69
85
  if (!creator) {
@@ -72,17 +88,28 @@ function resolveFeatureConfigs(configs: FeatureConfigs): AnyDebugFeature[] {
72
88
  }
73
89
 
74
90
  if (config === true || config === undefined) {
75
- features.push(creator());
91
+ features.push(creator(undefined, runtime));
76
92
  } else if (typeof config === 'object') {
77
- features.push(creator(config as Record<string, unknown>));
93
+ features.push(creator(config as Record<string, unknown>, runtime));
78
94
  }
79
95
  }
80
96
 
81
97
  return features;
82
98
  }
83
99
 
84
- function resolveDefaultFeatures(): AnyDebugFeature[] {
85
- return DEFAULT_FEATURES.map((name) => featureRegistry[name]!());
100
+ function resolveDefaultFeatures(runtime: LogRuntimeContext): AnyDebugFeature[] {
101
+ return DEFAULT_FEATURES.map((name) => featureRegistry[name]!(undefined, runtime));
102
+ }
103
+
104
+ function appendCustomFeatures(
105
+ builtInFeatures: AnyDebugFeature[],
106
+ customFeatures?: AnyDebugFeature[],
107
+ ): AnyDebugFeature[] {
108
+ if (!customFeatures || customFeatures.length === 0) {
109
+ return builtInFeatures;
110
+ }
111
+
112
+ return [...builtInFeatures, ...customFeatures];
86
113
  }
87
114
 
88
115
  /**
@@ -111,19 +138,32 @@ export async function initializeDebugToolkit(
111
138
  }
112
139
  }
113
140
 
114
- const resolvedFeatures = options?.features
115
- ? resolveFeatureConfigs(options.features)
116
- : resolveDefaultFeatures();
117
-
118
141
  try {
119
142
  DebugToolkit.setEnabled(enabled);
120
143
 
121
144
  if (!enabled) {
145
+ daemonClient.clearSessionProvider();
122
146
  DebugToolkit.reset();
123
147
  return DebugToolkit;
124
148
  }
125
149
 
150
+ const runtime = createLogRuntime({
151
+ logStorage: options?.logStorage,
152
+ maxSessions: options?.maxLogSessions,
153
+ });
154
+ setDefaultLogRuntime(runtime);
155
+ daemonClient.setSessionProvider(() => runtime.sessionManager.getCurrentSession());
156
+
157
+ const resolvedBuiltInFeatures = options?.features
158
+ ? resolveFeatureConfigs(options.features, runtime)
159
+ : resolveDefaultFeatures(runtime);
160
+ const resolvedFeatures = appendCustomFeatures(
161
+ resolvedBuiltInFeatures,
162
+ options?.customFeatures,
163
+ );
164
+
126
165
  DebugToolkit.replaceFeatures(resolvedFeatures);
166
+ runtime.sessionManager.initialize().catch(() => {});
127
167
 
128
168
  daemonClient.setEndpointDetector((url) => {
129
169
  addToBlacklist(url);
@@ -7,22 +7,9 @@ import { JsonView } from '../../ui/shared/JsonView';
7
7
  import { CopyButton } from '../../ui/shared/CopyButton';
8
8
  import { LogListScreen } from '../../ui/shared/LogListScreen';
9
9
  import { fmt } from '../../utils/copyToComputer';
10
+ import { LEVEL_COLORS, LEVEL_ICONS } from '../../constants/logLevels';
10
11
  import type { ConsoleLogEntry, DebugFeatureRenderProps } from '../../types';
11
12
 
12
- const LEVEL_COLORS: Record<string, string> = {
13
- log: '#8E8E93',
14
- info: '#007AFF',
15
- warn: '#FF9500',
16
- error: '#FF3B30',
17
- };
18
-
19
- const LEVEL_ICONS: Record<string, string> = {
20
- log: '●',
21
- info: 'ℹ',
22
- warn: '⚠',
23
- error: '✕',
24
- };
25
-
26
13
  export const ConsoleLogTab: React.FC<DebugFeatureRenderProps<ConsoleLogEntry[]>> = React.memo(({ snapshot }) => (
27
14
  <LogListScreen
28
15
  data={snapshot}
@@ -1,7 +1,7 @@
1
1
  import { ConsoleLogTab } from './ConsoleLogTab';
2
2
  import type { ConsoleLogEntry, DebugFeature } from '../../types';
3
3
  import { createPersistedObservableStore } from '../../utils/createPersistedObservableStore';
4
- import { KEYS } from '../../utils/debugPreferences';
4
+ import { getDefaultLogRuntime, type LogRuntimeContext } from '../../utils/logRuntime';
5
5
 
6
6
  const LEVELS: ConsoleLogEntry['level'][] = ['log', 'info', 'warn', 'error'];
7
7
 
@@ -13,7 +13,9 @@ const consoleCapture = (() => {
13
13
 
14
14
  function stop(): void {
15
15
  refCount = Math.max(0, refCount - 1);
16
- if (refCount > 0) return;
16
+ if (refCount > 0) {
17
+ return;
18
+ }
17
19
 
18
20
  LEVELS.forEach((level) => {
19
21
  const original = originalMethods[level];
@@ -78,10 +80,14 @@ export interface ConsoleFeatureConfig {
78
80
  maxLogs?: number;
79
81
  }
80
82
 
81
- export const createConsoleLogFeature = (config?: ConsoleFeatureConfig): DebugFeature<ConsoleLogEntry[]> => {
83
+ export const createConsoleLogFeature = (
84
+ config?: ConsoleFeatureConfig,
85
+ runtime: LogRuntimeContext = getDefaultLogRuntime(),
86
+ ): DebugFeature<ConsoleLogEntry[]> => {
82
87
  const maxLogs = config?.maxLogs ?? DEFAULT_MAX_LOGS;
83
88
  const logStore = createPersistedObservableStore<ConsoleLogEntry>({
84
- storageKey: KEYS.consoleLogs,
89
+ storage: runtime.logStorage,
90
+ storageKey: runtime.sessionManager.getLogStorageKey('console_logs'),
85
91
  maxPersist: 50,
86
92
  });
87
93
  let initialized = false;
@@ -92,7 +98,9 @@ export const createConsoleLogFeature = (config?: ConsoleFeatureConfig): DebugFea
92
98
  label: 'Console',
93
99
  renderContent: ConsoleLogTab,
94
100
  setup: () => {
95
- if (initialized) return;
101
+ if (initialized) {
102
+ return;
103
+ }
96
104
 
97
105
  stopCapture = consoleCapture.start((entry) => {
98
106
  logStore.push({ ...entry, id: logStore.nextId() }, maxLogs);
@@ -100,13 +108,15 @@ export const createConsoleLogFeature = (config?: ConsoleFeatureConfig): DebugFea
100
108
  initialized = true;
101
109
  },
102
110
  getSnapshot: () => logStore.getData(),
103
- clear: () => { logStore.clear(); },
111
+ clear: () => { logStore.clearPersisted(); },
104
112
  cleanup: () => {
105
- if (!initialized) return;
113
+ if (!initialized) {
114
+ return;
115
+ }
106
116
 
107
117
  stopCapture?.();
108
118
  stopCapture = null;
109
- logStore.clear();
119
+ logStore.dispose();
110
120
  initialized = false;
111
121
  },
112
122
  subscribe: (listener) => logStore.subscribe(listener),