activity-driver 1.0.0__tar.gz
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.
- activity_driver-1.0.0/LICENSE +11 -0
- activity_driver-1.0.0/MANIFEST.in +5 -0
- activity_driver-1.0.0/PKG-INFO +315 -0
- activity_driver-1.0.0/README.md +275 -0
- activity_driver-1.0.0/pyproject.toml +69 -0
- activity_driver-1.0.0/requirements.txt +19 -0
- activity_driver-1.0.0/scripts/config.sh +145 -0
- activity_driver-1.0.0/scripts/setup.sh +254 -0
- activity_driver-1.0.0/scripts/start.sh +120 -0
- activity_driver-1.0.0/scripts/stop.sh +38 -0
- activity_driver-1.0.0/setup.cfg +4 -0
- activity_driver-1.0.0/setup.py +92 -0
- activity_driver-1.0.0/src/activity_driver/__init__.py +26 -0
- activity_driver-1.0.0/src/activity_driver/activity_driver.py +350 -0
- activity_driver-1.0.0/src/activity_driver/config.py +273 -0
- activity_driver-1.0.0/src/activity_driver/daily_report.py +193 -0
- activity_driver-1.0.0/src/activity_driver/hid_events.py +250 -0
- activity_driver-1.0.0/src/activity_driver/launcher.py +109 -0
- activity_driver-1.0.0/src/activity_driver.egg-info/PKG-INFO +315 -0
- activity_driver-1.0.0/src/activity_driver.egg-info/SOURCES.txt +23 -0
- activity_driver-1.0.0/src/activity_driver.egg-info/dependency_links.txt +1 -0
- activity_driver-1.0.0/src/activity_driver.egg-info/entry_points.txt +5 -0
- activity_driver-1.0.0/src/activity_driver.egg-info/not-zip-safe +1 -0
- activity_driver-1.0.0/src/activity_driver.egg-info/requires.txt +10 -0
- activity_driver-1.0.0/src/activity_driver.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
PROPRIETARY LICENSE
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Coty Engineering
|
|
4
|
+
|
|
5
|
+
This software is proprietary and confidential. All rights reserved.
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted to Coty employees and authorized contractors to use this software internally for business purposes only.
|
|
8
|
+
|
|
9
|
+
Redistribution, modification, or use outside of Coty Engineering is strictly prohibited without written consent from Coty Engineering management.
|
|
10
|
+
|
|
11
|
+
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: activity-driver
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Simulates realistic user activity for Prohance tracking on macOS
|
|
5
|
+
Home-page: https://github.com/coty/activity-driver
|
|
6
|
+
Author: Coty Engineering
|
|
7
|
+
Author-email: Coty Engineering <engineering@coty.com>
|
|
8
|
+
License: Proprietary
|
|
9
|
+
Project-URL: Homepage, https://github.com/coty/activity-driver
|
|
10
|
+
Project-URL: Documentation, https://github.com/coty/activity-driver#readme
|
|
11
|
+
Project-URL: Bug Reports, https://github.com/coty/activity-driver/issues
|
|
12
|
+
Project-URL: Repository, https://github.com/coty/activity-driver.git
|
|
13
|
+
Keywords: activity,driver,prohance,automation,macOS,productivity
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: System Administrators
|
|
17
|
+
Classifier: License :: Other/Proprietary License
|
|
18
|
+
Classifier: Operating System :: MacOS
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: System :: Monitoring
|
|
25
|
+
Classifier: Topic :: Utilities
|
|
26
|
+
Requires-Python: >=3.9
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: pyautogui>=0.9.54
|
|
30
|
+
Requires-Dist: pyobjc-framework-Quartz>=9.0; sys_platform == "darwin"
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-cov>=3.0; extra == "dev"
|
|
34
|
+
Requires-Dist: black>=22.0; extra == "dev"
|
|
35
|
+
Requires-Dist: flake8>=4.0; extra == "dev"
|
|
36
|
+
Dynamic: author
|
|
37
|
+
Dynamic: home-page
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
Dynamic: requires-python
|
|
40
|
+
|
|
41
|
+
# Activity Driver
|
|
42
|
+
|
|
43
|
+
Simulates realistic user activity (browser, file, HID mouse/keyboard events) for Prohance tracking on macOS. Prevents macOS idle sleep and auto-logout via `caffeinate`. Includes a live dashboard at **http://localhost:3006**.
|
|
44
|
+
|
|
45
|
+
## Overview
|
|
46
|
+
|
|
47
|
+
**Activity Driver** is a Python library designed to keep your Prohance tracking active by simulating realistic work activity. It includes:
|
|
48
|
+
|
|
49
|
+
- **Activity Driver** — Core event simulation engine (browser, file, HID events)
|
|
50
|
+
- **HID Events** — Real OS-level HID event generation via macOS Quartz
|
|
51
|
+
- **Daily Report** — Live HTML dashboard showing activity metrics
|
|
52
|
+
- **Launcher** — Orchestrates Activity Driver + Daily Report together
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
### System-Wide Install (Recommended)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install /path/to/activity-driver
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or install from GitHub:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install git+https://github.com/coty/activity-driver.git
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Development Install (editable)
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pip install -e /path/to/activity-driver
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Verify Installation
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
python -c "import activity_driver; print(activity_driver.__version__)"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Quick Start
|
|
85
|
+
|
|
86
|
+
### Run All Components (Driver + Dashboard)
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
activity-launcher
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This will:
|
|
93
|
+
1. Start the Activity Driver in the background
|
|
94
|
+
2. Start the Daily Report dashboard on http://localhost:3006
|
|
95
|
+
3. Auto-open your browser to the dashboard
|
|
96
|
+
|
|
97
|
+
**Stop with Ctrl-C**
|
|
98
|
+
|
|
99
|
+
### Run Individual Components
|
|
100
|
+
|
|
101
|
+
**Activity Driver only:**
|
|
102
|
+
```bash
|
|
103
|
+
activity-driver
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Daily Report only (on custom port):**
|
|
107
|
+
```bash
|
|
108
|
+
activity-report 8080
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**From Python:**
|
|
112
|
+
```python
|
|
113
|
+
from activity_driver.activity_driver import main
|
|
114
|
+
main()
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
During installation (`bash scripts/setup.sh`), you'll be asked for:
|
|
122
|
+
|
|
123
|
+
1. **Productive Domains** — URLs where you work (e.g., GitHub, Jira, Confluence)
|
|
124
|
+
2. **Chrome Profile** — Which Chrome profile to use (find at `chrome://version`)
|
|
125
|
+
|
|
126
|
+
Settings are saved to `~/.config/activity-driver/config.json` and automatically used by the driver.
|
|
127
|
+
|
|
128
|
+
### Manage Configuration Anytime
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
activity-config show # Display current config
|
|
132
|
+
activity-config domains # Edit productive URLs
|
|
133
|
+
activity-config profile # Change Chrome profile
|
|
134
|
+
activity-config reset # Reset to defaults
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
For detailed configuration guide: [CONFIG.md](CONFIG.md)
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Customization
|
|
142
|
+
|
|
143
|
+
## Permissions
|
|
144
|
+
|
|
145
|
+
### Accessibility (Optional)
|
|
146
|
+
|
|
147
|
+
For keyboard clicks to work, grant Accessibility permission:
|
|
148
|
+
|
|
149
|
+
1. **System Settings → Security & Privacy → Privacy → Accessibility**
|
|
150
|
+
2. Add your Python interpreter or terminal app
|
|
151
|
+
3. Restart the driver
|
|
152
|
+
|
|
153
|
+
**Without Accessibility:** Mouse movement and scroll events still work, which is sufficient for Prohance.
|
|
154
|
+
|
|
155
|
+
### Chrome Profile Access
|
|
156
|
+
|
|
157
|
+
The driver must be able to open Chrome. Ensure your profile is accessible in `/Users/$USER/Library/Application\ Support/Google/Chrome/`
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Dashboard Features
|
|
162
|
+
|
|
163
|
+
The live dashboard at `http://localhost:3006` shows:
|
|
164
|
+
|
|
165
|
+
- **Total events** — Total activity count for today/yesterday
|
|
166
|
+
- **Event breakdown** — Browser (unique/repeated), file writes, app switches
|
|
167
|
+
- **Top URLs** — Most frequently visited domains
|
|
168
|
+
- **Hourly activity** — Bar chart of events per hour
|
|
169
|
+
- **Active window** — First and last activity timestamps
|
|
170
|
+
- **Auto-purge** — Logs older than 2 days are automatically removed
|
|
171
|
+
|
|
172
|
+
Dashboard auto-refreshes every 30 seconds.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Technical Details
|
|
177
|
+
|
|
178
|
+
### HID Event Generation
|
|
179
|
+
|
|
180
|
+
Real OS-level events via macOS Quartz API:
|
|
181
|
+
|
|
182
|
+
| Event | Permission | Recognized by Prohance |
|
|
183
|
+
|-------|-----------|----------------------|
|
|
184
|
+
| Mouse move | ✅ NO Accessibility | ✅ Yes (resets HIDIdleTime) |
|
|
185
|
+
| Scroll wheel | ✅ NO Accessibility | ✅ Yes |
|
|
186
|
+
| Click | ⚠️ Accessibility required | ✅ Yes |
|
|
187
|
+
| Keyboard | ⚠️ Accessibility required | ✅ Yes |
|
|
188
|
+
|
|
189
|
+
Without Accessibility, mouse + scroll events are sufficient to reset Prohance idle timers.
|
|
190
|
+
|
|
191
|
+
### Idle Prevention
|
|
192
|
+
|
|
193
|
+
- **Heartbeat** — `caffeinate -u` runs every 25 seconds to assert user activity
|
|
194
|
+
- **Anti-idle** — Guaranteed lightweight event every 90 seconds during reads
|
|
195
|
+
- **No gaps** — Events spaced to ensure continuous activity detection
|
|
196
|
+
|
|
197
|
+
### Log Format
|
|
198
|
+
|
|
199
|
+
Events are stored in `.session_data` as JSON:
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"ts": "2026-06-18T14:23:45",
|
|
204
|
+
"date": "2026-06-18",
|
|
205
|
+
"hour": 14,
|
|
206
|
+
"type": "BROWSER",
|
|
207
|
+
"label": "repeated",
|
|
208
|
+
"detail": "https://coty-my.sharepoint.com/shared"
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Retention:** 2 days (auto-purged)
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Troubleshooting
|
|
217
|
+
|
|
218
|
+
### "WARNING: Quartz not available"
|
|
219
|
+
|
|
220
|
+
Install the required dependency:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
pip install pyobjc-framework-Quartz
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Dashboard not loading
|
|
227
|
+
|
|
228
|
+
Check the port isn't in use:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
lsof -i :3006
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Use a custom port:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
activity-report 8080
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Chrome not opening URLs
|
|
241
|
+
|
|
242
|
+
1. Verify Chrome is installed at `/Applications/Google Chrome.app`
|
|
243
|
+
2. Check your Chrome profile name at `chrome://version`
|
|
244
|
+
3. Update `CHROME_PROFILE` in the driver config
|
|
245
|
+
|
|
246
|
+
### Accessibility permission missing
|
|
247
|
+
|
|
248
|
+
Grant Accessibility permission in **System Settings → Security & Privacy → Privacy**
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Development
|
|
253
|
+
|
|
254
|
+
### Install for Development
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
pip install -e ".[dev]"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Run Tests
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
pytest -v
|
|
264
|
+
pytest --cov=src/activity_driver
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Code Style
|
|
268
|
+
|
|
269
|
+
Format with Black:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
black src/
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Lint with Flake8:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
flake8 src/
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Uninstall
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
pip uninstall activity-driver
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## License
|
|
292
|
+
|
|
293
|
+
Proprietary — Coty Engineering. All rights reserved.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Support
|
|
298
|
+
|
|
299
|
+
For issues, feature requests, or questions:
|
|
300
|
+
|
|
301
|
+
- **GitHub Issues:** https://github.com/coty/activity-driver/issues
|
|
302
|
+
- **Email:** engineering@coty.com
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Version History
|
|
307
|
+
|
|
308
|
+
### 1.0.0 (2026-06-18)
|
|
309
|
+
|
|
310
|
+
- Initial release
|
|
311
|
+
- Activity Driver core engine
|
|
312
|
+
- HID event generation (Quartz)
|
|
313
|
+
- Daily Report dashboard
|
|
314
|
+
- Launcher orchestrator
|
|
315
|
+
- macOS LaunchAgent support (via setup.sh)
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# Activity Driver
|
|
2
|
+
|
|
3
|
+
Simulates realistic user activity (browser, file, HID mouse/keyboard events) for Prohance tracking on macOS. Prevents macOS idle sleep and auto-logout via `caffeinate`. Includes a live dashboard at **http://localhost:3006**.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
**Activity Driver** is a Python library designed to keep your Prohance tracking active by simulating realistic work activity. It includes:
|
|
8
|
+
|
|
9
|
+
- **Activity Driver** — Core event simulation engine (browser, file, HID events)
|
|
10
|
+
- **HID Events** — Real OS-level HID event generation via macOS Quartz
|
|
11
|
+
- **Daily Report** — Live HTML dashboard showing activity metrics
|
|
12
|
+
- **Launcher** — Orchestrates Activity Driver + Daily Report together
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
### System-Wide Install (Recommended)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install /path/to/activity-driver
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or install from GitHub:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install git+https://github.com/coty/activity-driver.git
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Development Install (editable)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install -e /path/to/activity-driver
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Verify Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
python -c "import activity_driver; print(activity_driver.__version__)"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
### Run All Components (Driver + Dashboard)
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
activity-launcher
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This will:
|
|
53
|
+
1. Start the Activity Driver in the background
|
|
54
|
+
2. Start the Daily Report dashboard on http://localhost:3006
|
|
55
|
+
3. Auto-open your browser to the dashboard
|
|
56
|
+
|
|
57
|
+
**Stop with Ctrl-C**
|
|
58
|
+
|
|
59
|
+
### Run Individual Components
|
|
60
|
+
|
|
61
|
+
**Activity Driver only:**
|
|
62
|
+
```bash
|
|
63
|
+
activity-driver
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Daily Report only (on custom port):**
|
|
67
|
+
```bash
|
|
68
|
+
activity-report 8080
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**From Python:**
|
|
72
|
+
```python
|
|
73
|
+
from activity_driver.activity_driver import main
|
|
74
|
+
main()
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Configuration
|
|
80
|
+
|
|
81
|
+
During installation (`bash scripts/setup.sh`), you'll be asked for:
|
|
82
|
+
|
|
83
|
+
1. **Productive Domains** — URLs where you work (e.g., GitHub, Jira, Confluence)
|
|
84
|
+
2. **Chrome Profile** — Which Chrome profile to use (find at `chrome://version`)
|
|
85
|
+
|
|
86
|
+
Settings are saved to `~/.config/activity-driver/config.json` and automatically used by the driver.
|
|
87
|
+
|
|
88
|
+
### Manage Configuration Anytime
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
activity-config show # Display current config
|
|
92
|
+
activity-config domains # Edit productive URLs
|
|
93
|
+
activity-config profile # Change Chrome profile
|
|
94
|
+
activity-config reset # Reset to defaults
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
For detailed configuration guide: [CONFIG.md](CONFIG.md)
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Customization
|
|
102
|
+
|
|
103
|
+
## Permissions
|
|
104
|
+
|
|
105
|
+
### Accessibility (Optional)
|
|
106
|
+
|
|
107
|
+
For keyboard clicks to work, grant Accessibility permission:
|
|
108
|
+
|
|
109
|
+
1. **System Settings → Security & Privacy → Privacy → Accessibility**
|
|
110
|
+
2. Add your Python interpreter or terminal app
|
|
111
|
+
3. Restart the driver
|
|
112
|
+
|
|
113
|
+
**Without Accessibility:** Mouse movement and scroll events still work, which is sufficient for Prohance.
|
|
114
|
+
|
|
115
|
+
### Chrome Profile Access
|
|
116
|
+
|
|
117
|
+
The driver must be able to open Chrome. Ensure your profile is accessible in `/Users/$USER/Library/Application\ Support/Google/Chrome/`
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Dashboard Features
|
|
122
|
+
|
|
123
|
+
The live dashboard at `http://localhost:3006` shows:
|
|
124
|
+
|
|
125
|
+
- **Total events** — Total activity count for today/yesterday
|
|
126
|
+
- **Event breakdown** — Browser (unique/repeated), file writes, app switches
|
|
127
|
+
- **Top URLs** — Most frequently visited domains
|
|
128
|
+
- **Hourly activity** — Bar chart of events per hour
|
|
129
|
+
- **Active window** — First and last activity timestamps
|
|
130
|
+
- **Auto-purge** — Logs older than 2 days are automatically removed
|
|
131
|
+
|
|
132
|
+
Dashboard auto-refreshes every 30 seconds.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Technical Details
|
|
137
|
+
|
|
138
|
+
### HID Event Generation
|
|
139
|
+
|
|
140
|
+
Real OS-level events via macOS Quartz API:
|
|
141
|
+
|
|
142
|
+
| Event | Permission | Recognized by Prohance |
|
|
143
|
+
|-------|-----------|----------------------|
|
|
144
|
+
| Mouse move | ✅ NO Accessibility | ✅ Yes (resets HIDIdleTime) |
|
|
145
|
+
| Scroll wheel | ✅ NO Accessibility | ✅ Yes |
|
|
146
|
+
| Click | ⚠️ Accessibility required | ✅ Yes |
|
|
147
|
+
| Keyboard | ⚠️ Accessibility required | ✅ Yes |
|
|
148
|
+
|
|
149
|
+
Without Accessibility, mouse + scroll events are sufficient to reset Prohance idle timers.
|
|
150
|
+
|
|
151
|
+
### Idle Prevention
|
|
152
|
+
|
|
153
|
+
- **Heartbeat** — `caffeinate -u` runs every 25 seconds to assert user activity
|
|
154
|
+
- **Anti-idle** — Guaranteed lightweight event every 90 seconds during reads
|
|
155
|
+
- **No gaps** — Events spaced to ensure continuous activity detection
|
|
156
|
+
|
|
157
|
+
### Log Format
|
|
158
|
+
|
|
159
|
+
Events are stored in `.session_data` as JSON:
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"ts": "2026-06-18T14:23:45",
|
|
164
|
+
"date": "2026-06-18",
|
|
165
|
+
"hour": 14,
|
|
166
|
+
"type": "BROWSER",
|
|
167
|
+
"label": "repeated",
|
|
168
|
+
"detail": "https://coty-my.sharepoint.com/shared"
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Retention:** 2 days (auto-purged)
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Troubleshooting
|
|
177
|
+
|
|
178
|
+
### "WARNING: Quartz not available"
|
|
179
|
+
|
|
180
|
+
Install the required dependency:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
pip install pyobjc-framework-Quartz
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Dashboard not loading
|
|
187
|
+
|
|
188
|
+
Check the port isn't in use:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
lsof -i :3006
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Use a custom port:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
activity-report 8080
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Chrome not opening URLs
|
|
201
|
+
|
|
202
|
+
1. Verify Chrome is installed at `/Applications/Google Chrome.app`
|
|
203
|
+
2. Check your Chrome profile name at `chrome://version`
|
|
204
|
+
3. Update `CHROME_PROFILE` in the driver config
|
|
205
|
+
|
|
206
|
+
### Accessibility permission missing
|
|
207
|
+
|
|
208
|
+
Grant Accessibility permission in **System Settings → Security & Privacy → Privacy**
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Development
|
|
213
|
+
|
|
214
|
+
### Install for Development
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
pip install -e ".[dev]"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Run Tests
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
pytest -v
|
|
224
|
+
pytest --cov=src/activity_driver
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Code Style
|
|
228
|
+
|
|
229
|
+
Format with Black:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
black src/
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Lint with Flake8:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
flake8 src/
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Uninstall
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
pip uninstall activity-driver
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## License
|
|
252
|
+
|
|
253
|
+
Proprietary — Coty Engineering. All rights reserved.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Support
|
|
258
|
+
|
|
259
|
+
For issues, feature requests, or questions:
|
|
260
|
+
|
|
261
|
+
- **GitHub Issues:** https://github.com/coty/activity-driver/issues
|
|
262
|
+
- **Email:** engineering@coty.com
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Version History
|
|
267
|
+
|
|
268
|
+
### 1.0.0 (2026-06-18)
|
|
269
|
+
|
|
270
|
+
- Initial release
|
|
271
|
+
- Activity Driver core engine
|
|
272
|
+
- HID event generation (Quartz)
|
|
273
|
+
- Daily Report dashboard
|
|
274
|
+
- Launcher orchestrator
|
|
275
|
+
- macOS LaunchAgent support (via setup.sh)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "activity-driver"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Simulates realistic user activity for Prohance tracking on macOS"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = {text = "Proprietary"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Coty Engineering", email = "engineering@coty.com"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["activity", "driver", "prohance", "automation", "macOS", "productivity"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: System Administrators",
|
|
20
|
+
"License :: Other/Proprietary License",
|
|
21
|
+
"Operating System :: MacOS",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Topic :: System :: Monitoring",
|
|
28
|
+
"Topic :: Utilities",
|
|
29
|
+
]
|
|
30
|
+
dependencies = [
|
|
31
|
+
"pyautogui>=0.9.54",
|
|
32
|
+
"pyobjc-framework-Quartz>=9.0; sys_platform == 'darwin'",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
dev = [
|
|
37
|
+
"pytest>=7.0",
|
|
38
|
+
"pytest-cov>=3.0",
|
|
39
|
+
"black>=22.0",
|
|
40
|
+
"flake8>=4.0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/coty/activity-driver"
|
|
45
|
+
Documentation = "https://github.com/coty/activity-driver#readme"
|
|
46
|
+
"Bug Reports" = "https://github.com/coty/activity-driver/issues"
|
|
47
|
+
Repository = "https://github.com/coty/activity-driver.git"
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
activity-driver = "activity_driver.activity_driver:main"
|
|
51
|
+
activity-report = "activity_driver.daily_report:main"
|
|
52
|
+
activity-launcher = "activity_driver.launcher:main"
|
|
53
|
+
activity-config = "activity_driver.config:cli_main"
|
|
54
|
+
|
|
55
|
+
[tool.setuptools]
|
|
56
|
+
zip-safe = false
|
|
57
|
+
include-package-data = true
|
|
58
|
+
|
|
59
|
+
[tool.setuptools.packages.find]
|
|
60
|
+
where = ["src"]
|
|
61
|
+
|
|
62
|
+
[tool.black]
|
|
63
|
+
line-length = 100
|
|
64
|
+
target-version = ['py39', 'py310', 'py311', 'py312']
|
|
65
|
+
|
|
66
|
+
[tool.isort]
|
|
67
|
+
profile = "black"
|
|
68
|
+
line_length = 100
|
|
69
|
+
python_version = "39"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# ──────────────────────────────────────────────
|
|
2
|
+
# Prohance Activity Simulator — Dependencies
|
|
3
|
+
# Python >= 3.9
|
|
4
|
+
# ──────────────────────────────────────────────
|
|
5
|
+
|
|
6
|
+
# GUI automation (keyboard typing + mouse movement)
|
|
7
|
+
# Requires macOS Accessibility permission:
|
|
8
|
+
# System Preferences → Security & Privacy → Privacy → Accessibility
|
|
9
|
+
pyautogui>=0.9.54
|
|
10
|
+
|
|
11
|
+
# macOS native HID event generation (REAL user input, not synthetic)
|
|
12
|
+
# Generates actual OS-level keyboard/mouse events recognized by Prohance
|
|
13
|
+
pyobjc-framework-Quartz>=9.0; sys_platform == "darwin"
|
|
14
|
+
|
|
15
|
+
# Optional: structured logging (swap print() for richer output)
|
|
16
|
+
# loguru>=0.7.2
|
|
17
|
+
|
|
18
|
+
# Optional: rich terminal output / progress display
|
|
19
|
+
# rich>=13.0.0
|