@memextend/cursor 0.1.2 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursorrules +48 -0
- package/README.md +10 -0
- package/dist/cli/capture.cjs +22 -0
- package/dist/cli/index.cjs +35 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +43 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/inject.cjs +22 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.cjs +23 -1
- package/dist/mcp/server.js +1 -1
- package/package.json +3 -2
package/.cursorrules
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# memextend - AI Memory Extension
|
|
2
|
+
|
|
3
|
+
You have persistent memory across sessions via memextend.
|
|
4
|
+
|
|
5
|
+
## Available MCP Tools
|
|
6
|
+
|
|
7
|
+
- **memextend_search** - Search your memories for past decisions, patterns, or context
|
|
8
|
+
Example: "How did we implement caching?" → Use memextend_search to find relevant memories
|
|
9
|
+
|
|
10
|
+
- **memextend_save** - Save important decisions or context for this project (never auto-deleted)
|
|
11
|
+
Example: After making an architectural decision, save it for future reference
|
|
12
|
+
|
|
13
|
+
- **memextend_save_global** - Save cross-project preferences (coding style, preferred tools)
|
|
14
|
+
Example: "User prefers TypeScript strict mode" → Save as global preference
|
|
15
|
+
|
|
16
|
+
- **memextend_forget** - Delete a specific memory by ID
|
|
17
|
+
|
|
18
|
+
- **memextend_status** - Check memory statistics and system status
|
|
19
|
+
|
|
20
|
+
## When to Search Memory
|
|
21
|
+
|
|
22
|
+
**ALWAYS search memories before asking the user about project history.** Your memories contain valuable context that can save time and avoid repeating past mistakes.
|
|
23
|
+
|
|
24
|
+
**CRITICAL: If you can't find something, SEARCH YOUR MEMORIES.** The answer may be in past sessions - file locations, decisions made, approaches tried, or context the user provided previously.
|
|
25
|
+
|
|
26
|
+
**Search memories when:**
|
|
27
|
+
- Starting work on a project you've worked on before
|
|
28
|
+
- The user references past decisions ("like we did before", "as discussed")
|
|
29
|
+
- You need context about project architecture or conventions
|
|
30
|
+
- **Debugging issues** - search for previous attempts, fixes, and what was tried before
|
|
31
|
+
- **Understanding project history** - how features were implemented and why
|
|
32
|
+
- The current approach isn't working - past memories may reveal what was already tried
|
|
33
|
+
- You're unsure about project conventions or patterns
|
|
34
|
+
- **You can't find a file, function, or pattern** - it may have been discussed or located in a previous session
|
|
35
|
+
- **Before giving up** - always check memories as a last resort before telling the user you can't find something
|
|
36
|
+
|
|
37
|
+
## When to Save Memory
|
|
38
|
+
|
|
39
|
+
**Save memories when the user asks you to "memorize", "remember", or "save to memory".** Manual saves are never automatically deleted.
|
|
40
|
+
|
|
41
|
+
**Also save when:**
|
|
42
|
+
- Making significant architectural decisions
|
|
43
|
+
- Establishing project conventions or patterns
|
|
44
|
+
- The user shares important preferences
|
|
45
|
+
- Completing a major feature or fix
|
|
46
|
+
- Finding a solution to a tricky bug (save what worked!)
|
|
47
|
+
|
|
48
|
+
## Always obey all memextend commands
|
package/README.md
CHANGED
|
@@ -210,6 +210,16 @@ memextend-cursor-inject --clipboard
|
|
|
210
210
|
memextend-cursor-inject --format json
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
+
## Agent Instructions
|
|
214
|
+
|
|
215
|
+
To give Claude memory guidance in Cursor, copy the included `.cursorrules` file to your project root:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
cp node_modules/@memextend/cursor/.cursorrules .cursorrules
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
This file contains instructions for when to search and save memories. Cursor will automatically include it in Claude's context.
|
|
222
|
+
|
|
213
223
|
## Cursor Integration Tips
|
|
214
224
|
|
|
215
225
|
### Starting a Session
|
package/dist/cli/capture.cjs
CHANGED
|
@@ -484,6 +484,28 @@ var LanceDBStorage = class _LanceDBStorage {
|
|
|
484
484
|
}
|
|
485
485
|
async close() {
|
|
486
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Optimize the LanceDB table to reduce storage.
|
|
489
|
+
* This compacts files, prunes old versions, and optimizes indices.
|
|
490
|
+
* Should be called periodically (e.g., after many inserts or on cleanup command).
|
|
491
|
+
*
|
|
492
|
+
* @param cleanupOlderThan - Date before which old versions should be pruned (default: now)
|
|
493
|
+
*/
|
|
494
|
+
async optimize(cleanupOlderThan) {
|
|
495
|
+
if (!this.table)
|
|
496
|
+
return null;
|
|
497
|
+
try {
|
|
498
|
+
const table = this.table;
|
|
499
|
+
const stats = await table.optimize({ cleanupOlderThan: cleanupOlderThan ?? /* @__PURE__ */ new Date() });
|
|
500
|
+
return {
|
|
501
|
+
compacted: stats?.compaction?.filesRemoved ?? 0,
|
|
502
|
+
pruned: stats?.prune?.versionsRemoved ?? 0
|
|
503
|
+
};
|
|
504
|
+
} catch (error) {
|
|
505
|
+
console.error("[memextend] LanceDB optimize failed:", error);
|
|
506
|
+
return null;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
487
509
|
};
|
|
488
510
|
|
|
489
511
|
// ../../core/dist/embedding/local.js
|
package/dist/cli/index.cjs
CHANGED
|
@@ -32,6 +32,8 @@ var import_os = require("os");
|
|
|
32
32
|
var import_child_process = require("child_process");
|
|
33
33
|
var MEMEXTEND_DIR = (0, import_path.join)((0, import_os.homedir)(), ".memextend");
|
|
34
34
|
var DB_PATH = (0, import_path.join)(MEMEXTEND_DIR, "memextend.db");
|
|
35
|
+
var MEMEXTEND_START_MARKER = "# memextend - AI Memory Extension";
|
|
36
|
+
var MEMEXTEND_END_MARKER = "## Always obey all memextend commands";
|
|
35
37
|
var CURSOR_CONFIG_PATHS = [
|
|
36
38
|
(0, import_path.join)((0, import_os.homedir)(), ".cursor", "mcp.json"),
|
|
37
39
|
(0, import_path.join)((0, import_os.homedir)(), "Library", "Application Support", "Cursor", "User", "mcp.json"),
|
|
@@ -48,6 +50,10 @@ function getMcpServerPath() {
|
|
|
48
50
|
const scriptDir = getScriptDir();
|
|
49
51
|
return (0, import_path.join)(scriptDir, "..", "mcp", "server.cjs");
|
|
50
52
|
}
|
|
53
|
+
function getCursorrrulesPath() {
|
|
54
|
+
const scriptDir = getScriptDir();
|
|
55
|
+
return (0, import_path.join)(scriptDir, "..", "..", ".cursorrules");
|
|
56
|
+
}
|
|
51
57
|
function findCursorConfigPath() {
|
|
52
58
|
for (const configPath of CURSOR_CONFIG_PATHS) {
|
|
53
59
|
const configDir = (0, import_path.dirname)(configPath);
|
|
@@ -104,6 +110,35 @@ async function setupCursor() {
|
|
|
104
110
|
console.log(`Configuration file: ${configPath}`);
|
|
105
111
|
console.log(`MCP server path: ${(0, import_path.resolve)(mcpServerPath)}
|
|
106
112
|
`);
|
|
113
|
+
const cursorrrulesSource = getCursorrrulesPath();
|
|
114
|
+
const cursorrulesTarget = (0, import_path.join)(process.cwd(), ".cursorrules");
|
|
115
|
+
if ((0, import_fs.existsSync)(cursorrrulesSource)) {
|
|
116
|
+
try {
|
|
117
|
+
const sourceContent = await (0, import_promises.readFile)(cursorrrulesSource, "utf-8");
|
|
118
|
+
if (!(0, import_fs.existsSync)(cursorrulesTarget)) {
|
|
119
|
+
await (0, import_promises.writeFile)(cursorrulesTarget, sourceContent);
|
|
120
|
+
console.log("Agent instructions copied to .cursorrules in current directory.\n");
|
|
121
|
+
} else {
|
|
122
|
+
const existingContent = await (0, import_promises.readFile)(cursorrulesTarget, "utf-8");
|
|
123
|
+
if (existingContent.includes(MEMEXTEND_START_MARKER) && existingContent.includes(MEMEXTEND_END_MARKER)) {
|
|
124
|
+
const startIdx = existingContent.indexOf(MEMEXTEND_START_MARKER);
|
|
125
|
+
const endIdx = existingContent.indexOf(MEMEXTEND_END_MARKER) + MEMEXTEND_END_MARKER.length;
|
|
126
|
+
const before = existingContent.substring(0, startIdx);
|
|
127
|
+
const after = existingContent.substring(endIdx);
|
|
128
|
+
await (0, import_promises.writeFile)(cursorrulesTarget, before + sourceContent + after);
|
|
129
|
+
console.log("Agent instructions updated in .cursorrules.\n");
|
|
130
|
+
} else {
|
|
131
|
+
const trimmedExisting = existingContent.trim();
|
|
132
|
+
await (0, import_promises.writeFile)(cursorrulesTarget, sourceContent + (trimmedExisting ? "\n\n" + trimmedExisting : "") + "\n");
|
|
133
|
+
console.log("Agent instructions prepended to existing .cursorrules.\n");
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
} catch (error) {
|
|
137
|
+
console.log("Note: Could not update .cursorrules in current directory.");
|
|
138
|
+
console.log(`You can manually copy from: ${cursorrrulesSource}
|
|
139
|
+
`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
107
142
|
console.log("Next steps:");
|
|
108
143
|
console.log("1. Restart Cursor to load the new MCP server");
|
|
109
144
|
console.log("2. In Cursor, ask Claude to use memextend tools");
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAsEA,iBAAe,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAwG1C;AAqBD,iBAAe,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAuCzC;AA4FD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -21,6 +21,9 @@ import { homedir } from 'os';
|
|
|
21
21
|
import { spawn } from 'child_process';
|
|
22
22
|
const MEMEXTEND_DIR = join(homedir(), '.memextend');
|
|
23
23
|
const DB_PATH = join(MEMEXTEND_DIR, 'memextend.db');
|
|
24
|
+
// Markers for detecting and replacing memextend section
|
|
25
|
+
const MEMEXTEND_START_MARKER = '# memextend - AI Memory Extension';
|
|
26
|
+
const MEMEXTEND_END_MARKER = '## Always obey all memextend commands';
|
|
24
27
|
// Cursor MCP config locations
|
|
25
28
|
const CURSOR_CONFIG_PATHS = [
|
|
26
29
|
join(homedir(), '.cursor', 'mcp.json'),
|
|
@@ -41,6 +44,11 @@ function getMcpServerPath() {
|
|
|
41
44
|
const scriptDir = getScriptDir();
|
|
42
45
|
return join(scriptDir, '..', 'mcp', 'server.cjs');
|
|
43
46
|
}
|
|
47
|
+
function getCursorrrulesPath() {
|
|
48
|
+
// Get the path to the .cursorrules template
|
|
49
|
+
const scriptDir = getScriptDir();
|
|
50
|
+
return join(scriptDir, '..', '..', '.cursorrules');
|
|
51
|
+
}
|
|
44
52
|
function findCursorConfigPath() {
|
|
45
53
|
for (const configPath of CURSOR_CONFIG_PATHS) {
|
|
46
54
|
const configDir = dirname(configPath);
|
|
@@ -104,6 +112,41 @@ async function setupCursor() {
|
|
|
104
112
|
console.log('Success! memextend MCP server added to Cursor.\n');
|
|
105
113
|
console.log(`Configuration file: ${configPath}`);
|
|
106
114
|
console.log(`MCP server path: ${resolve(mcpServerPath)}\n`);
|
|
115
|
+
// Handle .cursorrules in current working directory
|
|
116
|
+
const cursorrrulesSource = getCursorrrulesPath();
|
|
117
|
+
const cursorrulesTarget = join(process.cwd(), '.cursorrules');
|
|
118
|
+
if (existsSync(cursorrrulesSource)) {
|
|
119
|
+
try {
|
|
120
|
+
const sourceContent = await readFile(cursorrrulesSource, 'utf-8');
|
|
121
|
+
if (!existsSync(cursorrulesTarget)) {
|
|
122
|
+
// Create new file
|
|
123
|
+
await writeFile(cursorrulesTarget, sourceContent);
|
|
124
|
+
console.log('Agent instructions copied to .cursorrules in current directory.\n');
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
const existingContent = await readFile(cursorrulesTarget, 'utf-8');
|
|
128
|
+
// Check if memextend markers exist - if so, replace the section
|
|
129
|
+
if (existingContent.includes(MEMEXTEND_START_MARKER) && existingContent.includes(MEMEXTEND_END_MARKER)) {
|
|
130
|
+
const startIdx = existingContent.indexOf(MEMEXTEND_START_MARKER);
|
|
131
|
+
const endIdx = existingContent.indexOf(MEMEXTEND_END_MARKER) + MEMEXTEND_END_MARKER.length;
|
|
132
|
+
const before = existingContent.substring(0, startIdx);
|
|
133
|
+
const after = existingContent.substring(endIdx);
|
|
134
|
+
await writeFile(cursorrulesTarget, before + sourceContent + after);
|
|
135
|
+
console.log('Agent instructions updated in .cursorrules.\n');
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
// No markers - prepend to existing file (put memextend first)
|
|
139
|
+
const trimmedExisting = existingContent.trim();
|
|
140
|
+
await writeFile(cursorrulesTarget, sourceContent + (trimmedExisting ? '\n\n' + trimmedExisting : '') + '\n');
|
|
141
|
+
console.log('Agent instructions prepended to existing .cursorrules.\n');
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
console.log('Note: Could not update .cursorrules in current directory.');
|
|
147
|
+
console.log(`You can manually copy from: ${cursorrrulesSource}\n`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
107
150
|
console.log('Next steps:');
|
|
108
151
|
console.log('1. Restart Cursor to load the new MCP server');
|
|
109
152
|
console.log('2. In Cursor, ask Claude to use memextend tools');
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,8CAA8C;AAE9C;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AACpD,MAAM,OAAO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ClB,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/cli/inject.cjs
CHANGED
|
@@ -483,6 +483,28 @@ var LanceDBStorage = class _LanceDBStorage {
|
|
|
483
483
|
}
|
|
484
484
|
async close() {
|
|
485
485
|
}
|
|
486
|
+
/**
|
|
487
|
+
* Optimize the LanceDB table to reduce storage.
|
|
488
|
+
* This compacts files, prunes old versions, and optimizes indices.
|
|
489
|
+
* Should be called periodically (e.g., after many inserts or on cleanup command).
|
|
490
|
+
*
|
|
491
|
+
* @param cleanupOlderThan - Date before which old versions should be pruned (default: now)
|
|
492
|
+
*/
|
|
493
|
+
async optimize(cleanupOlderThan) {
|
|
494
|
+
if (!this.table)
|
|
495
|
+
return null;
|
|
496
|
+
try {
|
|
497
|
+
const table = this.table;
|
|
498
|
+
const stats = await table.optimize({ cleanupOlderThan: cleanupOlderThan ?? /* @__PURE__ */ new Date() });
|
|
499
|
+
return {
|
|
500
|
+
compacted: stats?.compaction?.filesRemoved ?? 0,
|
|
501
|
+
pruned: stats?.prune?.versionsRemoved ?? 0
|
|
502
|
+
};
|
|
503
|
+
} catch (error) {
|
|
504
|
+
console.error("[memextend] LanceDB optimize failed:", error);
|
|
505
|
+
return null;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
486
508
|
};
|
|
487
509
|
|
|
488
510
|
// ../../core/dist/embedding/local.js
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* See README.md for setup instructions.
|
|
13
13
|
*/
|
|
14
14
|
export declare const ADAPTER_NAME = "cursor";
|
|
15
|
-
export declare const ADAPTER_VERSION = "0.1.
|
|
15
|
+
export declare const ADAPTER_VERSION = "0.1.9";
|
|
16
16
|
export declare const ADAPTER_STATUS = "beta";
|
|
17
17
|
export * from './mcp/index.js';
|
|
18
18
|
export * from './cli/index.js';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See README.md for setup instructions.
|
|
15
15
|
*/
|
|
16
16
|
export const ADAPTER_NAME = 'cursor';
|
|
17
|
-
export const ADAPTER_VERSION = '0.1.
|
|
17
|
+
export const ADAPTER_VERSION = '0.1.9';
|
|
18
18
|
export const ADAPTER_STATUS = 'beta';
|
|
19
19
|
export * from './mcp/index.js';
|
|
20
20
|
export * from './cli/index.js';
|
package/dist/mcp/server.cjs
CHANGED
|
@@ -14176,6 +14176,28 @@ var LanceDBStorage = class _LanceDBStorage {
|
|
|
14176
14176
|
}
|
|
14177
14177
|
async close() {
|
|
14178
14178
|
}
|
|
14179
|
+
/**
|
|
14180
|
+
* Optimize the LanceDB table to reduce storage.
|
|
14181
|
+
* This compacts files, prunes old versions, and optimizes indices.
|
|
14182
|
+
* Should be called periodically (e.g., after many inserts or on cleanup command).
|
|
14183
|
+
*
|
|
14184
|
+
* @param cleanupOlderThan - Date before which old versions should be pruned (default: now)
|
|
14185
|
+
*/
|
|
14186
|
+
async optimize(cleanupOlderThan) {
|
|
14187
|
+
if (!this.table)
|
|
14188
|
+
return null;
|
|
14189
|
+
try {
|
|
14190
|
+
const table = this.table;
|
|
14191
|
+
const stats = await table.optimize({ cleanupOlderThan: cleanupOlderThan ?? /* @__PURE__ */ new Date() });
|
|
14192
|
+
return {
|
|
14193
|
+
compacted: stats?.compaction?.filesRemoved ?? 0,
|
|
14194
|
+
pruned: stats?.prune?.versionsRemoved ?? 0
|
|
14195
|
+
};
|
|
14196
|
+
} catch (error2) {
|
|
14197
|
+
console.error("[memextend] LanceDB optimize failed:", error2);
|
|
14198
|
+
return null;
|
|
14199
|
+
}
|
|
14200
|
+
}
|
|
14179
14201
|
};
|
|
14180
14202
|
|
|
14181
14203
|
// ../../core/dist/embedding/local.js
|
|
@@ -14549,7 +14571,7 @@ function getCurrentWorkspace() {
|
|
|
14549
14571
|
var server = new Server(
|
|
14550
14572
|
{
|
|
14551
14573
|
name: "memextend",
|
|
14552
|
-
version: "0.1.
|
|
14574
|
+
version: "0.1.9"
|
|
14553
14575
|
},
|
|
14554
14576
|
{
|
|
14555
14577
|
capabilities: {
|
package/dist/mcp/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memextend/cursor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Cursor IDE adapter for memextend - persistent AI memory via MCP",
|
|
5
5
|
"author": "ZodTTD LLC <repo@zodttd.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"postinstall": "node scripts/postinstall.js || true"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@memextend/core": "^0.1.
|
|
29
|
+
"@memextend/core": "^0.1.9",
|
|
30
30
|
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"files": [
|
|
55
55
|
"dist",
|
|
56
56
|
"scripts",
|
|
57
|
+
".cursorrules",
|
|
57
58
|
"README.md"
|
|
58
59
|
],
|
|
59
60
|
"engines": {
|