cordova.plugins.diagnostic 7.3.0 → 7.3.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/.specstory/.project.json +7 -0
- package/.specstory/cli/config.toml +82 -0
- package/.specstory/history/2026-05-08_15-16-55Z-implement-device-power-mode-features.md +67 -0
- package/.specstory/statistics.json +13 -0
- package/CHANGELOG.md +3 -0
- package/README.md +3 -0
- package/cordova.plugins.diagnostic.d.ts +3 -0
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/android/Diagnostic.java +6 -0
- package/www/android/diagnostic.js +3 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# SpecStory CLI Configuration
|
|
2
|
+
#
|
|
3
|
+
# This is the project-level config file for SpecStory CLI.
|
|
4
|
+
# All settings here apply to this project unless overridden by CLI flags.
|
|
5
|
+
#
|
|
6
|
+
# Uncomment (remove the #) the line and edit any setting below to change the default behavior.
|
|
7
|
+
# For more information, see: https://docs.specstory.com/integrations/terminal-coding-agents/usage
|
|
8
|
+
|
|
9
|
+
[local_sync]
|
|
10
|
+
# Write markdown files locally. (default: true)
|
|
11
|
+
# enabled = false # equivalent to --only-cloud-sync
|
|
12
|
+
|
|
13
|
+
# Custom output directory for markdown files.
|
|
14
|
+
# Default: ./.specstory/history (relative to the project directory)
|
|
15
|
+
# output_dir = "~/.specstory/history" # equivalent to --output-dir "~/.specstory/history"
|
|
16
|
+
|
|
17
|
+
# Use local timezone for file name and content timestamps (default: false, UTC)
|
|
18
|
+
# local_time_zone = true # equivalent to --local-time-zone
|
|
19
|
+
|
|
20
|
+
[cloud_sync]
|
|
21
|
+
# Sync session data to SpecStory Cloud. (default: true, when logged in to SpecStory Cloud)
|
|
22
|
+
# enabled = false # equivalent to --no-cloud-sync
|
|
23
|
+
|
|
24
|
+
[logging]
|
|
25
|
+
# Write logs to .specstory/debug/debug.log (default: false)
|
|
26
|
+
# log = true # equivalent to --log
|
|
27
|
+
|
|
28
|
+
# Debug-level output, requires console or log (default: false)
|
|
29
|
+
# debug = true # equivalent to --debug
|
|
30
|
+
|
|
31
|
+
# Custom output directory for debug data.
|
|
32
|
+
# Default: ./.specstory/debug (relative to the project directory)
|
|
33
|
+
# debug_dir = "~/.specstory/debug" # equivalent to --debug-dir "~/.specstory/debug"
|
|
34
|
+
|
|
35
|
+
# Error/warn/info output to stdout (default: false)
|
|
36
|
+
# console = true # equivalent to --console
|
|
37
|
+
|
|
38
|
+
# Suppress all non-error output (default: false)
|
|
39
|
+
# silent = true # equivalent to --silent
|
|
40
|
+
|
|
41
|
+
[version_check]
|
|
42
|
+
# Check for new versions of the CLI on startup.
|
|
43
|
+
# Default: true
|
|
44
|
+
# enabled = false # equivalent to --no-version-check
|
|
45
|
+
|
|
46
|
+
[analytics]
|
|
47
|
+
# Send anonymous product usage analytics to help improve SpecStory.
|
|
48
|
+
# Default: true
|
|
49
|
+
# enabled = false # equivalent to --no-usage-analytics
|
|
50
|
+
|
|
51
|
+
[telemetry]
|
|
52
|
+
# OTLP gRPC collector endpoint (e.g., "localhost:4317" or "http://localhost:4317")
|
|
53
|
+
# endpoint = "localhost:4317"
|
|
54
|
+
|
|
55
|
+
# Override the default service name (default: "specstory-cli")
|
|
56
|
+
# service_name = "my-service-name"
|
|
57
|
+
|
|
58
|
+
# Include user prompt text in telemetry spans (default: true)
|
|
59
|
+
# prompts = false
|
|
60
|
+
|
|
61
|
+
[providers]
|
|
62
|
+
# Agent execution commands by provider (used by specstory run)
|
|
63
|
+
# Pass custom flags (e.g. claude_cmd = "claude --allow-dangerously-skip-permissions")
|
|
64
|
+
# Use of these is equivalent to -c "custom command"
|
|
65
|
+
|
|
66
|
+
# Claude Code command
|
|
67
|
+
# claude_cmd = "claude"
|
|
68
|
+
|
|
69
|
+
# Codex CLI command
|
|
70
|
+
# codex_cmd = "codex"
|
|
71
|
+
|
|
72
|
+
# Cursor CLI command
|
|
73
|
+
# cursor_cmd = "cursor-agent"
|
|
74
|
+
|
|
75
|
+
# Droid CLI command
|
|
76
|
+
# droid_cmd = "droid"
|
|
77
|
+
|
|
78
|
+
# Gemini CLI command
|
|
79
|
+
# gemini_cmd = "gemini"
|
|
80
|
+
|
|
81
|
+
# DeepSeek TUI command
|
|
82
|
+
# deepseek_cmd = "deepseek"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!-- Generated by SpecStory, Markdown v2.1.0 -->
|
|
2
|
+
|
|
3
|
+
# 2026-05-08 15:16:59Z
|
|
4
|
+
|
|
5
|
+
<!-- VS Code Copilot IDE Session 922bf8ba-7963-4797-8a44-61255bede17d (2026-05-08 15:16:59Z) -->
|
|
6
|
+
|
|
7
|
+
_**User (2026-05-08 15:16:59Z)**_
|
|
8
|
+
|
|
9
|
+
Implement the following features in `cordova-diagnostic-plugin/` and commit the changes for each feature with an appropriate commit message.
|
|
10
|
+
Then update `cordova-diagnostic-plugin-example/` to demonstrate/validate the new features and commit those changes as well.
|
|
11
|
+
|
|
12
|
+
# Device power mode
|
|
13
|
+
|
|
14
|
+
Add cross-platform plugin API methods to the core Diagnostic module to query and listen for changes in device power mode.
|
|
15
|
+
|
|
16
|
+
`Diagnostic.isLowPowerModeEnabled()` - Returns a boolean indicating whether the device is currently in low power mode.
|
|
17
|
+
`Diagnostic.onLowPowerModeChange(callback)` - Registers a callback function that will be called whenever the device's low power mode status changes. The callback receives a boolean parameter indicating the new low power mode status.
|
|
18
|
+
|
|
19
|
+
Files to modify:
|
|
20
|
+
- `www/android/diagnostic.js` (add the JS implementation for Android)
|
|
21
|
+
- `www/ios/diagnostic.js` (add the JS implementation for iOS)
|
|
22
|
+
- `cordova.plugins.diagnostic.d.ts` (add TypeScript definitions for the new methods)
|
|
23
|
+
- `README.md` (add documentation for the new methods)
|
|
24
|
+
- `src/android/Diagnostic.java` (add native implementation for Android)
|
|
25
|
+
- `src/ios/Diagnostic.m` and `src/ios/Diagnostic.h` (add native implementation for iOS)
|
|
26
|
+
|
|
27
|
+
iOS Implementation notes:
|
|
28
|
+
```swift
|
|
29
|
+
// Check current status
|
|
30
|
+
let isLowPowerEnabled = ProcessInfo.processInfo.isLowPowerModeEnabled
|
|
31
|
+
|
|
32
|
+
// Listen for changes
|
|
33
|
+
NotificationCenter.default.addObserver(
|
|
34
|
+
forName: .NSProcessInfoPowerStateDidChange,
|
|
35
|
+
object: nil,
|
|
36
|
+
queue: .main
|
|
37
|
+
) { _ in
|
|
38
|
+
let newValue = ProcessInfo.processInfo.isLowPowerModeEnabled
|
|
39
|
+
print("Low Power Mode is now \(newValue)")
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Android Implementation notes:
|
|
44
|
+
```kotlin
|
|
45
|
+
val powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
|
|
46
|
+
|
|
47
|
+
// Check current status
|
|
48
|
+
val isBatterySaverOn = powerManager.isPowerSaveMode
|
|
49
|
+
|
|
50
|
+
// Listen for changes (via BroadcastReceiver)
|
|
51
|
+
// Filter for Intent.ACTION_POWER_SAVE_MODE_CHANGED
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
# Android ignore battery optimization
|
|
55
|
+
|
|
56
|
+
Specifically for Android, only add:
|
|
57
|
+
|
|
58
|
+
`Diagnostic.isIgnoringBatteryOptimizations()` - Use `PowerManager.isIgnoringBatteryOptimizations()` to check if the app is currently ignoring battery optimizations.
|
|
59
|
+
`Diagnostic.requestIgnoreBatteryOptimizations()` - Use `Intent.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS` to prompt the user to allow the app to ignore battery optimizations. This will require the `REQUEST_IGNORE_BATTERY_OPTIMIZATIONS` permission in the Android manifest.
|
|
60
|
+
|
|
61
|
+
Update the appropriate files to include these methods and their documentation.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
_**Agent (copilot/gpt-5.4)**_
|
|
66
|
+
|
|
67
|
+
I’m locating the existing core Diagnostic API patterns and the closest Android/iOS permission or event implementations so I can mirror them with minimal surface change.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sessions": {
|
|
3
|
+
"922bf8ba-7963-4797-8a44-61255bede17d": {
|
|
4
|
+
"user_message_count": 1,
|
|
5
|
+
"agent_message_count": 1,
|
|
6
|
+
"start_timestamp": "2026-05-08T16:16:59+01:00",
|
|
7
|
+
"end_timestamp": "1970-01-01T01:00:00+01:00",
|
|
8
|
+
"markdown_size_bytes": 2928,
|
|
9
|
+
"provider": "copilotide",
|
|
10
|
+
"last_updated": "2026-06-25T11:53:59Z"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
**v7.3.1**
|
|
4
|
+
* (android) add explicit support for runtime permissions up to API 37
|
|
5
|
+
|
|
3
6
|
**v7.3.0**
|
|
4
7
|
* (ios & android) feat: add `isLowPowerModeEnabled()` and `onLowPowerModeChange()` to core module to check if low power mode is enabled on the device.
|
|
5
8
|
* (android) feat: add `isIgnoringBatteryOptimizations()` and `requestIgnoreBatteryOptimizations()` to core module to check if the app is ignoring battery optimizations and request to be added to the ignore list.
|
package/README.md
CHANGED
|
@@ -4231,6 +4231,7 @@ The plugin defines all [dangerous permissions](http://developer.android.com/guid
|
|
|
4231
4231
|
- `cordova.plugins.diagnostic.permission.ACCESS_BACKGROUND_LOCATION`
|
|
4232
4232
|
- `cordova.plugins.diagnostic.permission.ACCESS_COARSE_LOCATION`
|
|
4233
4233
|
- `cordova.plugins.diagnostic.permission.ACCESS_FINE_LOCATION`
|
|
4234
|
+
- `cordova.plugins.diagnostic.permission.ACCESS_LOCAL_NETWORK`
|
|
4234
4235
|
- `cordova.plugins.diagnostic.permission.ACCESS_MEDIA_LOCATION`
|
|
4235
4236
|
- `cordova.plugins.diagnostic.permission.ACTIVITY_RECOGNITION`
|
|
4236
4237
|
- `cordova.plugins.diagnostic.permission.ADD_VOICEMAIL`
|
|
@@ -4246,6 +4247,7 @@ The plugin defines all [dangerous permissions](http://developer.android.com/guid
|
|
|
4246
4247
|
- `cordova.plugins.diagnostic.permission.NEARBY_WIFI_DEVICES`
|
|
4247
4248
|
- `cordova.plugins.diagnostic.permission.POST_NOTIFICATIONS`
|
|
4248
4249
|
- `cordova.plugins.diagnostic.permission.PROCESS_OUTGOING_CALLS`
|
|
4250
|
+
- `cordova.plugins.diagnostic.permission.RANGING`
|
|
4249
4251
|
- `cordova.plugins.diagnostic.permission.READ_CALENDAR`
|
|
4250
4252
|
- `cordova.plugins.diagnostic.permission.READ_CALL_LOG`
|
|
4251
4253
|
- `cordova.plugins.diagnostic.permission.READ_CONTACTS`
|
|
@@ -4253,6 +4255,7 @@ The plugin defines all [dangerous permissions](http://developer.android.com/guid
|
|
|
4253
4255
|
- `cordova.plugins.diagnostic.permission.READ_MEDIA_AUDIO`
|
|
4254
4256
|
- `cordova.plugins.diagnostic.permission.READ_MEDIA_IMAGES`
|
|
4255
4257
|
- `cordova.plugins.diagnostic.permission.READ_MEDIA_VIDEO`
|
|
4258
|
+
- `cordova.plugins.diagnostic.permission.READ_MEDIA_VISUAL_USER_SELECTED`
|
|
4256
4259
|
- `cordova.plugins.diagnostic.permission.READ_PHONE_NUMBERS`
|
|
4257
4260
|
- `cordova.plugins.diagnostic.permission.READ_PHONE_STATE`
|
|
4258
4261
|
- `cordova.plugins.diagnostic.permission.READ_SMS`
|
|
@@ -21,6 +21,7 @@ interface Diagnostic {
|
|
|
21
21
|
"ACCESS_BACKGROUND_LOCATION": "ACCESS_BACKGROUND_LOCATION";
|
|
22
22
|
"ACCESS_COARSE_LOCATION": "ACCESS_COARSE_LOCATION";
|
|
23
23
|
"ACCESS_FINE_LOCATION": "ACCESS_FINE_LOCATION";
|
|
24
|
+
"ACCESS_LOCAL_NETWORK": "ACCESS_LOCAL_NETWORK";
|
|
24
25
|
"ACCESS_MEDIA_LOCATION": "ACCESS_MEDIA_LOCATION";
|
|
25
26
|
"ACTIVITY_RECOGNITION": "ACTIVITY_RECOGNITION";
|
|
26
27
|
"ADD_VOICEMAIL": "ADD_VOICEMAIL";
|
|
@@ -36,6 +37,7 @@ interface Diagnostic {
|
|
|
36
37
|
"NEARBY_WIFI_DEVICES": "NEARBY_WIFI_DEVICES";
|
|
37
38
|
"POST_NOTIFICATIONS": "POST_NOTIFICATIONS";
|
|
38
39
|
"PROCESS_OUTGOING_CALLS": "PROCESS_OUTGOING_CALLS";
|
|
40
|
+
"RANGING": "RANGING";
|
|
39
41
|
"READ_CALENDAR": "READ_CALENDAR";
|
|
40
42
|
"READ_CALL_LOG": "READ_CALL_LOG";
|
|
41
43
|
"READ_CONTACTS": "READ_CONTACTS";
|
|
@@ -43,6 +45,7 @@ interface Diagnostic {
|
|
|
43
45
|
"READ_MEDIA_AUDIO": "READ_MEDIA_AUDIO";
|
|
44
46
|
"READ_MEDIA_IMAGES": "READ_MEDIA_IMAGES";
|
|
45
47
|
"READ_MEDIA_VIDEO": "READ_MEDIA_VIDEO";
|
|
48
|
+
"READ_MEDIA_VISUAL_USER_SELECTED": "READ_MEDIA_VISUAL_USER_SELECTED";
|
|
46
49
|
"READ_PHONE_NUMBERS": "READ_PHONE_NUMBERS";
|
|
47
50
|
"READ_PHONE_STATE": "READ_PHONE_STATE";
|
|
48
51
|
"READ_SMS": "READ_SMS";
|
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
|
|
3
3
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
4
|
id="cordova.plugins.diagnostic"
|
|
5
|
-
version="7.3.
|
|
5
|
+
version="7.3.1">
|
|
6
6
|
|
|
7
7
|
<name>Diagnostic</name>
|
|
8
8
|
<description>Cordova/Phonegap plugin to check the state of Location/WiFi/Camera/Bluetooth device settings.</description>
|
|
@@ -149,6 +149,12 @@ public class Diagnostic extends CordovaPlugin{
|
|
|
149
149
|
// API 34+
|
|
150
150
|
Diagnostic.addBiDirMapEntry(_permissionsMap, "READ_MEDIA_VISUAL_USER_SELECTED", "android.permission.READ_MEDIA_VISUAL_USER_SELECTED");
|
|
151
151
|
|
|
152
|
+
// API 36+
|
|
153
|
+
Diagnostic.addBiDirMapEntry(_permissionsMap, "RANGING", "android.permission.RANGING");
|
|
154
|
+
|
|
155
|
+
// API 37+
|
|
156
|
+
Diagnostic.addBiDirMapEntry(_permissionsMap, "ACCESS_LOCAL_NETWORK", "android.permission.ACCESS_LOCAL_NETWORK");
|
|
157
|
+
|
|
152
158
|
permissionsMap = Collections.unmodifiableMap(_permissionsMap);
|
|
153
159
|
}
|
|
154
160
|
|
|
@@ -32,6 +32,7 @@ var Diagnostic = (function(){
|
|
|
32
32
|
"ACCESS_BACKGROUND_LOCATION": "ACCESS_BACKGROUND_LOCATION",
|
|
33
33
|
"ACCESS_COARSE_LOCATION": "ACCESS_COARSE_LOCATION",
|
|
34
34
|
"ACCESS_FINE_LOCATION": "ACCESS_FINE_LOCATION",
|
|
35
|
+
"ACCESS_LOCAL_NETWORK": "ACCESS_LOCAL_NETWORK",
|
|
35
36
|
"ACCESS_MEDIA_LOCATION": "ACCESS_MEDIA_LOCATION",
|
|
36
37
|
"ACTIVITY_RECOGNITION": "ACTIVITY_RECOGNITION",
|
|
37
38
|
"ADD_VOICEMAIL": "ADD_VOICEMAIL",
|
|
@@ -47,6 +48,7 @@ var Diagnostic = (function(){
|
|
|
47
48
|
"NEARBY_WIFI_DEVICES": "NEARBY_WIFI_DEVICES",
|
|
48
49
|
"POST_NOTIFICATIONS": "POST_NOTIFICATIONS",
|
|
49
50
|
"PROCESS_OUTGOING_CALLS": "PROCESS_OUTGOING_CALLS",
|
|
51
|
+
"RANGING": "RANGING",
|
|
50
52
|
"READ_CALENDAR": "READ_CALENDAR",
|
|
51
53
|
"READ_CALL_LOG": "READ_CALL_LOG",
|
|
52
54
|
"READ_CONTACTS": "READ_CONTACTS",
|
|
@@ -54,6 +56,7 @@ var Diagnostic = (function(){
|
|
|
54
56
|
"READ_MEDIA_AUDIO": "READ_MEDIA_AUDIO",
|
|
55
57
|
"READ_MEDIA_IMAGES": "READ_MEDIA_IMAGES",
|
|
56
58
|
"READ_MEDIA_VIDEO": "READ_MEDIA_VIDEO",
|
|
59
|
+
"READ_MEDIA_VISUAL_USER_SELECTED": "READ_MEDIA_VISUAL_USER_SELECTED",
|
|
57
60
|
"READ_PHONE_NUMBERS": "READ_PHONE_NUMBERS",
|
|
58
61
|
"READ_PHONE_STATE": "READ_PHONE_STATE",
|
|
59
62
|
"READ_SMS": "READ_SMS",
|