Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/agentsview/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ func runServe(args []string) {
AgentDirs: cfg.AgentDirs,
Machine: "local",
BlockedResultCategories: cfg.ResultContentBlockedCategories,
CursorStateDB: cfg.CursorStateDB,
})

if database.NeedsResync() {
Expand Down
5 changes: 3 additions & 2 deletions cmd/agentsview/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ func runSync(args []string) {
cleanResyncTemp(appCfg.DBPath)

engine := sync.NewEngine(database, sync.EngineConfig{
AgentDirs: appCfg.AgentDirs,
Machine: "local",
AgentDirs: appCfg.AgentDirs,
Machine: "local",
CursorStateDB: appCfg.CursorStateDB,
})

ctx := context.Background()
Expand Down
24 changes: 19 additions & 5 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ type Config struct {
RemoteAccess bool `json:"remote_access"`
WriteTimeout time.Duration `json:"-"`

// CursorStateDB is the path to Cursor's global
// state.vscdb SQLite database used as primary source
// for tool calls and rich session metadata.
// Set CURSOR_STATE_DB to override. Default:
// ~/.config/Cursor/User/globalStorage/state.vscdb
CursorStateDB string `json:"-"`

// AgentDirs maps each AgentType to its configured
// directories. Single-dir agents store a one-element
// slice; unconfigured agents use nil.
Expand Down Expand Up @@ -130,11 +137,15 @@ func Default() (Config, error) {
}

return Config{
Host: "127.0.0.1",
Port: 8080,
DataDir: dataDir,
DBPath: filepath.Join(dataDir, "sessions.db"),
WriteTimeout: 30 * time.Second,
Host: "127.0.0.1",
Port: 8080,
DataDir: dataDir,
DBPath: filepath.Join(dataDir, "sessions.db"),
WriteTimeout: 30 * time.Second,
CursorStateDB: filepath.Join(
home,
".config/Cursor/User/globalStorage/state.vscdb",
),
AgentDirs: agentDirs,
agentDirSource: agentDirSource,
WatchExcludePatterns: []string{".git", "node_modules", "__pycache__", ".venv", "venv", "vendor", ".next"},
Expand Down Expand Up @@ -322,6 +333,9 @@ func (c *Config) loadEnv() {
if v := os.Getenv("AGENT_VIEWER_DATA_DIR"); v != "" {
c.DataDir = v
}
if v := os.Getenv("CURSOR_STATE_DB"); v != "" {
c.CursorStateDB = v
}
}

type stringListFlag []string
Expand Down
Loading