react-native-debug-toolkit 3.3.8 → 3.5.1
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.
- package/README.md +40 -26
- package/README.zh-CN.md +52 -38
- package/android/src/main/java/com/reactnativedebugtoolkit/DebugToolkitNativeLogsModule.java +146 -0
- package/android/src/main/java/com/reactnativedebugtoolkit/ReactNativeDebugToolkitPackage.java +5 -3
- package/ios/DebugToolkitNativeLogs.mm +92 -0
- package/lib/commonjs/constants/logLevels.js +19 -0
- package/lib/commonjs/constants/logLevels.js.map +1 -0
- package/lib/commonjs/core/initialize.js +32 -19
- package/lib/commonjs/core/initialize.js.map +1 -1
- package/lib/commonjs/features/console/ConsoleLogTab.js +4 -15
- package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -1
- package/lib/commonjs/features/console/index.js +15 -8
- package/lib/commonjs/features/console/index.js.map +1 -1
- package/lib/commonjs/features/nativeLogs/NativeLogTab.js +156 -0
- package/lib/commonjs/features/nativeLogs/NativeLogTab.js.map +1 -0
- package/lib/commonjs/features/nativeLogs/index.js +97 -0
- package/lib/commonjs/features/nativeLogs/index.js.map +1 -0
- package/lib/commonjs/features/nativeLogs/nativeLogsBridge.js +71 -0
- package/lib/commonjs/features/nativeLogs/nativeLogsBridge.js.map +1 -0
- package/lib/commonjs/features/network/NetworkLogTab.js +90 -95
- package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -1
- package/lib/commonjs/features/network/index.js +7 -4
- package/lib/commonjs/features/network/index.js.map +1 -1
- package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js +1046 -0
- package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js.map +1 -0
- package/lib/commonjs/features/sessionHistory/index.js +104 -0
- package/lib/commonjs/features/sessionHistory/index.js.map +1 -0
- package/lib/commonjs/features/track/index.js +4 -3
- package/lib/commonjs/features/track/index.js.map +1 -1
- package/lib/commonjs/index.js +27 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/DebugView.js +2 -0
- package/lib/commonjs/ui/DebugView.js.map +1 -1
- package/lib/commonjs/ui/panel/DebugPanel.js +67 -34
- package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -1
- package/lib/commonjs/ui/panel/FeatureIntroCard.js +151 -0
- package/lib/commonjs/ui/panel/FeatureIntroCard.js.map +1 -0
- package/lib/commonjs/ui/panel/FeatureRail.js +163 -0
- package/lib/commonjs/ui/panel/FeatureRail.js.map +1 -0
- package/lib/commonjs/ui/panel/FloatPanelView.js +119 -22
- package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -1
- package/lib/commonjs/ui/panel/buildFeatureSummary.js +207 -0
- package/lib/commonjs/ui/panel/buildFeatureSummary.js.map +1 -0
- package/lib/commonjs/ui/panel/filterFeatureSnapshot.js +43 -0
- package/lib/commonjs/ui/panel/filterFeatureSnapshot.js.map +1 -0
- package/lib/commonjs/ui/theme/colors.js +6 -0
- package/lib/commonjs/ui/theme/colors.js.map +1 -1
- package/lib/commonjs/utils/DaemonClient.js +30 -8
- package/lib/commonjs/utils/DaemonClient.js.map +1 -1
- package/lib/commonjs/utils/SessionManager.js +132 -0
- package/lib/commonjs/utils/SessionManager.js.map +1 -0
- package/lib/commonjs/utils/StorageAdapter.js +104 -0
- package/lib/commonjs/utils/StorageAdapter.js.map +1 -0
- package/lib/commonjs/utils/createChannelFeature.js +22 -5
- package/lib/commonjs/utils/createChannelFeature.js.map +1 -1
- package/lib/commonjs/utils/createPersistedObservableStore.js +14 -8
- package/lib/commonjs/utils/createPersistedObservableStore.js.map +1 -1
- package/lib/commonjs/utils/debugPreferences.js +28 -5
- package/lib/commonjs/utils/debugPreferences.js.map +1 -1
- package/lib/commonjs/utils/deviceReport.js +5 -1
- package/lib/commonjs/utils/deviceReport.js.map +1 -1
- package/lib/commonjs/utils/logRuntime.js +32 -0
- package/lib/commonjs/utils/logRuntime.js.map +1 -0
- package/lib/module/constants/logLevels.js +15 -0
- package/lib/module/constants/logLevels.js.map +1 -0
- package/lib/module/core/initialize.js +32 -19
- package/lib/module/core/initialize.js.map +1 -1
- package/lib/module/features/console/ConsoleLogTab.js +1 -12
- package/lib/module/features/console/ConsoleLogTab.js.map +1 -1
- package/lib/module/features/console/index.js +15 -8
- package/lib/module/features/console/index.js.map +1 -1
- package/lib/module/features/nativeLogs/NativeLogTab.js +151 -0
- package/lib/module/features/nativeLogs/NativeLogTab.js.map +1 -0
- package/lib/module/features/nativeLogs/index.js +91 -0
- package/lib/module/features/nativeLogs/index.js.map +1 -0
- package/lib/module/features/nativeLogs/nativeLogsBridge.js +63 -0
- package/lib/module/features/nativeLogs/nativeLogsBridge.js.map +1 -0
- package/lib/module/features/network/NetworkLogTab.js +90 -95
- package/lib/module/features/network/NetworkLogTab.js.map +1 -1
- package/lib/module/features/network/index.js +7 -4
- package/lib/module/features/network/index.js.map +1 -1
- package/lib/module/features/sessionHistory/SessionHistoryTab.js +1041 -0
- package/lib/module/features/sessionHistory/SessionHistoryTab.js.map +1 -0
- package/lib/module/features/sessionHistory/index.js +100 -0
- package/lib/module/features/sessionHistory/index.js.map +1 -0
- package/lib/module/features/track/index.js +4 -3
- package/lib/module/features/track/index.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/DebugView.js +2 -0
- package/lib/module/ui/DebugView.js.map +1 -1
- package/lib/module/ui/panel/DebugPanel.js +67 -34
- package/lib/module/ui/panel/DebugPanel.js.map +1 -1
- package/lib/module/ui/panel/FeatureIntroCard.js +146 -0
- package/lib/module/ui/panel/FeatureIntroCard.js.map +1 -0
- package/lib/module/ui/panel/FeatureRail.js +158 -0
- package/lib/module/ui/panel/FeatureRail.js.map +1 -0
- package/lib/module/ui/panel/FloatPanelView.js +119 -22
- package/lib/module/ui/panel/FloatPanelView.js.map +1 -1
- package/lib/module/ui/panel/buildFeatureSummary.js +203 -0
- package/lib/module/ui/panel/buildFeatureSummary.js.map +1 -0
- package/lib/module/ui/panel/filterFeatureSnapshot.js +39 -0
- package/lib/module/ui/panel/filterFeatureSnapshot.js.map +1 -0
- package/lib/module/ui/theme/colors.js +6 -0
- package/lib/module/ui/theme/colors.js.map +1 -1
- package/lib/module/utils/DaemonClient.js +30 -8
- package/lib/module/utils/DaemonClient.js.map +1 -1
- package/lib/module/utils/SessionManager.js +127 -0
- package/lib/module/utils/SessionManager.js.map +1 -0
- package/lib/module/utils/StorageAdapter.js +96 -0
- package/lib/module/utils/StorageAdapter.js.map +1 -0
- package/lib/module/utils/createChannelFeature.js +22 -5
- package/lib/module/utils/createChannelFeature.js.map +1 -1
- package/lib/module/utils/createPersistedObservableStore.js +14 -8
- package/lib/module/utils/createPersistedObservableStore.js.map +1 -1
- package/lib/module/utils/debugPreferences.js +27 -5
- package/lib/module/utils/debugPreferences.js.map +1 -1
- package/lib/module/utils/deviceReport.js +4 -1
- package/lib/module/utils/deviceReport.js.map +1 -1
- package/lib/module/utils/logRuntime.js +26 -0
- package/lib/module/utils/logRuntime.js.map +1 -0
- package/lib/typescript/src/constants/logLevels.d.ts +3 -0
- package/lib/typescript/src/constants/logLevels.d.ts.map +1 -0
- package/lib/typescript/src/core/initialize.d.ts +6 -0
- package/lib/typescript/src/core/initialize.d.ts.map +1 -1
- package/lib/typescript/src/features/console/ConsoleLogTab.d.ts.map +1 -1
- package/lib/typescript/src/features/console/index.d.ts +2 -1
- package/lib/typescript/src/features/console/index.d.ts.map +1 -1
- package/lib/typescript/src/features/nativeLogs/NativeLogTab.d.ts +4 -0
- package/lib/typescript/src/features/nativeLogs/NativeLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/nativeLogs/index.d.ts +12 -0
- package/lib/typescript/src/features/nativeLogs/index.d.ts.map +1 -0
- package/lib/typescript/src/features/nativeLogs/nativeLogsBridge.d.ts +11 -0
- package/lib/typescript/src/features/nativeLogs/nativeLogsBridge.d.ts.map +1 -0
- package/lib/typescript/src/features/network/NetworkLogTab.d.ts.map +1 -1
- package/lib/typescript/src/features/network/index.d.ts +2 -1
- package/lib/typescript/src/features/network/index.d.ts.map +1 -1
- package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts +20 -0
- package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts.map +1 -0
- package/lib/typescript/src/features/sessionHistory/index.d.ts +4 -0
- package/lib/typescript/src/features/sessionHistory/index.d.ts.map +1 -0
- package/lib/typescript/src/features/track/index.d.ts +2 -1
- package/lib/typescript/src/features/track/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +7 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/feature.d.ts +1 -1
- package/lib/typescript/src/types/feature.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +3 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/logs.d.ts +15 -0
- package/lib/typescript/src/types/logs.d.ts.map +1 -1
- package/lib/typescript/src/ui/DebugView.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts +3 -1
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts +14 -0
- package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FeatureRail.d.ts +16 -0
- package/lib/typescript/src/ui/panel/FeatureRail.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts +13 -0
- package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts +3 -0
- package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/colors.d.ts +5 -0
- package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -1
- package/lib/typescript/src/utils/DaemonClient.d.ts +7 -1
- package/lib/typescript/src/utils/DaemonClient.d.ts.map +1 -1
- package/lib/typescript/src/utils/SessionManager.d.ts +30 -0
- package/lib/typescript/src/utils/SessionManager.d.ts.map +1 -0
- package/lib/typescript/src/utils/StorageAdapter.d.ts +38 -0
- package/lib/typescript/src/utils/StorageAdapter.d.ts.map +1 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts +2 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -1
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts +4 -1
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts.map +1 -1
- package/lib/typescript/src/utils/debugPreferences.d.ts +1 -3
- package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -1
- package/lib/typescript/src/utils/deviceReport.d.ts +1 -0
- package/lib/typescript/src/utils/deviceReport.d.ts.map +1 -1
- package/lib/typescript/src/utils/logRuntime.d.ts +13 -0
- package/lib/typescript/src/utils/logRuntime.d.ts.map +1 -0
- package/node/daemon/src/console/console.html +18 -0
- package/node/mcp/src/logs.js +1 -1
- package/package.json +9 -1
- package/src/constants/logLevels.ts +13 -0
- package/src/core/initialize.ts +54 -25
- package/src/features/console/ConsoleLogTab.tsx +1 -14
- package/src/features/console/index.ts +18 -8
- package/src/features/nativeLogs/NativeLogTab.tsx +66 -0
- package/src/features/nativeLogs/index.ts +94 -0
- package/src/features/nativeLogs/nativeLogsBridge.ts +51 -0
- package/src/features/network/NetworkLogTab.tsx +60 -71
- package/src/features/network/index.ts +12 -3
- package/src/features/sessionHistory/SessionHistoryTab.tsx +693 -0
- package/src/features/sessionHistory/index.ts +102 -0
- package/src/features/track/index.ts +10 -3
- package/src/index.ts +16 -0
- package/src/types/feature.ts +3 -1
- package/src/types/index.ts +13 -0
- package/src/types/logs.ts +17 -0
- package/src/ui/DebugView.tsx +2 -0
- package/src/ui/panel/DebugPanel.tsx +60 -30
- package/src/ui/panel/FeatureIntroCard.tsx +147 -0
- package/src/ui/panel/FeatureRail.tsx +165 -0
- package/src/ui/panel/FloatPanelView.tsx +123 -15
- package/src/ui/panel/buildFeatureSummary.ts +288 -0
- package/src/ui/panel/filterFeatureSnapshot.ts +51 -0
- package/src/ui/theme/colors.ts +7 -0
- package/src/utils/DaemonClient.ts +33 -5
- package/src/utils/SessionManager.ts +174 -0
- package/src/utils/StorageAdapter.ts +135 -0
- package/src/utils/createChannelFeature.ts +28 -6
- package/src/utils/createPersistedObservableStore.ts +18 -10
- package/src/utils/debugPreferences.ts +38 -7
- package/src/utils/deviceReport.ts +5 -1
- package/src/utils/logRuntime.ts +39 -0
- package/lib/commonjs/ui/panel/FeatureTabBar.js +0 -182
- package/lib/commonjs/ui/panel/FeatureTabBar.js.map +0 -1
- package/lib/module/ui/panel/FeatureTabBar.js +0 -177
- package/lib/module/ui/panel/FeatureTabBar.js.map +0 -1
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts +0 -13
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts.map +0 -1
- package/src/ui/panel/FeatureTabBar.tsx +0 -204
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FeatureSummary } from './buildFeatureSummary';
|
|
3
|
+
interface FeatureIntroCardProps {
|
|
4
|
+
title: string;
|
|
5
|
+
summary: FeatureSummary;
|
|
6
|
+
filterBad: boolean;
|
|
7
|
+
onFilterBad: (bad: boolean) => void;
|
|
8
|
+
searchQuery?: string;
|
|
9
|
+
onSearchChange?: (text: string) => void;
|
|
10
|
+
showSearch?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function FeatureIntroCard({ title, summary, filterBad, onFilterBad, searchQuery, onSearchChange, showSearch, }: FeatureIntroCardProps): React.JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=FeatureIntroCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureIntroCard.d.ts","sourceRoot":"","sources":["../../../../../src/ui/panel/FeatureIntroCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAO5D,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,WAAW,EACX,cAAc,EACd,UAAU,GACX,EAAE,qBAAqB,qBA2CvB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function shortLabelForFeature(label: string, id: string): string;
|
|
3
|
+
export interface RailItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
dotColor?: string | null;
|
|
7
|
+
count?: number;
|
|
8
|
+
}
|
|
9
|
+
interface FeatureRailProps {
|
|
10
|
+
items: RailItem[];
|
|
11
|
+
activeIndex: number;
|
|
12
|
+
onSelectTab: (index: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function FeatureRail({ items, activeIndex, onSelectTab }: FeatureRailProps): React.JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=FeatureRail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureRail.d.ts","sourceRoot":"","sources":["../../../../../src/ui/panel/FeatureRail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAKtE;AAID,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,gBAAgB;IACxB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,gBAAgB,qBA4ChF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatPanelView.d.ts","sourceRoot":"","sources":["../../../../../src/ui/panel/FloatPanelView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8D,MAAM,OAAO,CAAC;AAOnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"FloatPanelView.d.ts","sourceRoot":"","sources":["../../../../../src/ui/panel/FloatPanelView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8D,MAAM,OAAO,CAAC;AAOnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA0FnD,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,mBAAmB,qBA4JjH"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AnyDebugFeature } from '../../types';
|
|
2
|
+
export interface FeatureSummary {
|
|
3
|
+
capabilityText: string;
|
|
4
|
+
count?: number;
|
|
5
|
+
badCount?: number;
|
|
6
|
+
latestLabel?: string;
|
|
7
|
+
statusLabel?: string;
|
|
8
|
+
statusColor?: string;
|
|
9
|
+
filterMode?: 'all' | 'bad';
|
|
10
|
+
supportsBadFilter: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function buildFeatureSummary(feature: AnyDebugFeature, snapshot: unknown): FeatureSummary;
|
|
13
|
+
//# sourceMappingURL=buildFeatureSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildFeatureSummary.d.ts","sourceRoot":"","sources":["../../../../../src/ui/panel/buildFeatureSummary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,OAAO,GAChB,cAAc,CAgBhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterFeatureSnapshot.d.ts","sourceRoot":"","sources":["../../../../../src/ui/panel/filterFeatureSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,KAAK,GAAG,KAAK,GACxB,OAAO,CAiBT"}
|
|
@@ -11,6 +11,11 @@ export declare const Colors: {
|
|
|
11
11
|
readonly warning: "#FF9500";
|
|
12
12
|
readonly info: "#5AC8FA";
|
|
13
13
|
readonly purple: "#AF52DE";
|
|
14
|
+
readonly railBackground: "#E8EEF6";
|
|
15
|
+
readonly panelDivider: "#CED8E4";
|
|
16
|
+
readonly signalRedBg: "#FFE9E7";
|
|
17
|
+
readonly signalAmberBg: "#FFF1D6";
|
|
18
|
+
readonly signalDefaultBg: "#E7EDF5";
|
|
14
19
|
readonly get: "#007AFF";
|
|
15
20
|
readonly post: "#34C759";
|
|
16
21
|
readonly put: "#FF9500";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../../src/ui/theme/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../../src/ui/theme/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;CA4BT,CAAC;AAEX,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CASrD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FeatureDataProvider } from '../types';
|
|
2
|
-
import { type DebugDeviceReport, type DebugDeviceReportOptions } from './deviceReport';
|
|
2
|
+
import { type DebugDeviceReport, type DebugDeviceReportOptions, type SessionInfo } from './deviceReport';
|
|
3
3
|
export type DaemonConnectionMode = 'simulator' | 'device';
|
|
4
4
|
export interface DaemonSettings {
|
|
5
5
|
mode: DaemonConnectionMode;
|
|
@@ -47,6 +47,7 @@ export interface ReportToDaemonOptions extends DebugDeviceReportOptions {
|
|
|
47
47
|
endpoint?: string;
|
|
48
48
|
timeoutMs?: number;
|
|
49
49
|
token?: string;
|
|
50
|
+
session?: SessionInfo;
|
|
50
51
|
}
|
|
51
52
|
export interface ReportResult {
|
|
52
53
|
ok: boolean;
|
|
@@ -75,6 +76,7 @@ type AbortControllerLike = {
|
|
|
75
76
|
abort: () => void;
|
|
76
77
|
};
|
|
77
78
|
type AbortControllerCtor = new () => AbortControllerLike;
|
|
79
|
+
type SessionProvider = () => SessionInfo;
|
|
78
80
|
export declare function getDefaultDaemonEndpoint(): string;
|
|
79
81
|
export declare function buildDeviceDaemonEndpoint(host: string): string;
|
|
80
82
|
export declare function normalizeDaemonSettings(settings: DaemonSettings): {
|
|
@@ -97,6 +99,7 @@ export declare class DaemonClient {
|
|
|
97
99
|
private _onEndpointDetected;
|
|
98
100
|
private _restorePromise;
|
|
99
101
|
private _sessionId;
|
|
102
|
+
private _sessionProvider;
|
|
100
103
|
private _onConnectionChange;
|
|
101
104
|
constructor(options: DaemonClientOptions);
|
|
102
105
|
getSettings(): DaemonSettings;
|
|
@@ -109,6 +112,8 @@ export declare class DaemonClient {
|
|
|
109
112
|
setStreamingEnabled(enabled: boolean): void;
|
|
110
113
|
setEndpointDetector(callback: (url: string) => void): void;
|
|
111
114
|
setOnConnectionChange(callback: (() => void) | undefined): void;
|
|
115
|
+
setSessionProvider(provider: SessionProvider): void;
|
|
116
|
+
clearSessionProvider(): void;
|
|
112
117
|
restore(): Promise<void>;
|
|
113
118
|
private doRestore;
|
|
114
119
|
reportOnce(options?: ReportToDaemonOptions): Promise<ReportResult>;
|
|
@@ -117,6 +122,7 @@ export declare class DaemonClient {
|
|
|
117
122
|
private resolveFetch;
|
|
118
123
|
private createAbortController;
|
|
119
124
|
private notifyEndpoint;
|
|
125
|
+
private resolveSession;
|
|
120
126
|
private emitStatus;
|
|
121
127
|
private doPost;
|
|
122
128
|
private emitStreamStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DaemonClient.d.ts","sourceRoot":"","sources":["../../../../src/utils/DaemonClient.ts"],"names":[],"mappings":"AAGA,OAAO,KA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AC,gBAAgB;CAsGzB;AAID,eAAO,MAAM,YAAY,cAAsD,CAAC;AAmEhF,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SessionInfo } from './deviceReport';
|
|
2
|
+
import type { StorageAdapter } from './StorageAdapter';
|
|
3
|
+
export type LogFeatureKey = 'console_logs' | 'network_logs' | 'native_logs' | 'track_logs';
|
|
4
|
+
export type LogSession = SessionInfo;
|
|
5
|
+
export interface SessionIndex {
|
|
6
|
+
currentSessionId: string;
|
|
7
|
+
sessions: LogSession[];
|
|
8
|
+
maxSessions: number;
|
|
9
|
+
}
|
|
10
|
+
export interface SessionManagerOptions {
|
|
11
|
+
maxSessions?: number;
|
|
12
|
+
featureKeys?: LogFeatureKey[];
|
|
13
|
+
}
|
|
14
|
+
export declare class SessionManager {
|
|
15
|
+
private readonly storage;
|
|
16
|
+
private readonly currentSession;
|
|
17
|
+
private readonly maxSessions;
|
|
18
|
+
private readonly featureKeys;
|
|
19
|
+
constructor(storage: StorageAdapter, options?: SessionManagerOptions);
|
|
20
|
+
initialize(): Promise<void>;
|
|
21
|
+
getCurrentSession(): LogSession;
|
|
22
|
+
getSessionHistory(): Promise<LogSession[]>;
|
|
23
|
+
getLogStorageKey(featureKey: LogFeatureKey, sessionId?: string): string;
|
|
24
|
+
loadSessionLogs<T>(sessionId: string, featureKey: LogFeatureKey): Promise<T[]>;
|
|
25
|
+
getSessionLogCount(sessionId: string, featureKey: LogFeatureKey): Promise<number>;
|
|
26
|
+
clearCurrentSessionLogs(featureKey: LogFeatureKey): Promise<void>;
|
|
27
|
+
cleanupOldSessions(): Promise<number>;
|
|
28
|
+
private cleanupSessionLogs;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=SessionManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionManager.d.ts","sourceRoot":"","sources":["../../../../src/utils/SessionManager.ts"],"names":[],"mappings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AAM,CAAC;YAsB7B,kBAAkB;CAOjC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface StorageAdapter {
|
|
2
|
+
getItem(key: string): string | null | Promise<string | null>;
|
|
3
|
+
setItem(key: string, value: string): void | Promise<void>;
|
|
4
|
+
removeItem(key: string): void | Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
type AsyncStorageLike = {
|
|
7
|
+
getItem: (key: string) => Promise<string | null>;
|
|
8
|
+
setItem: (key: string, value: string) => Promise<void>;
|
|
9
|
+
removeItem: (key: string) => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
type MMKVLike = {
|
|
12
|
+
getString: (key: string) => string | undefined;
|
|
13
|
+
set: (key: string, value: string) => void;
|
|
14
|
+
delete: (key: string) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare class MemoryStorageAdapter implements StorageAdapter {
|
|
17
|
+
private readonly store;
|
|
18
|
+
getItem(key: string): string | null;
|
|
19
|
+
setItem(key: string, value: string): void;
|
|
20
|
+
removeItem(key: string): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class AsyncStorageAdapter implements StorageAdapter {
|
|
23
|
+
private readonly storage;
|
|
24
|
+
constructor(storage: AsyncStorageLike);
|
|
25
|
+
getItem(key: string): Promise<string | null>;
|
|
26
|
+
setItem(key: string, value: string): Promise<void>;
|
|
27
|
+
removeItem(key: string): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export declare class MMKVStorageAdapter implements StorageAdapter {
|
|
30
|
+
private readonly storage;
|
|
31
|
+
constructor(storage: MMKVLike);
|
|
32
|
+
getItem(key: string): string | null;
|
|
33
|
+
setItem(key: string, value: string): void;
|
|
34
|
+
removeItem(key: string): void;
|
|
35
|
+
}
|
|
36
|
+
export declare function createDefaultLogStorage(): StorageAdapter;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=StorageAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageAdapter.d.ts","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Aa,mBAAoB,YAAW,cAAc;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,gBAAgB;IAEtD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAI5C,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlD,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGvC;AAED,qBAAa,kBAAmB,YAAW,cAAc;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;gBAEvB,OAAO,EAAE,QAAQ;IAI7B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAInC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAO9B;AAsDD,wBAAgB,uBAAuB,IAAI,cAAc,CAExD"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { DebugFeature, DebugFeatureRenderProps } from '../types';
|
|
3
3
|
import type { EventChannel } from './createEventChannel';
|
|
4
|
+
import type { StorageAdapter } from './StorageAdapter';
|
|
4
5
|
export interface ChannelFeaturePersistConfig<TEntry> {
|
|
6
|
+
storage: StorageAdapter;
|
|
5
7
|
storageKey: string;
|
|
6
8
|
maxPersist: number;
|
|
7
9
|
debounceMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createChannelFeature.d.ts","sourceRoot":"","sources":["../../../../src/utils/createChannelFeature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAwB,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAC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AAE,MAAM,sBAAsB,CAAC;AAMzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIvD,MAAM,WAAW,2BAA2B,CAAC,MAAM;IACjD,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,MAAM,KAAK,OAAO,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,SAAS;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3E,UAAU,EAAE,MAAM,YAAY,CAAC,QAAQ,CAAC,EACxC,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,EAClD,OAAO,EAAE;IACP,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;IAC9C,0EAA0E;IAC1E,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,QAAQ,GAAG,IAAI,CAAC;IACpD,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;CACrC,GACA,YAAY,CAAC,MAAM,EAAE,CAAC,CAsExB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ObservableStore } from './createObservableStore';
|
|
2
|
+
import type { StorageAdapter } from './StorageAdapter';
|
|
2
3
|
export interface PersistedStoreOptions<T> {
|
|
4
|
+
storage: StorageAdapter;
|
|
3
5
|
storageKey: string;
|
|
4
6
|
maxPersist: number;
|
|
5
7
|
debounceMs?: number;
|
|
@@ -8,7 +10,8 @@ export interface PersistedStoreOptions<T> {
|
|
|
8
10
|
export interface PersistedObservableStore<T> extends ObservableStore<T> {
|
|
9
11
|
nextId: () => string;
|
|
10
12
|
ready: Promise<void>;
|
|
11
|
-
|
|
13
|
+
clearPersisted: () => void;
|
|
14
|
+
dispose: () => void;
|
|
12
15
|
}
|
|
13
16
|
export declare function createPersistedObservableStore<T extends {
|
|
14
17
|
id?: string;
|
|
@@ -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;
|
|
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,11 +1,9 @@
|
|
|
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
8
|
readonly daemonPort: "@react_native_debug_toolkit/daemon_port";
|
|
11
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugPreferences.d.ts","sourceRoot":"","sources":["../../../../src/utils/debugPreferences.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -300,6 +300,7 @@ header h1 span{color:var(--text3);font-weight:400}
|
|
|
300
300
|
}
|
|
301
301
|
.log-type-network{color:var(--cyan)}
|
|
302
302
|
.log-type-console{color:var(--green)}
|
|
303
|
+
.log-type-native{color:var(--amber)}
|
|
303
304
|
.log-type-navigation{color:var(--purple)}
|
|
304
305
|
.log-type-track{color:var(--orange)}
|
|
305
306
|
.log-type-zustand{color:var(--pink)}
|
|
@@ -713,6 +714,7 @@ mark{
|
|
|
713
714
|
navigation: 'Navigation',
|
|
714
715
|
track: 'Track',
|
|
715
716
|
zustand: 'State',
|
|
717
|
+
native: 'Native',
|
|
716
718
|
clipboard: 'Clipboard',
|
|
717
719
|
environment: 'Environment',
|
|
718
720
|
};
|
|
@@ -764,6 +766,9 @@ mark{
|
|
|
764
766
|
var data = Array.isArray(entry.data) ? entry.data.map(formatInlineValue).join(' ') : formatInlineValue(entry.data);
|
|
765
767
|
return escapeHtml(data.substring(0, 200));
|
|
766
768
|
}
|
|
769
|
+
if (entry.source === 'logcat' || entry.source === 'rctLog') {
|
|
770
|
+
return escapeHtml([entry.tag, entry.message].filter(Boolean).join(': ').substring(0, 200));
|
|
771
|
+
}
|
|
767
772
|
if (entry.from || entry.to) return escapeHtml((entry.from || '-') + ' -> ' + (entry.to || '-'));
|
|
768
773
|
if (entry.eventName) return escapeHtml(String(entry.eventName));
|
|
769
774
|
if (entry.event) return escapeHtml(String(entry.event));
|
|
@@ -778,6 +783,7 @@ mark{
|
|
|
778
783
|
if (entry.from || entry.to || entry.path) return 'navigation';
|
|
779
784
|
if (entry.eventName || entry.event) return 'track';
|
|
780
785
|
if (entry.prevState !== undefined || entry.nextState !== undefined || entry.storeName) return 'zustand';
|
|
786
|
+
if (entry.source === 'logcat' || entry.source === 'rctLog' || entry.platform === 'android' || entry.platform === 'ios') return 'native';
|
|
781
787
|
if (entry.action) return 'zustand';
|
|
782
788
|
return 'unknown';
|
|
783
789
|
}
|
|
@@ -919,6 +925,17 @@ mark{
|
|
|
919
925
|
entry.data);
|
|
920
926
|
}
|
|
921
927
|
|
|
928
|
+
function renderNativeDetails(entry) {
|
|
929
|
+
return renderSection('Native Log', renderRows([
|
|
930
|
+
['Level', entry.level], ['Platform', entry.platform], ['Source', entry.source],
|
|
931
|
+
['Tag', entry.tag], ['Thread', entry.thread], ['File', entry.file],
|
|
932
|
+
['Line', entry.line], ['Time', entry.timestamp ? formatTime(new Date(entry.timestamp).toISOString()) : ''],
|
|
933
|
+
])) +
|
|
934
|
+
renderSection('Message', renderValue(entry.message || ''), entry.message || '') +
|
|
935
|
+
(entry.raw ? renderSection('Raw', renderValue(entry.raw), entry.raw) : '') +
|
|
936
|
+
renderSection('Entry JSON', renderValue(entry), entry);
|
|
937
|
+
}
|
|
938
|
+
|
|
922
939
|
function estimateByteSize(value) {
|
|
923
940
|
if (value == null) return 0;
|
|
924
941
|
if (typeof value === 'string') return new Blob([value]).size;
|
|
@@ -1084,6 +1101,7 @@ mark{
|
|
|
1084
1101
|
}
|
|
1085
1102
|
if (logType === 'network') return renderNetworkDetails(entry);
|
|
1086
1103
|
if (logType === 'console') return renderConsoleDetails(entry);
|
|
1104
|
+
if (logType === 'native') return renderNativeDetails(entry);
|
|
1087
1105
|
if (logType === 'navigation') return renderNavigationDetails(entry);
|
|
1088
1106
|
if (logType === 'track') return renderTrackDetails(entry);
|
|
1089
1107
|
if (logType === 'zustand') return renderStateDetails(entry);
|
package/node/mcp/src/logs.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-debug-toolkit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
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",
|
|
@@ -54,12 +54,20 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
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",
|
|
57
59
|
"react": ">=18.0.0",
|
|
58
60
|
"react-native": ">=0.72.0"
|
|
59
61
|
},
|
|
60
62
|
"peerDependenciesMeta": {
|
|
63
|
+
"@react-native-async-storage/async-storage": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
61
66
|
"@react-native-clipboard/clipboard": {
|
|
62
67
|
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"react-native-mmkv": {
|
|
70
|
+
"optional": true
|
|
63
71
|
}
|
|
64
72
|
},
|
|
65
73
|
"devDependencies": {
|
package/src/core/initialize.ts
CHANGED
|
@@ -12,8 +12,17 @@ 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';
|
|
16
|
+
import { createNativeLogsFeature } from '../features/nativeLogs';
|
|
17
|
+
import type { NativeLogsFeatureConfig } from '../features/nativeLogs';
|
|
15
18
|
import { daemonClient } from '../utils/DaemonClient';
|
|
16
19
|
import type { AnyDebugFeature, BuiltInFeatureName } from '../types';
|
|
20
|
+
import type { StorageAdapter } from '../utils/StorageAdapter';
|
|
21
|
+
import {
|
|
22
|
+
createLogRuntime,
|
|
23
|
+
setDefaultLogRuntime,
|
|
24
|
+
type LogRuntimeContext,
|
|
25
|
+
} from '../utils/logRuntime';
|
|
17
26
|
|
|
18
27
|
const isDebugMode = __DEV__;
|
|
19
28
|
|
|
@@ -21,50 +30,61 @@ const isDebugMode = __DEV__;
|
|
|
21
30
|
export interface FeatureConfigs {
|
|
22
31
|
network?: boolean | NetworkFeatureConfig;
|
|
23
32
|
console?: boolean | ConsoleFeatureConfig;
|
|
33
|
+
native?: boolean | NativeLogsFeatureConfig;
|
|
24
34
|
zustand?: boolean | ZustandFeatureConfig;
|
|
25
35
|
navigation?: boolean | NavigationFeatureConfig;
|
|
26
36
|
track?: boolean | TrackFeatureConfig;
|
|
27
37
|
environment?: Parameters<typeof createEnvironmentFeature>[0];
|
|
28
38
|
clipboard?: boolean;
|
|
29
39
|
devConnect?: boolean;
|
|
40
|
+
sessionHistory?: boolean;
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
export interface InitializeOptions {
|
|
33
44
|
features?: FeatureConfigs;
|
|
34
45
|
customFeatures?: AnyDebugFeature[];
|
|
35
46
|
enabled?: boolean;
|
|
47
|
+
logStorage?: StorageAdapter;
|
|
48
|
+
maxLogSessions?: number;
|
|
36
49
|
}
|
|
37
50
|
|
|
51
|
+
type EnvironmentFeatureConfig = Parameters<typeof createEnvironmentFeature>[0];
|
|
52
|
+
type BuiltInFeatureCreator = (config?: unknown, runtime?: LogRuntimeContext) => AnyDebugFeature;
|
|
53
|
+
|
|
38
54
|
/** Registry mapping feature names to creator functions */
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
const featureRegistry: Record<BuiltInFeatureName, BuiltInFeatureCreator> = {
|
|
56
|
+
network: (config, runtime) => createNetworkFeature(config as NetworkFeatureConfig | undefined, runtime),
|
|
57
|
+
console: (config, runtime) => createConsoleLogFeature(config as ConsoleFeatureConfig | undefined, runtime),
|
|
58
|
+
native: (config) => createNativeLogsFeature(config as NativeLogsFeatureConfig | undefined),
|
|
59
|
+
zustand: (config) => createZustandLogFeature(config as ZustandFeatureConfig | undefined),
|
|
60
|
+
navigation: (config) => createNavigationLogFeature(config as NavigationFeatureConfig | undefined),
|
|
61
|
+
track: (config, runtime) => createTrackFeature(config as TrackFeatureConfig | undefined, runtime),
|
|
62
|
+
environment: (config) => createEnvironmentFeature(config as EnvironmentFeatureConfig | undefined),
|
|
63
|
+
clipboard: () => createClipboardFeature(),
|
|
64
|
+
devConnect: () => createDevConnectFeature(),
|
|
65
|
+
sessionHistory: (_config, runtime) => createSessionHistoryFeature(runtime),
|
|
50
66
|
};
|
|
51
67
|
|
|
52
68
|
const DEFAULT_FEATURES: BuiltInFeatureName[] = [
|
|
53
69
|
'network',
|
|
54
70
|
'console',
|
|
71
|
+
'native',
|
|
55
72
|
'navigation',
|
|
56
73
|
'zustand',
|
|
57
74
|
'track',
|
|
58
75
|
'clipboard',
|
|
59
76
|
'devConnect',
|
|
77
|
+
'sessionHistory',
|
|
60
78
|
];
|
|
61
79
|
|
|
62
|
-
function resolveFeatureConfigs(configs: FeatureConfigs): AnyDebugFeature[] {
|
|
80
|
+
function resolveFeatureConfigs(configs: FeatureConfigs, runtime: LogRuntimeContext): AnyDebugFeature[] {
|
|
63
81
|
const features: AnyDebugFeature[] = [];
|
|
64
82
|
const entries = Object.entries(configs) as [BuiltInFeatureName, unknown][];
|
|
65
83
|
|
|
66
84
|
for (const [name, config] of entries) {
|
|
67
|
-
if (config === false)
|
|
85
|
+
if (config === false) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
68
88
|
|
|
69
89
|
const creator = featureRegistry[name];
|
|
70
90
|
if (!creator) {
|
|
@@ -73,17 +93,17 @@ function resolveFeatureConfigs(configs: FeatureConfigs): AnyDebugFeature[] {
|
|
|
73
93
|
}
|
|
74
94
|
|
|
75
95
|
if (config === true || config === undefined) {
|
|
76
|
-
features.push(creator());
|
|
96
|
+
features.push(creator(undefined, runtime));
|
|
77
97
|
} else if (typeof config === 'object') {
|
|
78
|
-
features.push(creator(config as Record<string, unknown
|
|
98
|
+
features.push(creator(config as Record<string, unknown>, runtime));
|
|
79
99
|
}
|
|
80
100
|
}
|
|
81
101
|
|
|
82
102
|
return features;
|
|
83
103
|
}
|
|
84
104
|
|
|
85
|
-
function resolveDefaultFeatures(): AnyDebugFeature[] {
|
|
86
|
-
return DEFAULT_FEATURES.map((name) => featureRegistry[name]!());
|
|
105
|
+
function resolveDefaultFeatures(runtime: LogRuntimeContext): AnyDebugFeature[] {
|
|
106
|
+
return DEFAULT_FEATURES.map((name) => featureRegistry[name]!(undefined, runtime));
|
|
87
107
|
}
|
|
88
108
|
|
|
89
109
|
function appendCustomFeatures(
|
|
@@ -123,23 +143,32 @@ export async function initializeDebugToolkit(
|
|
|
123
143
|
}
|
|
124
144
|
}
|
|
125
145
|
|
|
126
|
-
const resolvedBuiltInFeatures = options?.features
|
|
127
|
-
? resolveFeatureConfigs(options.features)
|
|
128
|
-
: resolveDefaultFeatures();
|
|
129
|
-
const resolvedFeatures = appendCustomFeatures(
|
|
130
|
-
resolvedBuiltInFeatures,
|
|
131
|
-
options?.customFeatures,
|
|
132
|
-
);
|
|
133
|
-
|
|
134
146
|
try {
|
|
135
147
|
DebugToolkit.setEnabled(enabled);
|
|
136
148
|
|
|
137
149
|
if (!enabled) {
|
|
150
|
+
daemonClient.clearSessionProvider();
|
|
138
151
|
DebugToolkit.reset();
|
|
139
152
|
return DebugToolkit;
|
|
140
153
|
}
|
|
141
154
|
|
|
155
|
+
const runtime = createLogRuntime({
|
|
156
|
+
logStorage: options?.logStorage,
|
|
157
|
+
maxSessions: options?.maxLogSessions,
|
|
158
|
+
});
|
|
159
|
+
setDefaultLogRuntime(runtime);
|
|
160
|
+
daemonClient.setSessionProvider(() => runtime.sessionManager.getCurrentSession());
|
|
161
|
+
|
|
162
|
+
const resolvedBuiltInFeatures = options?.features
|
|
163
|
+
? resolveFeatureConfigs(options.features, runtime)
|
|
164
|
+
: resolveDefaultFeatures(runtime);
|
|
165
|
+
const resolvedFeatures = appendCustomFeatures(
|
|
166
|
+
resolvedBuiltInFeatures,
|
|
167
|
+
options?.customFeatures,
|
|
168
|
+
);
|
|
169
|
+
|
|
142
170
|
DebugToolkit.replaceFeatures(resolvedFeatures);
|
|
171
|
+
runtime.sessionManager.initialize().catch(() => {});
|
|
143
172
|
|
|
144
173
|
daemonClient.setEndpointDetector((url) => {
|
|
145
174
|
addToBlacklist(url);
|