Skip to content

v0.4.0 - Enhanced Tracking & Public Profiles

Latest

Choose a tag to compare

@lcava000 lcava000 released this 30 Jan 00:04
· 0 commits to main since this release

DevMeter Extension v0.4.0

VS Code extension release with enhanced tracking capabilities and multi-editor support.

Installation

Download devmeter-0.4.0.vsix from Assets below:

  1. Open VS Code/Cursor/Windsurf
  2. Press Cmd/Ctrl+Shift+P
  3. Type Extensions: Install from VSIX...
  4. Select downloaded file

What's New in Extension Code

Multi-Source Activity Detection

  • FileSystemWatcher: Tracks file changes from terminal commands, external tools, and AI assistants
  • Terminal Tracking: Monitors shell/CLI work with 30-second pulse system
  • Smart Deduplication: 3-second window prevents double-counting editor vs external changes
  • Source Attribution: Distinguishes between editor typing, terminal commands, and external modifications

Multi-Editor Detection

Automatic identification of VS Code variants via vscode.env.appName:

  • VS Code, Cursor, Windsurf, code-server, VSCodium, Theia, Gitpod
  • Each editor properly attributed in statistics

Machine Tracking

  • Automatic hostname detection via os.hostname()
  • Fallback to environment variables (HOSTNAME, COMPUTERNAME)
  • Custom device naming via devmeter.deviceName setting
  • Machine identifier included in every heartbeat payload

New Commands

  • devmeter.syncNow - Force immediate heartbeat sync (bypasses rate limiting)
  • devmeter.checkStatus - Verify API endpoint connectivity

Enhanced Language Detection

  • Extension-to-language mapping for FileSystemWatcher events (40+ extensions)
  • Covers: TS/JS, Python, Rust, Go, Java, C/C++, shell scripts, config files
  • Fallback to VS Code language detection when available

Rate Limiting Improvements

  • Per-source rate limiting (editor, terminal, external tracked separately)
  • lastHeartbeatBySource map with 2-minute intervals
  • Saves always bypass rate limit
  • Processing guard prevents concurrent sends

Configuration Changes

{
  "devmeter.deviceName": "", // Custom machine label (default: hostname)
  "devmeter.apiUrl": "https://devmeter.codepro.it/api", // Updated default
}

Version Updates

  • Extension: 0.1.4 → 0.4.0
  • Min VS Code: 1.108.1 → 1.74.0 (broader compatibility)
  • Dependencies: Added @types/node@25.1.0 for Node.js APIs

Technical Changes

Code Metrics

  • +520 lines in extension.ts (tracking logic rewrite)
  • +19 lines in package.json (config, commands, deps)
  • Bundle size: 445.8 KB (esbuild optimized)

Key Functions Added

  • getEditorName() - Detect editor variant from appName
  • getMachineName() - Multi-strategy machine identification
  • getLanguageFromExtension() - Map file extensions to language IDs
  • sendExternalHeartbeat() - Handle FileSystemWatcher events
  • startTerminalPulse() / stopTerminalPulse() - Terminal monitoring
  • checkStatus() - API connectivity verification

Event Handlers

  • vscode.workspace.createFileSystemWatcher("**/*") - Monitor all file changes
  • vscode.window.onDidChangeActiveTerminal - Track terminal switches
  • FileSystemWatcher onDidChange and onDidCreate events
  • Proper cleanup in deactivate() function

Heartbeat Payload Extensions

{
  editor: string,   // "vscode" | "cursor" | "terminal" | "external" | ...
  machine: string,  // hostname or custom device name
  platform: string, // existing: "linux" | "darwin" | "win32"
}

Backend Compatibility

Requires DevMeter API with:

  • machine field support in /api/heartbeat (optional, backward compatible)
  • New endpoints for full feature set (username, public profiles, contribution graph)

Breaking Changes

None. Fully backward compatible with v0.1.4 API contracts.

Bug Fixes

  • Improved error handling for missing process detection commands
  • Graceful fallbacks for all detection mechanisms
  • Machine name detection doesn't crash on all methods failing
  • Language detection defaults to "unknown" vs throwing errors

Files Changed

  • extension/src/extension.ts (+520, -25 lines)
  • extension/package.json (+19, -5 lines)
  • extension/bun.lock (dependency updates)