capdebug 0.1.0 → 0.3.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 (135) hide show
  1. package/README.md +69 -1
  2. package/android/build/.transforms/105231053f5053e70f17f15178bed793/results.bin +1 -0
  3. package/android/build/.transforms/7c2b02c40854250ff97be5e9e723091e/results.bin +1 -0
  4. package/android/build/.transforms/ca1c0f6bb67b5238fd83a40c3a1c0ddd/results.bin +1 -0
  5. package/android/build/.transforms/ca1c0f6bb67b5238fd83a40c3a1c0ddd/transformed/classes/classes_dex/classes.dex +0 -0
  6. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +9 -0
  7. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
  8. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +6 -0
  9. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
  10. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  11. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  12. package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -0
  13. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  14. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  15. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  16. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  17. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  18. package/android/build/intermediates/java_res/debug/out/META-INF/capdebug_debug.kotlin_module +0 -0
  19. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
  20. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +11 -0
  21. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +9 -0
  22. package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
  23. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  24. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +1 -0
  25. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  57. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  58. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  59. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  60. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  61. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  62. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  63. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  64. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  65. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  66. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  67. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  68. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  69. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  70. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  71. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  72. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  73. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  74. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  75. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  76. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  77. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  78. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  81. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
  82. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  83. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  85. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  91. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  92. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  93. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  94. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  95. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  96. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  97. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  98. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  99. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  100. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  101. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  104. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  105. package/android/build/outputs/logs/manifest-merger-debug-report.txt +20 -0
  106. package/android/build/tmp/kotlin-classes/debug/META-INF/capdebug_debug.kotlin_module +0 -0
  107. package/android/build/tmp/kotlin-classes/debug/com/capdebug/plugin/CapDebugPlugin$Companion.class +0 -0
  108. package/android/build/tmp/kotlin-classes/debug/com/capdebug/plugin/CapDebugPlugin.class +0 -0
  109. package/android/src/main/java/com/capdebug/plugin/CapDebugPlugin.kt +54 -0
  110. package/bin/capdebug.js +8 -0
  111. package/dist/capacitor/deep-link.d.ts +4 -0
  112. package/dist/cli/index.d.ts +1 -0
  113. package/dist/cli/qr.d.ts +15 -0
  114. package/dist/cli/server.d.ts +34 -0
  115. package/dist/cli.js +1868 -0
  116. package/dist/cli.js.map +1 -0
  117. package/dist/index.d.ts +13 -0
  118. package/dist/plugin.cjs.js +2639 -1912
  119. package/dist/plugin.cjs.js.map +1 -1
  120. package/dist/plugin.js +2749 -2022
  121. package/dist/plugin.js.map +1 -1
  122. package/dist/plugin.mjs +2632 -1913
  123. package/dist/plugin.mjs.map +1 -1
  124. package/dist/remote/buffer.d.ts +13 -0
  125. package/dist/remote/desktop-viewer-html.d.ts +10 -0
  126. package/dist/remote/pairing-page-html.d.ts +8 -0
  127. package/dist/remote/pairing.d.ts +34 -0
  128. package/dist/remote/protocol.d.ts +14 -0
  129. package/dist/remote/remote-manager.d.ts +19 -0
  130. package/dist/remote/signaling.d.ts +27 -0
  131. package/dist/remote/transport.d.ts +15 -0
  132. package/dist/remote/types.d.ts +69 -0
  133. package/dist/remote/webrtc-transport.d.ts +47 -0
  134. package/ios/Sources/CapDebugPlugin/CapDebugPlugin.swift +41 -0
  135. package/package.json +6 -2
package/README.md CHANGED
@@ -8,6 +8,7 @@
8
8
 
9
9
  ## Features
10
10
 
11
+ - 🌐 **QR-Based Remote WebRTC Debugging**: Run `npx capdebug` on your desktop, scan the terminal QR code with your phone camera, and stream all mobile debug events, logs, errors, and system metrics directly to your computer's browser in real-time over peer-to-peer WebRTC DataChannels.
11
12
  - 🚀 **Zero UI Framework Dependencies**: Built purely with Web Components, Shadow DOM, and Vanilla CSS. Works seamlessly with React, Vue, Svelte, Angular, Solid, or Vanilla JS.
12
13
  - 🛡️ **Complete CSS Isolation**: Shadow DOM guarantees that the debug UI never conflicts with or inherits host application styles.
13
14
  - 📱 **Mobile-First Floating Trigger**: Draggable floating pill that automatically snaps to the left/right screen edge, persists coordinates in `localStorage`, and supports safe-area insets.
@@ -27,6 +28,35 @@
27
28
 
28
29
  ---
29
30
 
