This is great, I’ve been working non-stop to figure out how to best wrangle my agents…
currently building out my own composer logger to Postgres… It was working well, then broke, worked, broke, scope_creep, works, breaks, scop_creep, SHINY_OBJECT_FEATURE, breaks… Rinse Repeat…
But I am really learning a lot about how to manipulate Cursor environment.
I use this method a lot - for context hand_off from agent to agent:
Cursor Timeline Manager - Development Handoff
Project Overview
The Cursor Timeline Manager is a PowerShell-based tool for managing and visualizing Cursor IDE’s history data. It connects to both SQLite (local storage) and PostgreSQL (remote storage) databases.
Current State
Working Features
-
Basic UI framework with:
- Persistent status header showing database connections
- Menu-based navigation
- Timeline view with filtering options
- Search interface (placeholder)
- Data management options
- Log viewer
-
Test data implementation showing:
- Chat entries (
)
- Editor entries (
)
- Basic filtering by time and type
- Chat entries (
Known Issues
-
Critical: SQLite data reading not working
- Database found at:
%APPDATA%/Cursor/User/workspaceStorage/*/state.vscdb
- Table name is
ItemTable
with schema:key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB
- Current error: Cannot handle binary data format
- Values are stored as byte arrays, not strings
- Database found at:
-
Pending: PostgreSQL integration
- Basic configuration structure in place
- Connection testing implemented
- Actual data migration not yet implemented
Technical Details
Database Structure
-
SQLite:
CREATE TABLE ItemTable ( key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB );
- Keys follow patterns:
- Chat:
chat.*
- Editor:
workbench.*
- Chat:
- Values are binary BLOB data containing JSON
- Keys follow patterns:
-
PostgreSQL (Planned):
CREATE TABLE cursor_history ( id SERIAL PRIMARY KEY, type TEXT NOT NULL, timestamp TIMESTAMP NOT NULL, key TEXT NOT NULL, value JSONB NOT NULL );
Core Files
-
src/core/Initialize-Environment.ps1
:- Environment setup
- Database connection management
- Configuration loading
-
src/core/Get-CursorHistory.ps1
:- Currently using test data
- Needs update to handle binary SQLite data
- Implements filtering and data processing
-
src/ui/Show-Dashboard.ps1
:- Main UI implementation
- Status header
- Menu system
- Timeline view
Next Steps
-
Fix SQLite data reading:
- Update
Get-CursorHistory
to properly handle BLOB data - Implement proper UTF-8 decoding
- Add error handling for malformed data
- Update
-
Implement data migration:
- Add schema validation
- Implement incremental updates
- Add conflict resolution
-
Add real-time updates:
- Monitor SQLite for changes
- Implement refresh mechanism
- Add notification system
Environment Setup
-
Required PowerShell modules:
- PSSQLite (>= 1.1.0)
- Npgsql (for PostgreSQL)
-
Environment variables:
DB_HOST=localhost DB_PORT=5432 DB_NAME=cursor DB_SCHEMA=public DB_USER=cursor DB_PASS=your_password
Testing Notes
-
Current test data structure:
[PSCustomObject]@{ Type = 'chat'|'editor' Timestamp = Get-Date Key = 'chat.history'|'workbench.editor' Value = 'Test message' Data = $null }
-
SQLite test query:
SELECT key, value FROM ItemTable WHERE key LIKE 'chat%' OR key LIKE 'workbench%' ORDER BY key DESC;
Known Limitations
- SQLite binary data handling
- No real-time updates
- Limited error recovery
- Missing data validation
- No data compression
- Limited search capabilities
Future Enhancements
- Real-time monitoring
- Advanced search
- Data compression
- Backup management
- Performance optimization
- Multi-workspace support
Contact
- Project maintainer: Current agent
- Last update: January 5, 2024
- Status: In development