How balaji1472/pro-hacks works
CopilotLens is a Windows background agent that measures M365 Copilot engagement without retaining prompt content or sending data over a network. Its workflow detects tracked-app focus, attaches UI Automation and input hooks to observe pane and prompt events, combines those with inactivity signals to accumulate per-user/app/day metrics, then periodically merges records into a local JSON file. The README documents DPI-aware hit testing and privacy safeguards; those are represented within UIA detection. Relationships follow the supplied README and source excerpts; unsampled implementation details are not inferred.
Main entry points: main.py Agent orchestration · session_tracker.py Session metrics · uia_detector.py Pane and prompt detection · win32_hook.py App focus hook
Components 8
Signal Detection
- Agent orchestration
main.py - App focus hook
win32_hook.py - Pane and prompt detection
uia_detector.py - Inactivity monitor
inactivity_monitor.py
Metric Tracking
- Session metrics
session_tracker.py
Local Output
- JSON merge emitter
emitter.py - Metrics JSON file
Other components
- Workstation user
Connections 14
- Workstation user → App focus hook: changes focus
readme.md - Workstation user → Pane and prompt detection: interacts with pane
readme.md - Workstation user → Inactivity monitor: provides input
readme.md - Agent orchestration → App focus hook: starts thread
main.py - Agent orchestration → Pane and prompt detection: starts thread
main.py - Agent orchestration → Session metrics: starts thread
main.py - Agent orchestration → Inactivity monitor: starts thread
main.py - App focus hook → Agent orchestration: queues focus events
readme.md - Agent orchestration → Pane and prompt detection: dispatches focus events
main.py - Agent orchestration → Session metrics: dispatches focus events
main.py - Pane and prompt detection → Session metrics: queues pane and prompt events
uia_detector.py - Inactivity monitor → Session metrics: queues activity events
inactivity_monitor.py - Session metrics → JSON merge emitter: flushes records
session_tracker.py - JSON merge emitter → Metrics JSON file: merges and writes
emitter.py