31
+ ## Remote Debugging (QR + WebRTC)
32
+
33
+ CapDebug allows streaming your phone's debug session directly to your desktop browser without cables or cloud accounts:
34
+
35
+ ```bash
36
+ # 1. On your computer terminal:
37
+ npx capdebug
38
+ ```
39
+
40
+ 1. The CLI launches a local desktop viewer at `http://localhost:4783` and prints a scannable ANSI QR code.
41
+ 2. Point your phone's camera at the terminal to open the pairing URL.
42
+ 3. The phone connects via WebRTC DataChannel (Direct LAN / STUN) and streams all logs, errors, network calls, and native diagnostics to your desktop viewer in real-time.
43
+
44
+ ### Mobile Deep-Link Handling in Capacitor
45
+ ```ts
46
+ import { App } from '@capacitor/app';
47
+ import { CapDebug } from 'capdebug';
48
+
49
+ if (import.meta.env.DEV) {
50
+ App.addListener('appUrlOpen', async ({ url }) => {
51
+ if (url.startsWith('capdebug://pair')) {
52
+ await CapDebug.handlePairingUrl(url);
53
+ }
54
+ });
55
+ }
56
+ ```
57
+
58
+ ---
59
+
30
60
  ## Installation
31
61
 
32
62
  ```bash
@@ -168,7 +198,45 @@ CapDebug.unobserveEvent('online');
168
198
 
169
199
  ---
170
200
 
171
- ## Native Device Diagnostics
201
+ ## Native Telemetry & Diagnostics
202
+
203
+ ### Emitting Telemetry from Swift & Kotlin
204
+
205
+ `capdebug` includes static native helpers so native plugins, background workers, or services can emit debug events directly into the WebView's CapDebug event bus:
206
+
207
+ #### iOS (Swift)
208
+ ```swift
209
+ import CapDebug
210
+
211
+ CapDebugPlugin.emit(
212
+ type: "native.video.compress",
213
+ message: "Video compression completed",
214
+ data: ["outputBitrate": 1500000, "codec": "h264"],
215
+ level: "info",
216
+ duration: 342.5 // ms
217
+ )
218
+ ```
219
+
220
+ #### Android (Kotlin)
221
+ ```kotlin
222
+ import com.capdebug.plugin.CapDebugPlugin
223
+ import com.getcapacitor.JSObject
224
+
225
+ val data = JSObject().apply {
226
+ put("file", "recording.m4a")
227
+ put("format", "aac")
228
+ }
229
+
230
+ CapDebugPlugin.emit(
231
+ type: "native.audio.transcode",
232
+ message: "Audio transcode finished",
233
+ data: data,
234
+ level: "info",
235
+ duration: 180L // ms
236
+ )
237
+ ```
238
+
239
+ ### Querying Native Device Diagnostics in TypeScript
172
240
 
173
241
  When running in Capacitor iOS or Android (or web fallback), diagnostics are fetched on-demand when opening the **Device** tab or via programmatic calls:
174
242
 
@@ -0,0 +1 @@
1
+ i/classes_global-synthetics
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.capdebug.plugin" >
4
+
5
+ <uses-sdk android:minSdkVersion="22" />
6
+
7
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
8
+
9
+ </manifest>
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 3,
3
+ "artifactType": {
4
+ "type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
5
+ "kind": "Directory"
6
+ },
7
+ "applicationId": "com.capdebug.plugin",
8
+ "variantName": "debug",
9
+ "elements": [
10
+ {
11
+ "type": "SINGLE",
12
+ "filters": [],
13
+ "attributes": [],
14
+ "outputFile": "AndroidManifest.xml"
15
+ }
16
+ ],
17
+ "elementType": "File"
18
+ }
@@ -0,0 +1,6 @@
1
+ aarFormatVersion=1.0
2
+ aarMetadataVersion=1.0
3
+ minCompileSdk=1
4
+ minCompileSdkExtension=0
5
+ minAndroidGradlePluginVersion=1.0.0
6
+ coreLibraryDesugaringEnabled=false
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated" generated-set="generated$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/build/generated/res/resValues/debug"/></dataSet><mergedItems/></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/debug/jniLibs"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/debug/shaders"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/debug/assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/build/intermediates/shader_assets/debug/out"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ R_DEF: Internal format may change without notice
2
+ local
@@ -0,0 +1,11 @@
1
+ 1<?xml version="1.0" encoding="utf-8"?>
2
+ 2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ 3 package="com.capdebug.plugin" >
4
+ 4
5
+ 5 <uses-sdk android:minSdkVersion="22" />
6
+ 6
7
+ 7 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
8
+ 7-->/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml:2:5-79
9
+ 7-->/Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml:2:22-76
10
+ 8
11
+ 9</manifest>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.capdebug.plugin" >
4
+
5
+ <uses-sdk android:minSdkVersion="22" />
6
+
7
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
8
+
9
+ </manifest>
@@ -0,0 +1,20 @@
1
+ -- Merging decision tree log ---
2
+ manifest
3
+ ADDED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml:1:1-3:12
4
+ INJECTED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml:1:1-3:12
5
+ package
6
+ INJECTED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml
7
+ xmlns:android
8
+ ADDED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml:1:11-69
9
+ uses-permission#android.permission.ACCESS_NETWORK_STATE
10
+ ADDED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml:2:5-79
11
+ android:name
12
+ ADDED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml:2:22-76
13
+ uses-sdk
14
+ INJECTED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
15
+ INJECTED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml
16
+ INJECTED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml
17
+ android:targetSdkVersion
18
+ INJECTED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml
19
+ android:minSdkVersion
20
+ INJECTED from /Users/ahmet/projects/capdebug/example/node_modules/capdebug/android/src/main/AndroidManifest.xml
@@ -20,6 +20,60 @@ import java.util.Locale
20
20
  @CapacitorPlugin(name = "CapDebug")
21
21
  class CapDebugPlugin : Plugin() {
22
22
 
23
+ override fun load() {
24
+ super.load()
25
+ activeBridge = bridge
26
+ }
27
+
28
+ companion object {
29
+ private var activeBridge: com.getcapacitor.Bridge? = null
30
+
31
+ /**
32
+ * Emits a telemetry or debug event directly from Android native code into CapDebug.
33
+ */
34
+ @JvmStatic
35
+ @JvmOverloads
36
+ fun emit(
37
+ type: String,
38
+ message: String? = null,
39
+ data: JSObject? = null,
40
+ level: String = "info",
41
+ duration: Long? = null,
42
+ source: String = "native",
43
+ bridge: com.getcapacitor.Bridge? = null
44
+ ) {
45
+ val targetBridge = bridge ?: activeBridge ?: return
46
+
47
+ // Zero-overhead guard: No-op in production release builds
48
+ val isDebuggable = try {
49
+ val context = targetBridge.context
50
+ (context.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0
51
+ } catch (e: Exception) {
52
+ false
53
+ }
54
+
55
+ if (!isDebuggable) {
56
+ return
57
+ }
58
+
59
+ val payload = JSObject().apply {
60
+ put("source", source)
61
+ put("platform", "android")
62
+ put("type", type)
63
+ put("level", level)
64
+ message?.let { put("message", it) }
65
+ put("timestamp", System.currentTimeMillis())
66
+ data?.let { put("data", it) }
67
+ duration?.let { put("duration", it) }
68
+ }
69
+
70
+ val js = "window.dispatchEvent(new CustomEvent('capdebug', { detail: $payload }));"
71
+ targetBridge.webView?.post {
72
+ targetBridge.webView?.evaluateJavascript(js, null)
73
+ }
74
+ }
75
+ }
76
+
23
77
  @PluginMethod
24
78
  fun getDeviceInfo(call: PluginCall) {
25
79
  try {
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { runCli } = require('../dist/cli.js');
4
+
5
+ runCli().catch((err) => {
6
+ console.error('[CapDebug CLI Error]:', err);
7
+ process.exit(1);
8
+ });
@@ -0,0 +1,4 @@
1
+ import { type ParsedPairingInfo } from '../remote/pairing';
2
+ export declare class DeepLinkHandler {
3
+ static parse(url: string): ParsedPairingInfo | null;
4
+ }
@@ -0,0 +1 @@
1
+ export declare function runCli(argv?: string[]): Promise<void>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Zero-dependency QR Code matrix generator and terminal ANSI renderer.
3
+ * Encodes Byte Mode URLs and renders compact Unicode half-block characters.
4
+ */
5
+ export declare class TerminalQRCode {
6
+ /**
7
+ * Generates a 2D boolean grid (true = dark/black, false = light/white) for the given text.
8
+ */
9
+ static generateMatrix(text: string): boolean[][];
10
+ /**
11
+ * Renders the matrix to terminal string using ANSI half-block characters (▀, ▄, █).
12
+ * 2 vertical rows are packed into 1 line of terminal output for high compactness.
13
+ */
14
+ static renderToString(text: string): string;
15
+ }
@@ -0,0 +1,34 @@
1
+ import * as http from 'http';
2
+ import type { PairingSession } from '../remote/types';
3
+ export interface ServerSessionInfo {
4
+ session: PairingSession;
5
+ secret: string;
6
+ subscribers: Set<http.ServerResponse>;
7
+ peerJoined: boolean;
8
+ }
9
+ export declare class CapDebugCliServer {
10
+ private server;
11
+ private sessions;
12
+ private port;
13
+ private host;
14
+ constructor(options?: {
15
+ port?: number;
16
+ host?: string;
17
+ });
18
+ getLanIp(): string;
19
+ getLocalViewerUrl(): string;
20
+ getMobilePairingUrl(sessionId: string, secret: string): string;
21
+ createSession(): {
22
+ session: PairingSession;
23
+ secret: string;
24
+ };
25
+ getSession(id: string): ServerSessionInfo | undefined;
26
+ start(): Promise<{
27
+ port: number;
28
+ lanIp: string;
29
+ }>;
30
+ stop(): Promise<void>;
31
+ private handleRequest;
32
+ private broadcast;
33
+ private readJsonBody;
34
+ }