MCPcopy Create free account
hub / github.com/IAmUnbounded/devctx / extractFromCursor

Function extractFromCursor

devctx/src/core/parser.ts:432–465  ·  view source on GitHub ↗
(
    _repoPath: string
)

Source from the content-addressed store, hash-verified

430// Cursor: ~/.cursor/ (basic search)
431// -------------------------------------------------------------------
432async function extractFromCursor(
433 _repoPath: string
434): Promise<ExtractedContext | null> {
435 const home = os.homedir();
436 const cursorDir = path.join(home, ".cursor");
437
438 if (!fs.existsSync(cursorDir)) return null;
439
440 // Cursor stores workspace state in various places
441 const workspaceStorage = path.join(cursorDir, "User", "workspaceStorage");
442 if (!fs.existsSync(workspaceStorage)) return null;
443
444 // Look for recent conversation state files
445 const workspaces = fs
446 .readdirSync(workspaceStorage)
447 .map((d) => ({
448 name: d,
449 path: path.join(workspaceStorage, d),
450 mtime: fs.statSync(path.join(workspaceStorage, d)).mtime.getTime(),
451 }))
452 .sort((a, b) => b.mtime - a.mtime)
453 .slice(0, 3);
454
455 for (const ws of workspaces) {
456 // Look for AI chat state
457 const chatDb = path.join(ws.path, "state.vscdb");
458 if (fs.existsSync(chatDb)) {
459 // SQLite — would need sqlite3 dependency, skip for now
460 return null;
461 }
462 }
463
464 return null;
465}
466
467// -------------------------------------------------------------------
468// Helpers

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected