engram-mcp-server 1.2.8 → 1.2.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/README.md +12 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +6 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/installer/ide-detector.d.ts.map +1 -1
- package/dist/installer/ide-detector.js +10 -6
- package/dist/installer/ide-detector.js.map +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +79 -15
- package/dist/installer/index.js.map +1 -1
- package/package.json +6 -3
- package/dist/installer.d.ts +0 -2
- package/dist/installer.d.ts.map +0 -1
- package/dist/installer.js +0 -315
- package/dist/installer.js.map +0 -1
- package/dist/src/constants.d.ts +0 -21
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/constants.js +0 -81
- package/dist/src/constants.js.map +0 -1
- package/dist/src/database.d.ts +0 -32
- package/dist/src/database.d.ts.map +0 -1
- package/dist/src/database.js +0 -143
- package/dist/src/database.js.map +0 -1
- package/dist/src/errors.d.ts +0 -40
- package/dist/src/errors.d.ts.map +0 -1
- package/dist/src/errors.js +0 -63
- package/dist/src/errors.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -89
- package/dist/src/index.js.map +0 -1
- package/dist/src/installer/config-writer.d.ts +0 -25
- package/dist/src/installer/config-writer.d.ts.map +0 -1
- package/dist/src/installer/config-writer.js +0 -86
- package/dist/src/installer/config-writer.js.map +0 -1
- package/dist/src/installer/ide-configs.d.ts +0 -19
- package/dist/src/installer/ide-configs.d.ts.map +0 -1
- package/dist/src/installer/ide-configs.js +0 -131
- package/dist/src/installer/ide-configs.js.map +0 -1
- package/dist/src/installer/ide-detector.d.ts +0 -6
- package/dist/src/installer/ide-detector.d.ts.map +0 -1
- package/dist/src/installer/ide-detector.js +0 -45
- package/dist/src/installer/ide-detector.js.map +0 -1
- package/dist/src/installer/index.d.ts +0 -2
- package/dist/src/installer/index.d.ts.map +0 -1
- package/dist/src/installer/index.js +0 -229
- package/dist/src/installer/index.js.map +0 -1
- package/dist/src/logger.d.ts +0 -10
- package/dist/src/logger.d.ts.map +0 -1
- package/dist/src/logger.js +0 -51
- package/dist/src/logger.js.map +0 -1
- package/dist/src/migrations.d.ts +0 -4
- package/dist/src/migrations.d.ts.map +0 -1
- package/dist/src/migrations.js +0 -343
- package/dist/src/migrations.js.map +0 -1
- package/dist/src/repositories/changes.repo.d.ts +0 -35
- package/dist/src/repositories/changes.repo.d.ts.map +0 -1
- package/dist/src/repositories/changes.repo.js +0 -53
- package/dist/src/repositories/changes.repo.js.map +0 -1
- package/dist/src/repositories/config.repo.d.ts +0 -11
- package/dist/src/repositories/config.repo.d.ts.map +0 -1
- package/dist/src/repositories/config.repo.js +0 -38
- package/dist/src/repositories/config.repo.js.map +0 -1
- package/dist/src/repositories/conventions.repo.d.ts +0 -15
- package/dist/src/repositories/conventions.repo.d.ts.map +0 -1
- package/dist/src/repositories/conventions.repo.js +0 -39
- package/dist/src/repositories/conventions.repo.js.map +0 -1
- package/dist/src/repositories/decisions.repo.d.ts +0 -19
- package/dist/src/repositories/decisions.repo.d.ts.map +0 -1
- package/dist/src/repositories/decisions.repo.js +0 -48
- package/dist/src/repositories/decisions.repo.js.map +0 -1
- package/dist/src/repositories/events.repo.d.ts +0 -34
- package/dist/src/repositories/events.repo.d.ts.map +0 -1
- package/dist/src/repositories/events.repo.js +0 -71
- package/dist/src/repositories/events.repo.js.map +0 -1
- package/dist/src/repositories/file-notes.repo.d.ts +0 -26
- package/dist/src/repositories/file-notes.repo.d.ts.map +0 -1
- package/dist/src/repositories/file-notes.repo.js +0 -55
- package/dist/src/repositories/file-notes.repo.js.map +0 -1
- package/dist/src/repositories/index.d.ts +0 -38
- package/dist/src/repositories/index.d.ts.map +0 -1
- package/dist/src/repositories/index.js +0 -41
- package/dist/src/repositories/index.js.map +0 -1
- package/dist/src/repositories/milestones.repo.d.ts +0 -10
- package/dist/src/repositories/milestones.repo.d.ts.map +0 -1
- package/dist/src/repositories/milestones.repo.js +0 -20
- package/dist/src/repositories/milestones.repo.js.map +0 -1
- package/dist/src/repositories/sessions.repo.d.ts +0 -27
- package/dist/src/repositories/sessions.repo.d.ts.map +0 -1
- package/dist/src/repositories/sessions.repo.js +0 -61
- package/dist/src/repositories/sessions.repo.js.map +0 -1
- package/dist/src/repositories/snapshot.repo.d.ts +0 -11
- package/dist/src/repositories/snapshot.repo.d.ts.map +0 -1
- package/dist/src/repositories/snapshot.repo.js +0 -17
- package/dist/src/repositories/snapshot.repo.js.map +0 -1
- package/dist/src/repositories/tasks.repo.d.ts +0 -40
- package/dist/src/repositories/tasks.repo.d.ts.map +0 -1
- package/dist/src/repositories/tasks.repo.js +0 -90
- package/dist/src/repositories/tasks.repo.js.map +0 -1
- package/dist/src/response.d.ts +0 -28
- package/dist/src/response.d.ts.map +0 -1
- package/dist/src/response.js +0 -38
- package/dist/src/response.js.map +0 -1
- package/dist/src/scripts/install-hooks.d.ts +0 -3
- package/dist/src/scripts/install-hooks.d.ts.map +0 -1
- package/dist/src/scripts/install-hooks.js +0 -89
- package/dist/src/scripts/install-hooks.js.map +0 -1
- package/dist/src/services/compaction.service.d.ts +0 -27
- package/dist/src/services/compaction.service.d.ts.map +0 -1
- package/dist/src/services/compaction.service.js +0 -93
- package/dist/src/services/compaction.service.js.map +0 -1
- package/dist/src/services/event-trigger.service.d.ts +0 -24
- package/dist/src/services/event-trigger.service.d.ts.map +0 -1
- package/dist/src/services/event-trigger.service.js +0 -60
- package/dist/src/services/event-trigger.service.js.map +0 -1
- package/dist/src/services/git.service.d.ts +0 -20
- package/dist/src/services/git.service.d.ts.map +0 -1
- package/dist/src/services/git.service.js +0 -88
- package/dist/src/services/git.service.js.map +0 -1
- package/dist/src/services/index.d.ts +0 -5
- package/dist/src/services/index.d.ts.map +0 -1
- package/dist/src/services/index.js +0 -8
- package/dist/src/services/index.js.map +0 -1
- package/dist/src/services/project-scan.service.d.ts +0 -19
- package/dist/src/services/project-scan.service.d.ts.map +0 -1
- package/dist/src/services/project-scan.service.js +0 -66
- package/dist/src/services/project-scan.service.js.map +0 -1
- package/dist/src/tools/backup.d.ts +0 -3
- package/dist/src/tools/backup.d.ts.map +0 -1
- package/dist/src/tools/backup.js +0 -191
- package/dist/src/tools/backup.js.map +0 -1
- package/dist/src/tools/changes.d.ts +0 -3
- package/dist/src/tools/changes.d.ts.map +0 -1
- package/dist/src/tools/changes.js +0 -97
- package/dist/src/tools/changes.js.map +0 -1
- package/dist/src/tools/compaction.d.ts +0 -3
- package/dist/src/tools/compaction.d.ts.map +0 -1
- package/dist/src/tools/compaction.js +0 -151
- package/dist/src/tools/compaction.js.map +0 -1
- package/dist/src/tools/conventions.d.ts +0 -3
- package/dist/src/tools/conventions.d.ts.map +0 -1
- package/dist/src/tools/conventions.js +0 -121
- package/dist/src/tools/conventions.js.map +0 -1
- package/dist/src/tools/decisions.d.ts +0 -3
- package/dist/src/tools/decisions.d.ts.map +0 -1
- package/dist/src/tools/decisions.js +0 -136
- package/dist/src/tools/decisions.js.map +0 -1
- package/dist/src/tools/export-import.d.ts +0 -3
- package/dist/src/tools/export-import.d.ts.map +0 -1
- package/dist/src/tools/export-import.js +0 -180
- package/dist/src/tools/export-import.js.map +0 -1
- package/dist/src/tools/file-notes.d.ts +0 -3
- package/dist/src/tools/file-notes.d.ts.map +0 -1
- package/dist/src/tools/file-notes.js +0 -104
- package/dist/src/tools/file-notes.js.map +0 -1
- package/dist/src/tools/intelligence.d.ts +0 -3
- package/dist/src/tools/intelligence.d.ts.map +0 -1
- package/dist/src/tools/intelligence.js +0 -427
- package/dist/src/tools/intelligence.js.map +0 -1
- package/dist/src/tools/milestones.d.ts +0 -3
- package/dist/src/tools/milestones.d.ts.map +0 -1
- package/dist/src/tools/milestones.js +0 -71
- package/dist/src/tools/milestones.js.map +0 -1
- package/dist/src/tools/scheduler.d.ts +0 -3
- package/dist/src/tools/scheduler.d.ts.map +0 -1
- package/dist/src/tools/scheduler.js +0 -363
- package/dist/src/tools/scheduler.js.map +0 -1
- package/dist/src/tools/sessions.d.ts +0 -3
- package/dist/src/tools/sessions.d.ts.map +0 -1
- package/dist/src/tools/sessions.js +0 -356
- package/dist/src/tools/sessions.js.map +0 -1
- package/dist/src/tools/stats.d.ts +0 -3
- package/dist/src/tools/stats.d.ts.map +0 -1
- package/dist/src/tools/stats.js +0 -63
- package/dist/src/tools/stats.js.map +0 -1
- package/dist/src/tools/tasks.d.ts +0 -3
- package/dist/src/tools/tasks.d.ts.map +0 -1
- package/dist/src/tools/tasks.js +0 -206
- package/dist/src/tools/tasks.js.map +0 -1
- package/dist/src/types.d.ts +0 -170
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -5
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils.d.ts +0 -58
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/utils.js +0 -190
- package/dist/src/utils.js.map +0 -1
- package/dist/tests/helpers/test-db.d.ts +0 -12
- package/dist/tests/helpers/test-db.d.ts.map +0 -1
- package/dist/tests/helpers/test-db.js +0 -149
- package/dist/tests/helpers/test-db.js.map +0 -1
- package/dist/tests/installer/installer.test.d.ts +0 -2
- package/dist/tests/installer/installer.test.d.ts.map +0 -1
- package/dist/tests/installer/installer.test.js +0 -160
- package/dist/tests/installer/installer.test.js.map +0 -1
- package/dist/tests/repositories/repos.test.d.ts +0 -2
- package/dist/tests/repositories/repos.test.d.ts.map +0 -1
- package/dist/tests/repositories/repos.test.js +0 -220
- package/dist/tests/repositories/repos.test.js.map +0 -1
- package/dist/tools/maintenance.d.ts +0 -3
- package/dist/tools/maintenance.d.ts.map +0 -1
- package/dist/tools/maintenance.js +0 -647
- package/dist/tools/maintenance.js.map +0 -1
- package/dist/tools/memory.d.ts +0 -3
- package/dist/tools/memory.d.ts.map +0 -1
- package/dist/tools/memory.js +0 -446
- package/dist/tools/memory.js.map +0 -1
package/dist/src/errors.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base error class for all Engram errors.
|
|
3
|
-
* Includes an error code and optional context for structured error handling.
|
|
4
|
-
*/
|
|
5
|
-
export declare class EngramError extends Error {
|
|
6
|
-
readonly code: string;
|
|
7
|
-
readonly context?: Record<string, unknown>;
|
|
8
|
-
constructor(message: string, code?: string, context?: Record<string, unknown>);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Thrown when a requested entity is not found.
|
|
12
|
-
*/
|
|
13
|
-
export declare class NotFoundError extends EngramError {
|
|
14
|
-
constructor(entity: string, id: string | number);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Thrown when input validation fails beyond what Zod catches.
|
|
18
|
-
*/
|
|
19
|
-
export declare class ValidationError extends EngramError {
|
|
20
|
-
constructor(message: string, context?: Record<string, unknown>);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Thrown when a database operation fails.
|
|
24
|
-
*/
|
|
25
|
-
export declare class DatabaseError extends EngramError {
|
|
26
|
-
constructor(message: string, context?: Record<string, unknown>);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Thrown when a safety confirmation is missing or incorrect.
|
|
30
|
-
*/
|
|
31
|
-
export declare class SafetyCheckError extends EngramError {
|
|
32
|
-
constructor(expectedConfirm: string);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Thrown when no active session exists for an operation that requires one.
|
|
36
|
-
*/
|
|
37
|
-
export declare class NoActiveSessionError extends EngramError {
|
|
38
|
-
constructor();
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=errors.d.ts.map
|
package/dist/src/errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAE/B,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAuB,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMhG;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,WAAW;gBAC9B,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;CAIlD;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,WAAW;gBAChC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAIjE;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,WAAW;gBAC9B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAIjE;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;gBACjC,eAAe,EAAE,MAAM;CAItC;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;;CAKpD"}
|
package/dist/src/errors.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Engram MCP Server — Error Types
|
|
3
|
-
// ============================================================================
|
|
4
|
-
/**
|
|
5
|
-
* Base error class for all Engram errors.
|
|
6
|
-
* Includes an error code and optional context for structured error handling.
|
|
7
|
-
*/
|
|
8
|
-
export class EngramError extends Error {
|
|
9
|
-
code;
|
|
10
|
-
context;
|
|
11
|
-
constructor(message, code = "ENGRAM_ERROR", context) {
|
|
12
|
-
super(message);
|
|
13
|
-
this.name = "EngramError";
|
|
14
|
-
this.code = code;
|
|
15
|
-
this.context = context;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Thrown when a requested entity is not found.
|
|
20
|
-
*/
|
|
21
|
-
export class NotFoundError extends EngramError {
|
|
22
|
-
constructor(entity, id) {
|
|
23
|
-
super(`${entity} #${id} not found.`, "NOT_FOUND", { entity, id });
|
|
24
|
-
this.name = "NotFoundError";
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Thrown when input validation fails beyond what Zod catches.
|
|
29
|
-
*/
|
|
30
|
-
export class ValidationError extends EngramError {
|
|
31
|
-
constructor(message, context) {
|
|
32
|
-
super(message, "VALIDATION_ERROR", context);
|
|
33
|
-
this.name = "ValidationError";
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Thrown when a database operation fails.
|
|
38
|
-
*/
|
|
39
|
-
export class DatabaseError extends EngramError {
|
|
40
|
-
constructor(message, context) {
|
|
41
|
-
super(message, "DATABASE_ERROR", context);
|
|
42
|
-
this.name = "DatabaseError";
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Thrown when a safety confirmation is missing or incorrect.
|
|
47
|
-
*/
|
|
48
|
-
export class SafetyCheckError extends EngramError {
|
|
49
|
-
constructor(expectedConfirm) {
|
|
50
|
-
super(`Safety check: set confirm to "${expectedConfirm}" to proceed.`, "SAFETY_CHECK", { expectedConfirm });
|
|
51
|
-
this.name = "SafetyCheckError";
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Thrown when no active session exists for an operation that requires one.
|
|
56
|
-
*/
|
|
57
|
-
export class NoActiveSessionError extends EngramError {
|
|
58
|
-
constructor() {
|
|
59
|
-
super("No active session. Start one with engram_start_session first.", "NO_SESSION");
|
|
60
|
-
this.name = "NoActiveSessionError";
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=errors.js.map
|
package/dist/src/errors.js.map
DELETED
|
@@ -1 +0,0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EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;QAC5G,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACnC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IACjD;QACI,KAAK,CAAC,+DAA+D,EAAE,YAAY,CAAC,CAAC;QACrF,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACvC,CAAC;CACJ"}
|
package/dist/src/index.d.ts
DELETED
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
|
package/dist/src/index.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// ============================================================================
|
|
3
|
-
//
|
|
4
|
-
// ███████╗███╗ ██╗ ██████╗ ██████╗ █████╗ ███╗ ███╗
|
|
5
|
-
// ██╔════╝████╗ ██║██╔════╝ ██╔══██╗██╔══██╗████╗ ████║
|
|
6
|
-
// █████╗ ██╔██╗ ██║██║ ███╗██████╔╝███████║██╔████╔██║
|
|
7
|
-
// ██╔══╝ ██║╚██╗██║██║ ██║██╔══██╗██╔══██║██║╚██╔╝██║
|
|
8
|
-
// ███████╗██║ ╚████║╚██████╔╝██║ ██║██║ ██║██║ ╚═╝ ██║
|
|
9
|
-
// ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
|
|
10
|
-
//
|
|
11
|
-
// Persistent Memory Cortex for AI Coding Agents
|
|
12
|
-
// Model Context Protocol (MCP) Server
|
|
13
|
-
//
|
|
14
|
-
// ============================================================================
|
|
15
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
16
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
17
|
-
import { SERVER_NAME, SERVER_VERSION } from "./constants.js";
|
|
18
|
-
import { initDatabase } from "./database.js";
|
|
19
|
-
import { log } from "./logger.js";
|
|
20
|
-
import { findProjectRoot } from "./utils.js";
|
|
21
|
-
import { runInstaller } from "./installer/index.js";
|
|
22
|
-
// Tool registrations
|
|
23
|
-
import { registerSessionTools } from "./tools/sessions.js";
|
|
24
|
-
import { registerChangeTools } from "./tools/changes.js";
|
|
25
|
-
import { registerDecisionTools } from "./tools/decisions.js";
|
|
26
|
-
import { registerFileNoteTools } from "./tools/file-notes.js";
|
|
27
|
-
import { registerConventionTools } from "./tools/conventions.js";
|
|
28
|
-
import { registerTaskTools } from "./tools/tasks.js";
|
|
29
|
-
import { registerIntelligenceTools } from "./tools/intelligence.js";
|
|
30
|
-
import { registerStatsTools } from "./tools/stats.js";
|
|
31
|
-
import { registerBackupTools } from "./tools/backup.js";
|
|
32
|
-
import { registerMilestoneTools } from "./tools/milestones.js";
|
|
33
|
-
import { registerExportImportTools } from "./tools/export-import.js";
|
|
34
|
-
import { registerCompactionTools } from "./tools/compaction.js";
|
|
35
|
-
import { registerSchedulerTools } from "./tools/scheduler.js";
|
|
36
|
-
// ─── Initialize ───────────────────────────────────────────────────────
|
|
37
|
-
async function main() {
|
|
38
|
-
const args = process.argv.slice(2);
|
|
39
|
-
// ─── Auto-Installer ───────────────────────────────────────────────────
|
|
40
|
-
if (args.includes("install") || args.includes("--install") || args.includes("--list")) {
|
|
41
|
-
runInstaller(args);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
// Detect project root
|
|
45
|
-
const projectRoot = findProjectRoot();
|
|
46
|
-
log.info(`Project root: ${projectRoot}`);
|
|
47
|
-
// Initialize database
|
|
48
|
-
initDatabase(projectRoot);
|
|
49
|
-
log.info(`Database initialized at ${projectRoot}/.engram/memory.db`);
|
|
50
|
-
// Create MCP server
|
|
51
|
-
const server = new McpServer({
|
|
52
|
-
name: SERVER_NAME,
|
|
53
|
-
version: SERVER_VERSION,
|
|
54
|
-
});
|
|
55
|
-
// ─── Register All Tools ──────────────────────────────────────────
|
|
56
|
-
registerSessionTools(server); // start_session, end_session, get_session_history
|
|
57
|
-
registerChangeTools(server); // record_change, get_file_history
|
|
58
|
-
registerDecisionTools(server); // record_decision, get_decisions, update_decision
|
|
59
|
-
registerFileNoteTools(server); // set_file_notes, get_file_notes
|
|
60
|
-
registerConventionTools(server); // add_convention, get_conventions, toggle_convention
|
|
61
|
-
registerTaskTools(server); // create_task, update_task, get_tasks
|
|
62
|
-
registerIntelligenceTools(server); // scan_project, search, what_changed, dependency_map
|
|
63
|
-
registerStatsTools(server); // stats
|
|
64
|
-
registerBackupTools(server); // backup, restore, list_backups
|
|
65
|
-
registerMilestoneTools(server); // record_milestone, get_milestones
|
|
66
|
-
registerExportImportTools(server); // export, import
|
|
67
|
-
registerCompactionTools(server); // compact, clear
|
|
68
|
-
registerSchedulerTools(server); // schedule_event, get/update/acknowledge events, check_events
|
|
69
|
-
log.info(`${SERVER_NAME} v${SERVER_VERSION} — all tools registered`);
|
|
70
|
-
// ─── Connect Transport ───────────────────────────────────────────
|
|
71
|
-
const transportType = process.env.ENGRAM_TRANSPORT || "stdio";
|
|
72
|
-
if (transportType === "stdio") {
|
|
73
|
-
const transport = new StdioServerTransport();
|
|
74
|
-
await server.connect(transport);
|
|
75
|
-
log.info("Running on stdio transport. Ready.");
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
// Future: HTTP transport support
|
|
79
|
-
log.warn(`Unknown transport: ${transportType}. Falling back to stdio.`);
|
|
80
|
-
const transport = new StdioServerTransport();
|
|
81
|
-
await server.connect(transport);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
// ─── Run ──────────────────────────────────────────────────────────────
|
|
85
|
-
main().catch((error) => {
|
|
86
|
-
log.error("Fatal error", { message: error.message });
|
|
87
|
-
process.exit(1);
|
|
88
|
-
});
|
|
89
|
-
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-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.
|
|
4
|
-
*/
|
|
5
|
-
export declare function makeEngramEntry(ide: IdeDefinition): Record<string, any>;
|
|
6
|
-
/**
|
|
7
|
-
* Read and parse a JSON config file. Returns null if file doesn't exist or is invalid.
|
|
8
|
-
*/
|
|
9
|
-
export declare function readJson(filePath: string): Record<string, any> | null;
|
|
10
|
-
/**
|
|
11
|
-
* Write a JSON config file, creating parent directories if needed.
|
|
12
|
-
*/
|
|
13
|
-
export declare function writeJson(filePath: string, data: any): void;
|
|
14
|
-
/**
|
|
15
|
-
* Add or update the Engram entry in a config file.
|
|
16
|
-
* Uses the IDE's configKey ("mcpServers" or "servers") to write the correct JSON structure.
|
|
17
|
-
* Returns: "added", "updated", or "exists".
|
|
18
|
-
*/
|
|
19
|
-
export declare function addToConfig(configPath: string, ide: IdeDefinition): "added" | "updated" | "exists";
|
|
20
|
-
/**
|
|
21
|
-
* Remove the Engram entry from a config file.
|
|
22
|
-
* Returns true if the entry was found and removed, false if not present.
|
|
23
|
-
*/
|
|
24
|
-
export declare function removeFromConfig(configPath: string, ide: IdeDefinition): boolean;
|
|
25
|
-
//# sourceMappingURL=config-writer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../../src/installer/config-writer.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAkBvE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAMrE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAG3D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAoBlG;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAgBhF"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Engram MCP Server — Config File Manipulation
|
|
3
|
-
// ============================================================================
|
|
4
|
-
import fs from "fs";
|
|
5
|
-
import path from "path";
|
|
6
|
-
/**
|
|
7
|
-
* Generate the Engram server entry tailored to a specific IDE's requirements.
|
|
8
|
-
*/
|
|
9
|
-
export function makeEngramEntry(ide) {
|
|
10
|
-
const entry = {};
|
|
11
|
-
// Some IDEs require explicit "type": "stdio"
|
|
12
|
-
if (ide.requiresType) {
|
|
13
|
-
entry.type = "stdio";
|
|
14
|
-
}
|
|
15
|
-
// Windows cmd /c wrapper for npx (npx is a .cmd on Windows)
|
|
16
|
-
if (ide.requiresCmdWrapper) {
|
|
17
|
-
entry.command = "cmd";
|
|
18
|
-
entry.args = ["/c", "npx", "-y", "engram-mcp-server"];
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
entry.command = "npx";
|
|
22
|
-
entry.args = ["-y", "engram-mcp-server"];
|
|
23
|
-
}
|
|
24
|
-
return entry;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Read and parse a JSON config file. Returns null if file doesn't exist or is invalid.
|
|
28
|
-
*/
|
|
29
|
-
export function readJson(filePath) {
|
|
30
|
-
try {
|
|
31
|
-
return JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Write a JSON config file, creating parent directories if needed.
|
|
39
|
-
*/
|
|
40
|
-
export function writeJson(filePath, data) {
|
|
41
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
42
|
-
fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", "utf-8");
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Add or update the Engram entry in a config file.
|
|
46
|
-
* Uses the IDE's configKey ("mcpServers" or "servers") to write the correct JSON structure.
|
|
47
|
-
* Returns: "added", "updated", or "exists".
|
|
48
|
-
*/
|
|
49
|
-
export function addToConfig(configPath, ide) {
|
|
50
|
-
let config = readJson(configPath) || {};
|
|
51
|
-
const key = ide.configKey;
|
|
52
|
-
if (!config[key])
|
|
53
|
-
config[key] = {};
|
|
54
|
-
const newEntry = makeEngramEntry(ide);
|
|
55
|
-
if (config[key].engram) {
|
|
56
|
-
if (JSON.stringify(config[key].engram) === JSON.stringify(newEntry)) {
|
|
57
|
-
return "exists";
|
|
58
|
-
}
|
|
59
|
-
config[key].engram = newEntry;
|
|
60
|
-
writeJson(configPath, config);
|
|
61
|
-
return "updated";
|
|
62
|
-
}
|
|
63
|
-
config[key].engram = newEntry;
|
|
64
|
-
writeJson(configPath, config);
|
|
65
|
-
return "added";
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Remove the Engram entry from a config file.
|
|
69
|
-
* Returns true if the entry was found and removed, false if not present.
|
|
70
|
-
*/
|
|
71
|
-
export function removeFromConfig(configPath, ide) {
|
|
72
|
-
const config = readJson(configPath);
|
|
73
|
-
if (!config)
|
|
74
|
-
return false;
|
|
75
|
-
const key = ide.configKey;
|
|
76
|
-
if (!config[key]?.engram)
|
|
77
|
-
return false;
|
|
78
|
-
delete config[key].engram;
|
|
79
|
-
// Clean up empty wrapper key
|
|
80
|
-
if (Object.keys(config[key]).length === 0) {
|
|
81
|
-
delete config[key];
|
|
82
|
-
}
|
|
83
|
-
writeJson(configPath, config);
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=config-writer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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EAAE,MAAM;QAAE,OAAO,KAAK,CAAC;IAEvC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IAE1B,6BAA6B;IAC7B,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare const IS_WINDOWS: boolean;
|
|
2
|
-
export interface IdeDefinition {
|
|
3
|
-
name: string;
|
|
4
|
-
/** The top-level JSON key that holds server entries */
|
|
5
|
-
configKey: "mcpServers" | "servers";
|
|
6
|
-
/** Whether each server entry requires "type": "stdio" */
|
|
7
|
-
requiresType: boolean;
|
|
8
|
-
/** Whether Windows requires cmd /c wrapper for npx */
|
|
9
|
-
requiresCmdWrapper: boolean;
|
|
10
|
-
scopes: {
|
|
11
|
-
global?: string[];
|
|
12
|
-
localDirs?: string[];
|
|
13
|
-
/** CLI command for IDE-native installation (e.g. claude mcp add-json) */
|
|
14
|
-
cli?: string;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export declare const IDE_CONFIGS: Record<string, IdeDefinition>;
|
|
18
|
-
export { IS_WINDOWS };
|
|
19
|
-
//# sourceMappingURL=ide-configs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ide-configs.d.ts","sourceRoot":"","sources":["../../../src/installer/ide-configs.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,UAAU,SAA+B,CAAC;AAGhD,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,SAAS,EAAE,YAAY,GAAG,SAAS,CAAC;IACpC,yDAAyD;IACzD,YAAY,EAAE,OAAO,CAAC;IACtB,sDAAsD;IACtD,kBAAkB,EAAE,OAAO,CAAC;IAC5B,MAAM,EAAE;QACJ,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,yEAAyE;QACzE,GAAG,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACL;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CA0HrD,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Engram MCP Server — IDE Configuration Definitions
|
|
3
|
-
// ============================================================================
|
|
4
|
-
import path from "path";
|
|
5
|
-
import os from "os";
|
|
6
|
-
const HOME = os.homedir();
|
|
7
|
-
const APPDATA = process.env.APPDATA || path.join(HOME, ".config");
|
|
8
|
-
const IS_WINDOWS = process.platform === "win32";
|
|
9
|
-
const IS_MAC = process.platform === "darwin";
|
|
10
|
-
export const IDE_CONFIGS = {
|
|
11
|
-
// ─── VS Code forks ──────────────────────────────────────────────
|
|
12
|
-
vscode: {
|
|
13
|
-
name: "VS Code (Copilot)",
|
|
14
|
-
configKey: "servers",
|
|
15
|
-
requiresType: true,
|
|
16
|
-
requiresCmdWrapper: false,
|
|
17
|
-
scopes: {
|
|
18
|
-
global: [
|
|
19
|
-
path.join(APPDATA, "Code", "User", "mcp.json"),
|
|
20
|
-
path.join(HOME, ".vscode", "mcp.json"),
|
|
21
|
-
],
|
|
22
|
-
localDirs: [".vscode"],
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
cursor: {
|
|
26
|
-
name: "Cursor",
|
|
27
|
-
configKey: "mcpServers",
|
|
28
|
-
requiresType: false,
|
|
29
|
-
requiresCmdWrapper: false,
|
|
30
|
-
scopes: {
|
|
31
|
-
global: [
|
|
32
|
-
path.join(HOME, ".cursor", "mcp.json"),
|
|
33
|
-
path.join(APPDATA, "Cursor", "mcp.json"),
|
|
34
|
-
],
|
|
35
|
-
localDirs: [".cursor"],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
windsurf: {
|
|
39
|
-
name: "Windsurf",
|
|
40
|
-
configKey: "mcpServers",
|
|
41
|
-
requiresType: false,
|
|
42
|
-
requiresCmdWrapper: false,
|
|
43
|
-
scopes: {
|
|
44
|
-
global: [
|
|
45
|
-
path.join(HOME, ".codeium", "windsurf", "mcp_config.json"),
|
|
46
|
-
path.join(APPDATA, "Windsurf", "mcp.json"),
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
antigravity: {
|
|
51
|
-
name: "Antigravity IDE",
|
|
52
|
-
configKey: "mcpServers",
|
|
53
|
-
requiresType: false,
|
|
54
|
-
requiresCmdWrapper: false,
|
|
55
|
-
scopes: {
|
|
56
|
-
global: [path.join(HOME, ".gemini", "antigravity", "mcp_config.json")],
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
// ─── Anthropic ──────────────────────────────────────────────────
|
|
60
|
-
claudecode: {
|
|
61
|
-
name: "Claude Code (CLI)",
|
|
62
|
-
configKey: "mcpServers",
|
|
63
|
-
requiresType: true,
|
|
64
|
-
requiresCmdWrapper: IS_WINDOWS,
|
|
65
|
-
scopes: {
|
|
66
|
-
// User-level: ~/.claude.json contains mcpServers
|
|
67
|
-
global: [path.join(HOME, ".claude.json")],
|
|
68
|
-
// Project-level: .mcp.json in workspace root
|
|
69
|
-
localDirs: [""],
|
|
70
|
-
// CLI alternative
|
|
71
|
-
cli: "claude mcp add-json",
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
claudedesktop: {
|
|
75
|
-
name: "Claude Desktop",
|
|
76
|
-
configKey: "mcpServers",
|
|
77
|
-
requiresType: false,
|
|
78
|
-
requiresCmdWrapper: IS_WINDOWS,
|
|
79
|
-
scopes: {
|
|
80
|
-
global: IS_MAC
|
|
81
|
-
? [path.join(HOME, "Library", "Application Support", "Claude", "claude_desktop_config.json")]
|
|
82
|
-
: [path.join(APPDATA, "Claude", "claude_desktop_config.json")],
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
// ─── Microsoft ──────────────────────────────────────────────────
|
|
86
|
-
visualstudio: {
|
|
87
|
-
name: "Visual Studio 2022/2026",
|
|
88
|
-
configKey: "mcpServers",
|
|
89
|
-
requiresType: false,
|
|
90
|
-
requiresCmdWrapper: false,
|
|
91
|
-
scopes: {
|
|
92
|
-
global: [path.join(HOME, ".mcp.json")],
|
|
93
|
-
localDirs: ["", ".vs"],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
// ─── Other IDEs ─────────────────────────────────────────────────
|
|
97
|
-
cline: {
|
|
98
|
-
name: "Cline / Roo Code",
|
|
99
|
-
configKey: "mcpServers",
|
|
100
|
-
requiresType: false,
|
|
101
|
-
requiresCmdWrapper: false,
|
|
102
|
-
scopes: {
|
|
103
|
-
global: [
|
|
104
|
-
path.join(APPDATA, "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json"),
|
|
105
|
-
path.join(HOME, ".cline", "mcp_settings.json"),
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
trae: {
|
|
110
|
-
name: "Trae IDE",
|
|
111
|
-
configKey: "mcpServers",
|
|
112
|
-
requiresType: true,
|
|
113
|
-
requiresCmdWrapper: false,
|
|
114
|
-
scopes: {
|
|
115
|
-
localDirs: [".trae"],
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
jetbrains: {
|
|
119
|
-
name: "JetBrains (Copilot Plugin)",
|
|
120
|
-
configKey: "mcpServers",
|
|
121
|
-
requiresType: false,
|
|
122
|
-
requiresCmdWrapper: false,
|
|
123
|
-
scopes: {
|
|
124
|
-
global: [
|
|
125
|
-
path.join(HOME, ".config", "github-copilot", "intellij", "mcp.json"),
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
export { IS_WINDOWS };
|
|
131
|
-
//# sourceMappingURL=ide-configs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ide-configs.js","sourceRoot":"","sources":["../../../src/installer/ide-configs.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,oDAAoD;AACpD,+EAA+E;AAE/E,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;AAC1B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAClE,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAChD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAkB7C,MAAM,CAAC,MAAM,WAAW,GAAkC;IACtD,mEAAmE;IACnE,MAAM,EAAE;QACJ,IAAI,EAAE,mBAAmB;QACzB,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,IAAI;QAClB,kBAAkB,EAAE,KAAK;QACzB,MAAM,EAAE;YACJ,MAAM,EAAE;gBACJ,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC;gBAC9C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC;aACzC;YACD,SAAS,EAAE,CAAC,SAAS,CAAC;SACzB;KACJ;IACD,MAAM,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,YAAY;QACvB,YAAY,EAAE,KAAK;QACnB,kBAAkB,EAAE,KAAK;QACzB,MAAM,EAAE;YACJ,MAAM,EAAE;gBACJ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC;gBACtC,IAAI,CA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EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,CAAC;aACvE;SACJ;KACJ;CACJ,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ide-detector.d.ts","sourceRoot":"","sources":["../../../src/installer/ide-detector.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAiChD"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Engram MCP Server — IDE Environment Detection
|
|
3
|
-
// ============================================================================
|
|
4
|
-
/**
|
|
5
|
-
* Detect the current IDE from environment variables.
|
|
6
|
-
* Returns the IDE key (e.g., "vscode", "cursor") or null if unknown.
|
|
7
|
-
*/
|
|
8
|
-
export function detectCurrentIde() {
|
|
9
|
-
const env = process.env;
|
|
10
|
-
// ─── Claude Code (checked first — sets explicit env vars) ────────
|
|
11
|
-
if (env.CLAUDE_CODE || env.CLAUDE_CLI)
|
|
12
|
-
return "claudecode";
|
|
13
|
-
// ─── VS Code family detection ────────────────────────────────────
|
|
14
|
-
// Antigravity and Windsurf are VS Code forks, so their signals are
|
|
15
|
-
// only meaningful inside a VS Code family environment.
|
|
16
|
-
if (env.TERM_PROGRAM === "vscode" || env.VSCODE_IPC_HOOK || env.VSCODE_CWD) {
|
|
17
|
-
// Explicit fork-specific signals (most reliable)
|
|
18
|
-
if (env.ANTIGRAVITY_EDITOR_APP_ROOT)
|
|
19
|
-
return "antigravity";
|
|
20
|
-
if (env.WINDSURF_PROFILE)
|
|
21
|
-
return "windsurf";
|
|
22
|
-
// Disambiguate via install path in VSCODE_CWD
|
|
23
|
-
const cwdLower = (env.VSCODE_CWD || "").toLowerCase();
|
|
24
|
-
if (cwdLower.includes("antigravity"))
|
|
25
|
-
return "antigravity";
|
|
26
|
-
if (cwdLower.includes("cursor"))
|
|
27
|
-
return "cursor";
|
|
28
|
-
if (cwdLower.includes("windsurf"))
|
|
29
|
-
return "windsurf";
|
|
30
|
-
// Disambiguate via PATH
|
|
31
|
-
const pathLower = (env.PATH || "").toLowerCase();
|
|
32
|
-
if (pathLower.includes("antigravity"))
|
|
33
|
-
return "antigravity";
|
|
34
|
-
if (pathLower.includes("cursor"))
|
|
35
|
-
return "cursor";
|
|
36
|
-
if (pathLower.includes("windsurf"))
|
|
37
|
-
return "windsurf";
|
|
38
|
-
return "vscode";
|
|
39
|
-
}
|
|
40
|
-
// ─── JetBrains detection ─────────────────────────────────────────
|
|
41
|
-
if (env.JETBRAINS_IDE || env.TERMINAL_EMULATOR?.includes("JetBrains"))
|
|
42
|
-
return "jetbrains";
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=ide-detector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ide-detector.js","sourceRoot":"","sources":["../../../src/installer/ide-detector.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gDAAgD;AAChD,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAExB,oEAAoE;IACpE,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,UAAU;QAAE,OAAO,YAAY,CAAC;IAE3D,oEAAoE;IACpE,mEAAmE;IACnE,uDAAuD;IACvD,IAAI,GAAG,CAAC,YAAY,KAAK,QAAQ,IAAI,GAAG,CAAC,eAAe,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;QACzE,iDAAiD;QACjD,IAAI,GAAG,CAAC,2BAA2B;YAAE,OAAO,aAAa,CAAC;QAC1D,IAAI,GAAG,CAAC,gBAAgB;YAAE,OAAO,UAAU,CAAC;QAE5C,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACtD,IAA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