@memextend/cursor 0.1.9 → 0.3.0
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/dist/cli/capture.cjs +128 -76
- package/dist/cli/capture.js +4 -4
- package/dist/cli/capture.js.map +1 -1
- package/dist/cli/index.cjs +68 -28
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +73 -33
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/inject.cjs +133 -81
- package/dist/cli/inject.js +4 -4
- package/dist/cli/inject.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.cjs +142 -90
- package/dist/mcp/server.js +13 -13
- package/dist/mcp/server.js.map +1 -1
- package/package.json +2 -3
- package/scripts/build-cli.js +1 -1
- package/scripts/build-mcp.js +1 -1
- package/.cursorrules +0 -48
package/dist/cli/capture.cjs
CHANGED
|
@@ -395,116 +395,168 @@ var SQLiteStorage = class {
|
|
|
395
395
|
}
|
|
396
396
|
};
|
|
397
397
|
|
|
398
|
-
// ../../core/dist/storage/
|
|
399
|
-
var
|
|
400
|
-
|
|
398
|
+
// ../../core/dist/storage/sqlite-vec.js
|
|
399
|
+
var import_better_sqlite32 = __toESM(require("better-sqlite3"), 1);
|
|
400
|
+
|
|
401
|
+
// ../../../node_modules/sqlite-vec/index.mjs
|
|
402
|
+
var import_node_path = require("node:path");
|
|
403
|
+
var import_node_url = require("node:url");
|
|
404
|
+
var import_node_process = require("node:process");
|
|
405
|
+
var import_node_fs = require("node:fs");
|
|
406
|
+
var import_meta = {};
|
|
407
|
+
var BASE_PACKAGE_NAME = "sqlite-vec";
|
|
408
|
+
var ENTRYPOINT_BASE_NAME = "vec0";
|
|
409
|
+
var supportedPlatforms = [["macos", "aarch64"], ["macos", "x86_64"], ["windows", "x86_64"], ["linux", "x86_64"], ["linux", "aarch64"]];
|
|
410
|
+
var invalidPlatformErrorMessage = `Unsupported platform for ${BASE_PACKAGE_NAME}, on a ${import_node_process.platform}-${import_node_process.arch} machine. Supported platforms are (${supportedPlatforms.map(([p, a]) => `${p}-${a}`).join(",")}). Consult the ${BASE_PACKAGE_NAME} NPM package README for details.`;
|
|
411
|
+
var extensionNotFoundErrorMessage = (packageName) => `Loadble extension for ${BASE_PACKAGE_NAME} not found. Was the ${packageName} package installed?`;
|
|
412
|
+
function validPlatform(platform2, arch2) {
|
|
413
|
+
return supportedPlatforms.find(([p, a]) => platform2 == p && arch2 === a) !== null;
|
|
414
|
+
}
|
|
415
|
+
function extensionSuffix(platform2) {
|
|
416
|
+
if (platform2 === "win32")
|
|
417
|
+
return "dll";
|
|
418
|
+
if (platform2 === "darwin")
|
|
419
|
+
return "dylib";
|
|
420
|
+
return "so";
|
|
421
|
+
}
|
|
422
|
+
function platformPackageName(platform2, arch2) {
|
|
423
|
+
const os = platform2 === "win32" ? "windows" : platform2;
|
|
424
|
+
return `${BASE_PACKAGE_NAME}-${os}-${arch2}`;
|
|
425
|
+
}
|
|
426
|
+
function getLoadablePath() {
|
|
427
|
+
if (!validPlatform(import_node_process.platform, import_node_process.arch)) {
|
|
428
|
+
throw new Error(
|
|
429
|
+
invalidPlatformErrorMessage
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
const packageName = platformPackageName(import_node_process.platform, import_node_process.arch);
|
|
433
|
+
const loadablePath = (0, import_node_path.join)(
|
|
434
|
+
(0, import_node_url.fileURLToPath)(new URL((0, import_node_path.join)("."), import_meta.url)),
|
|
435
|
+
"..",
|
|
436
|
+
packageName,
|
|
437
|
+
`${ENTRYPOINT_BASE_NAME}.${extensionSuffix(import_node_process.platform)}`
|
|
438
|
+
);
|
|
439
|
+
if (!(0, import_node_fs.statSync)(loadablePath, { throwIfNoEntry: false })) {
|
|
440
|
+
throw new Error(extensionNotFoundErrorMessage(packageName));
|
|
441
|
+
}
|
|
442
|
+
return loadablePath;
|
|
443
|
+
}
|
|
444
|
+
function load(db) {
|
|
445
|
+
db.loadExtension(getLoadablePath());
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// ../../core/dist/storage/sqlite-vec.js
|
|
449
|
+
var SQLiteVecStorage = class _SQLiteVecStorage {
|
|
401
450
|
db;
|
|
402
|
-
|
|
403
|
-
tableName = "memories";
|
|
451
|
+
tableName = "memory_vectors";
|
|
404
452
|
dimensions = 384;
|
|
405
453
|
constructor(db) {
|
|
406
454
|
this.db = db;
|
|
407
455
|
}
|
|
408
456
|
static async create(dbPath) {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
457
|
+
let actualPath = dbPath;
|
|
458
|
+
if (dbPath.endsWith("vectors") || dbPath.endsWith("vectors/")) {
|
|
459
|
+
actualPath = dbPath.replace(/\/?$/, ".db");
|
|
460
|
+
}
|
|
461
|
+
const db = new import_better_sqlite32.default(actualPath);
|
|
462
|
+
load(db);
|
|
463
|
+
const storage = new _SQLiteVecStorage(db);
|
|
464
|
+
storage.initialize();
|
|
412
465
|
return storage;
|
|
413
466
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
467
|
+
initialize() {
|
|
468
|
+
this.db.exec(`
|
|
469
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS ${this.tableName} USING vec0(
|
|
470
|
+
id TEXT PRIMARY KEY,
|
|
471
|
+
vector FLOAT[${this.dimensions}]
|
|
472
|
+
)
|
|
473
|
+
`);
|
|
419
474
|
}
|
|
420
475
|
async insertVector(id, vector) {
|
|
421
476
|
if (vector.length !== this.dimensions) {
|
|
422
477
|
throw new Error(`Vector must have ${this.dimensions} dimensions, got ${vector.length}`);
|
|
423
478
|
}
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
479
|
+
const float32 = new Float32Array(vector);
|
|
480
|
+
const vectorBuffer = Buffer.from(float32.buffer);
|
|
481
|
+
const stmt = this.db.prepare(`
|
|
482
|
+
INSERT OR REPLACE INTO ${this.tableName} (id, vector)
|
|
483
|
+
VALUES (?, ?)
|
|
484
|
+
`);
|
|
485
|
+
stmt.run(id, vectorBuffer);
|
|
430
486
|
}
|
|
431
487
|
async insertVectors(items) {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
488
|
+
const stmt = this.db.prepare(`
|
|
489
|
+
INSERT OR REPLACE INTO ${this.tableName} (id, vector)
|
|
490
|
+
VALUES (?, ?)
|
|
491
|
+
`);
|
|
492
|
+
const insertMany = this.db.transaction((items2) => {
|
|
493
|
+
for (const item of items2) {
|
|
494
|
+
if (item.vector.length !== this.dimensions) {
|
|
495
|
+
throw new Error(`Vector must have ${this.dimensions} dimensions, got ${item.vector.length}`);
|
|
496
|
+
}
|
|
497
|
+
const float32 = new Float32Array(item.vector);
|
|
498
|
+
const vectorBuffer = Buffer.from(float32.buffer);
|
|
499
|
+
stmt.run(item.id, vectorBuffer);
|
|
435
500
|
}
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
this.table = await this.db.createTable(this.tableName, items);
|
|
439
|
-
} else {
|
|
440
|
-
await this.table.add(items);
|
|
441
|
-
}
|
|
501
|
+
});
|
|
502
|
+
insertMany(items);
|
|
442
503
|
}
|
|
443
504
|
async search(vector, limit = 10) {
|
|
444
|
-
if (
|
|
445
|
-
|
|
505
|
+
if (vector.length !== this.dimensions) {
|
|
506
|
+
throw new Error(`Query vector must have ${this.dimensions} dimensions, got ${vector.length}`);
|
|
446
507
|
}
|
|
447
508
|
const effectiveLimit = limit > 0 ? limit : 100;
|
|
448
|
-
const
|
|
449
|
-
|
|
509
|
+
const float32 = new Float32Array(vector);
|
|
510
|
+
const vectorBuffer = Buffer.from(float32.buffer);
|
|
511
|
+
const stmt = this.db.prepare(`
|
|
512
|
+
SELECT id, distance
|
|
513
|
+
FROM ${this.tableName}
|
|
514
|
+
WHERE vector MATCH ?
|
|
515
|
+
ORDER BY distance
|
|
516
|
+
LIMIT ?
|
|
517
|
+
`);
|
|
518
|
+
const rows = stmt.all(vectorBuffer, effectiveLimit);
|
|
519
|
+
return rows.map((row) => ({
|
|
450
520
|
id: row.id,
|
|
451
|
-
score: 1
|
|
452
|
-
// Convert distance to similarity
|
|
521
|
+
score: 1 / (1 + row.distance)
|
|
453
522
|
}));
|
|
454
523
|
}
|
|
455
524
|
async deleteVector(id) {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
const sanitizedId = id.replace(/'/g, "''");
|
|
459
|
-
await this.table.delete(`id = '${sanitizedId}'`);
|
|
525
|
+
const stmt = this.db.prepare(`DELETE FROM ${this.tableName} WHERE id = ?`);
|
|
526
|
+
stmt.run(id);
|
|
460
527
|
}
|
|
461
528
|
async getVectorCount() {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
return
|
|
529
|
+
const stmt = this.db.prepare(`SELECT COUNT(*) as count FROM ${this.tableName}`);
|
|
530
|
+
const result = stmt.get();
|
|
531
|
+
return result.count;
|
|
465
532
|
}
|
|
466
533
|
async getVectorsByIds(ids) {
|
|
467
534
|
const result = /* @__PURE__ */ new Map();
|
|
468
|
-
if (
|
|
535
|
+
if (ids.length === 0)
|
|
469
536
|
return result;
|
|
470
537
|
const BATCH_SIZE = 100;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
538
|
+
for (let i = 0; i < ids.length; i += BATCH_SIZE) {
|
|
539
|
+
const batch = ids.slice(i, i + BATCH_SIZE);
|
|
540
|
+
const placeholders = batch.map(() => "?").join(",");
|
|
541
|
+
const stmt = this.db.prepare(`
|
|
542
|
+
SELECT id, vector FROM ${this.tableName}
|
|
543
|
+
WHERE id IN (${placeholders})
|
|
544
|
+
`);
|
|
545
|
+
const rows = stmt.all(...batch);
|
|
546
|
+
for (const row of rows) {
|
|
547
|
+
const vector = Array.from(new Float32Array(row.vector));
|
|
548
|
+
result.set(row.id, vector);
|
|
480
549
|
}
|
|
481
|
-
} catch {
|
|
482
550
|
}
|
|
483
551
|
return result;
|
|
484
552
|
}
|
|
485
553
|
async close() {
|
|
554
|
+
this.db.close();
|
|
486
555
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
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
|
-
}
|
|
556
|
+
// No optimize needed - SQLite handles this automatically!
|
|
557
|
+
async optimize() {
|
|
558
|
+
this.db.exec("VACUUM");
|
|
559
|
+
return { compacted: 0, pruned: 0 };
|
|
508
560
|
}
|
|
509
561
|
};
|
|
510
562
|
|
|
@@ -778,7 +830,7 @@ async function main() {
|
|
|
778
830
|
const workspace = options.workspace ? (0, import_path2.resolve)(options.workspace) : process.cwd();
|
|
779
831
|
const projectId = getProjectId2(workspace);
|
|
780
832
|
const sqlite = new SQLiteStorage(DB_PATH);
|
|
781
|
-
const
|
|
833
|
+
const vectorStore = await SQLiteVecStorage.create(VECTORS_PATH);
|
|
782
834
|
const embedder = await createEmbedFunction(MODELS_PATH);
|
|
783
835
|
try {
|
|
784
836
|
const project = sqlite.getProject(projectId);
|
|
@@ -803,7 +855,7 @@ async function main() {
|
|
|
803
855
|
};
|
|
804
856
|
sqlite.insertMemory(memory);
|
|
805
857
|
const vector = await embedder.embed(content);
|
|
806
|
-
await
|
|
858
|
+
await vectorStore.insertVector(memoryId, vector);
|
|
807
859
|
if (!options.quiet) {
|
|
808
860
|
console.log(`Memory captured successfully!`);
|
|
809
861
|
console.log(` ID: ${memoryId}`);
|
|
@@ -813,7 +865,7 @@ async function main() {
|
|
|
813
865
|
}
|
|
814
866
|
} finally {
|
|
815
867
|
sqlite.close();
|
|
816
|
-
await
|
|
868
|
+
await vectorStore.close();
|
|
817
869
|
await embedder.close();
|
|
818
870
|
}
|
|
819
871
|
}
|
package/dist/cli/capture.js
CHANGED
|
@@ -21,7 +21,7 @@ import { readFile } from 'fs/promises';
|
|
|
21
21
|
import { join, basename, resolve } from 'path';
|
|
22
22
|
import { homedir } from 'os';
|
|
23
23
|
import { execSync } from 'child_process';
|
|
24
|
-
import { SQLiteStorage,
|
|
24
|
+
import { SQLiteStorage, SQLiteVecStorage, createEmbedFunction } from '@memextend/core';
|
|
25
25
|
const MEMEXTEND_DIR = join(homedir(), '.memextend');
|
|
26
26
|
const DB_PATH = join(MEMEXTEND_DIR, 'memextend.db');
|
|
27
27
|
const VECTORS_PATH = join(MEMEXTEND_DIR, 'vectors');
|
|
@@ -170,7 +170,7 @@ async function main() {
|
|
|
170
170
|
const projectId = getProjectId(workspace);
|
|
171
171
|
// Initialize storage
|
|
172
172
|
const sqlite = new SQLiteStorage(DB_PATH);
|
|
173
|
-
const
|
|
173
|
+
const vectorStore = await SQLiteVecStorage.create(VECTORS_PATH);
|
|
174
174
|
const embedder = await createEmbedFunction(MODELS_PATH);
|
|
175
175
|
try {
|
|
176
176
|
// Ensure project is registered
|
|
@@ -199,7 +199,7 @@ async function main() {
|
|
|
199
199
|
sqlite.insertMemory(memory);
|
|
200
200
|
// Generate and store embedding
|
|
201
201
|
const vector = await embedder.embed(content);
|
|
202
|
-
await
|
|
202
|
+
await vectorStore.insertVector(memoryId, vector);
|
|
203
203
|
if (!options.quiet) {
|
|
204
204
|
console.log(`Memory captured successfully!`);
|
|
205
205
|
console.log(` ID: ${memoryId}`);
|
|
@@ -211,7 +211,7 @@ async function main() {
|
|
|
211
211
|
finally {
|
|
212
212
|
// Cleanup
|
|
213
213
|
sqlite.close();
|
|
214
|
-
await
|
|
214
|
+
await vectorStore.close();
|
|
215
215
|
await embedder.close();
|
|
216
216
|
}
|
|
217
217
|
}
|
package/dist/cli/capture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/cli/capture.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,8CAA8C;AAE9C;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EACL,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/cli/capture.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,8CAA8C;AAE9C;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,mBA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,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/cli/index.cjs
CHANGED
|
@@ -34,6 +34,55 @@ 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
35
|
var MEMEXTEND_START_MARKER = "# memextend - AI Memory Extension";
|
|
36
36
|
var MEMEXTEND_END_MARKER = "## Always obey all memextend commands";
|
|
37
|
+
var CURSORRULES_TEMPLATE = `${MEMEXTEND_START_MARKER}
|
|
38
|
+
|
|
39
|
+
You have persistent memory across sessions via memextend.
|
|
40
|
+
|
|
41
|
+
## Available MCP Tools
|
|
42
|
+
|
|
43
|
+
- **memextend_search** - Search your memories for past decisions, patterns, or context
|
|
44
|
+
Example: "How did we implement caching?" \u2192 Use memextend_search to find relevant memories
|
|
45
|
+
|
|
46
|
+
- **memextend_save** - Save important decisions or context for this project (never auto-deleted)
|
|
47
|
+
Example: After making an architectural decision, save it for future reference
|
|
48
|
+
|
|
49
|
+
- **memextend_save_global** - Save cross-project preferences (coding style, preferred tools)
|
|
50
|
+
Example: "User prefers TypeScript strict mode" \u2192 Save as global preference
|
|
51
|
+
|
|
52
|
+
- **memextend_forget** - Delete a specific memory by ID
|
|
53
|
+
|
|
54
|
+
- **memextend_status** - Check memory statistics and system status
|
|
55
|
+
|
|
56
|
+
## When to Search Memory
|
|
57
|
+
|
|
58
|
+
**ALWAYS search memories before asking the user about project history.** Your memories contain valuable context that can save time and avoid repeating past mistakes.
|
|
59
|
+
|
|
60
|
+
**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.
|
|
61
|
+
|
|
62
|
+
**Search memories when:**
|
|
63
|
+
- Starting work on a project you've worked on before
|
|
64
|
+
- The user references past decisions ("like we did before", "as discussed")
|
|
65
|
+
- You need context about project architecture or conventions
|
|
66
|
+
- **Debugging issues** - search for previous attempts, fixes, and what was tried before
|
|
67
|
+
- **Understanding project history** - how features were implemented and why
|
|
68
|
+
- The current approach isn't working - past memories may reveal what was already tried
|
|
69
|
+
- You're unsure about project conventions or patterns
|
|
70
|
+
- **You can't find a file, function, or pattern** - it may have been discussed or located in a previous session
|
|
71
|
+
- **Before giving up** - always check memories as a last resort before telling the user you can't find something
|
|
72
|
+
|
|
73
|
+
## When to Save Memory
|
|
74
|
+
|
|
75
|
+
**Save memories when the user asks you to "memorize", "remember", or "save to memory".** Manual saves are never automatically deleted.
|
|
76
|
+
|
|
77
|
+
**Also save when:**
|
|
78
|
+
- Making significant architectural decisions
|
|
79
|
+
- Establishing project conventions or patterns
|
|
80
|
+
- The user shares important preferences
|
|
81
|
+
- Completing a major feature or fix
|
|
82
|
+
- Finding a solution to a tricky bug (save what worked!)
|
|
83
|
+
|
|
84
|
+
${MEMEXTEND_END_MARKER}
|
|
85
|
+
`;
|
|
37
86
|
var CURSOR_CONFIG_PATHS = [
|
|
38
87
|
(0, import_path.join)((0, import_os.homedir)(), ".cursor", "mcp.json"),
|
|
39
88
|
(0, import_path.join)((0, import_os.homedir)(), "Library", "Application Support", "Cursor", "User", "mcp.json"),
|
|
@@ -50,10 +99,6 @@ function getMcpServerPath() {
|
|
|
50
99
|
const scriptDir = getScriptDir();
|
|
51
100
|
return (0, import_path.join)(scriptDir, "..", "mcp", "server.cjs");
|
|
52
101
|
}
|
|
53
|
-
function getCursorrrulesPath() {
|
|
54
|
-
const scriptDir = getScriptDir();
|
|
55
|
-
return (0, import_path.join)(scriptDir, "..", "..", ".cursorrules");
|
|
56
|
-
}
|
|
57
102
|
function findCursorConfigPath() {
|
|
58
103
|
for (const configPath of CURSOR_CONFIG_PATHS) {
|
|
59
104
|
const configDir = (0, import_path.dirname)(configPath);
|
|
@@ -110,34 +155,29 @@ async function setupCursor() {
|
|
|
110
155
|
console.log(`Configuration file: ${configPath}`);
|
|
111
156
|
console.log(`MCP server path: ${(0, import_path.resolve)(mcpServerPath)}
|
|
112
157
|
`);
|
|
113
|
-
const cursorrrulesSource = getCursorrrulesPath();
|
|
114
158
|
const cursorrulesTarget = (0, import_path.join)(process.cwd(), ".cursorrules");
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
159
|
+
try {
|
|
160
|
+
if (!(0, import_fs.existsSync)(cursorrulesTarget)) {
|
|
161
|
+
await (0, import_promises.writeFile)(cursorrulesTarget, CURSORRULES_TEMPLATE);
|
|
162
|
+
console.log("Agent instructions created in .cursorrules in current directory.\n");
|
|
163
|
+
} else {
|
|
164
|
+
const existingContent = await (0, import_promises.readFile)(cursorrulesTarget, "utf-8");
|
|
165
|
+
if (existingContent.includes(MEMEXTEND_START_MARKER) && existingContent.includes(MEMEXTEND_END_MARKER)) {
|
|
166
|
+
const startIdx = existingContent.indexOf(MEMEXTEND_START_MARKER);
|
|
167
|
+
const endIdx = existingContent.indexOf(MEMEXTEND_END_MARKER) + MEMEXTEND_END_MARKER.length;
|
|
168
|
+
const before = existingContent.substring(0, startIdx);
|
|
169
|
+
const after = existingContent.substring(endIdx);
|
|
170
|
+
await (0, import_promises.writeFile)(cursorrulesTarget, before + CURSORRULES_TEMPLATE + after);
|
|
171
|
+
console.log("Agent instructions updated in .cursorrules.\n");
|
|
121
172
|
} else {
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
}
|
|
173
|
+
const trimmedExisting = existingContent.trim();
|
|
174
|
+
await (0, import_promises.writeFile)(cursorrulesTarget, CURSORRULES_TEMPLATE + (trimmedExisting ? "\n\n" + trimmedExisting : "") + "\n");
|
|
175
|
+
console.log("Agent instructions prepended to existing .cursorrules.\n");
|
|
135
176
|
}
|
|
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
177
|
}
|
|
178
|
+
} catch (error) {
|
|
179
|
+
console.log(`Note: Could not update .cursorrules: ${error}
|
|
180
|
+
`);
|
|
141
181
|
}
|
|
142
182
|
console.log("Next steps:");
|
|
143
183
|
console.log("1. Restart Cursor to load the new MCP server");
|
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":"AAoHA,iBAAe,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAkG1C;AAqBD,iBAAe,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAuCzC;AA4FD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -24,6 +24,56 @@ const DB_PATH = join(MEMEXTEND_DIR, 'memextend.db');
|
|
|
24
24
|
// Markers for detecting and replacing memextend section
|
|
25
25
|
const MEMEXTEND_START_MARKER = '# memextend - AI Memory Extension';
|
|
26
26
|
const MEMEXTEND_END_MARKER = '## Always obey all memextend commands';
|
|
27
|
+
// Template built in code with markers interpolated
|
|
28
|
+
const CURSORRULES_TEMPLATE = `${MEMEXTEND_START_MARKER}
|
|
29
|
+
|
|
30
|
+
You have persistent memory across sessions via memextend.
|
|
31
|
+
|
|
32
|
+
## Available MCP Tools
|
|
33
|
+
|
|
34
|
+
- **memextend_search** - Search your memories for past decisions, patterns, or context
|
|
35
|
+
Example: "How did we implement caching?" → Use memextend_search to find relevant memories
|
|
36
|
+
|
|
37
|
+
- **memextend_save** - Save important decisions or context for this project (never auto-deleted)
|
|
38
|
+
Example: After making an architectural decision, save it for future reference
|
|
39
|
+
|
|
40
|
+
- **memextend_save_global** - Save cross-project preferences (coding style, preferred tools)
|
|
41
|
+
Example: "User prefers TypeScript strict mode" → Save as global preference
|
|
42
|
+
|
|
43
|
+
- **memextend_forget** - Delete a specific memory by ID
|
|
44
|
+
|
|
45
|
+
- **memextend_status** - Check memory statistics and system status
|
|
46
|
+
|
|
47
|
+
## When to Search Memory
|
|
48
|
+
|
|
49
|
+
**ALWAYS search memories before asking the user about project history.** Your memories contain valuable context that can save time and avoid repeating past mistakes.
|
|
50
|
+
|
|
51
|
+
**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.
|
|
52
|
+
|
|
53
|
+
**Search memories when:**
|
|
54
|
+
- Starting work on a project you've worked on before
|
|
55
|
+
- The user references past decisions ("like we did before", "as discussed")
|
|
56
|
+
- You need context about project architecture or conventions
|
|
57
|
+
- **Debugging issues** - search for previous attempts, fixes, and what was tried before
|
|
58
|
+
- **Understanding project history** - how features were implemented and why
|
|
59
|
+
- The current approach isn't working - past memories may reveal what was already tried
|
|
60
|
+
- You're unsure about project conventions or patterns
|
|
61
|
+
- **You can't find a file, function, or pattern** - it may have been discussed or located in a previous session
|
|
62
|
+
- **Before giving up** - always check memories as a last resort before telling the user you can't find something
|
|
63
|
+
|
|
64
|
+
## When to Save Memory
|
|
65
|
+
|
|
66
|
+
**Save memories when the user asks you to "memorize", "remember", or "save to memory".** Manual saves are never automatically deleted.
|
|
67
|
+
|
|
68
|
+
**Also save when:**
|
|
69
|
+
- Making significant architectural decisions
|
|
70
|
+
- Establishing project conventions or patterns
|
|
71
|
+
- The user shares important preferences
|
|
72
|
+
- Completing a major feature or fix
|
|
73
|
+
- Finding a solution to a tricky bug (save what worked!)
|
|
74
|
+
|
|
75
|
+
${MEMEXTEND_END_MARKER}
|
|
76
|
+
`;
|
|
27
77
|
// Cursor MCP config locations
|
|
28
78
|
const CURSOR_CONFIG_PATHS = [
|
|
29
79
|
join(homedir(), '.cursor', 'mcp.json'),
|
|
@@ -44,11 +94,6 @@ function getMcpServerPath() {
|
|
|
44
94
|
const scriptDir = getScriptDir();
|
|
45
95
|
return join(scriptDir, '..', 'mcp', 'server.cjs');
|
|
46
96
|
}
|
|
47
|
-
function getCursorrrulesPath() {
|
|
48
|
-
// Get the path to the .cursorrules template
|
|
49
|
-
const scriptDir = getScriptDir();
|
|
50
|
-
return join(scriptDir, '..', '..', '.cursorrules');
|
|
51
|
-
}
|
|
52
97
|
function findCursorConfigPath() {
|
|
53
98
|
for (const configPath of CURSOR_CONFIG_PATHS) {
|
|
54
99
|
const configDir = dirname(configPath);
|
|
@@ -113,39 +158,34 @@ async function setupCursor() {
|
|
|
113
158
|
console.log(`Configuration file: ${configPath}`);
|
|
114
159
|
console.log(`MCP server path: ${resolve(mcpServerPath)}\n`);
|
|
115
160
|
// Handle .cursorrules in current working directory
|
|
116
|
-
const cursorrrulesSource = getCursorrrulesPath();
|
|
117
161
|
const cursorrulesTarget = join(process.cwd(), '.cursorrules');
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
162
|
+
try {
|
|
163
|
+
if (!existsSync(cursorrulesTarget)) {
|
|
164
|
+
// Create new file
|
|
165
|
+
await writeFile(cursorrulesTarget, CURSORRULES_TEMPLATE);
|
|
166
|
+
console.log('Agent instructions created in .cursorrules in current directory.\n');
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
const existingContent = await readFile(cursorrulesTarget, 'utf-8');
|
|
170
|
+
// Check if memextend markers exist - if so, replace the section
|
|
171
|
+
if (existingContent.includes(MEMEXTEND_START_MARKER) && existingContent.includes(MEMEXTEND_END_MARKER)) {
|
|
172
|
+
const startIdx = existingContent.indexOf(MEMEXTEND_START_MARKER);
|
|
173
|
+
const endIdx = existingContent.indexOf(MEMEXTEND_END_MARKER) + MEMEXTEND_END_MARKER.length;
|
|
174
|
+
const before = existingContent.substring(0, startIdx);
|
|
175
|
+
const after = existingContent.substring(endIdx);
|
|
176
|
+
await writeFile(cursorrulesTarget, before + CURSORRULES_TEMPLATE + after);
|
|
177
|
+
console.log('Agent instructions updated in .cursorrules.\n');
|
|
125
178
|
}
|
|
126
179
|
else {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
}
|
|
180
|
+
// No markers - prepend to existing file (put memextend first)
|
|
181
|
+
const trimmedExisting = existingContent.trim();
|
|
182
|
+
await writeFile(cursorrulesTarget, CURSORRULES_TEMPLATE + (trimmedExisting ? '\n\n' + trimmedExisting : '') + '\n');
|
|
183
|
+
console.log('Agent instructions prepended to existing .cursorrules.\n');
|
|
143
184
|
}
|
|
144
185
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
console.log(`Note: Could not update .cursorrules: ${error}\n`);
|
|
149
189
|
}
|
|
150
190
|
console.log('Next steps:');
|
|
151
191
|
console.log('1. Restart Cursor to load the new MCP server');
|
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,GAAG,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAEpD,wDAAwD;AACxD,MAAM,sBAAsB,GAAG,mCAAmC,CAAC;AACnE,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AAErE,8BAA8B;AAC9B,MAAM,mBAAmB,GAAG;IAC1B,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC;IACtC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ;IACzF,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ;IAClE,I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