@agentmemory/agentmemory 0.9.22 → 0.9.24
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/AGENTS.md +7 -2
- package/README.md +144 -32
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +42 -25
- package/dist/cli.mjs.map +1 -1
- package/dist/{connect-BQQXpyDS.mjs → connect-Cf9bmBqO.mjs} +290 -33
- package/dist/connect-Cf9bmBqO.mjs.map +1 -0
- package/dist/hooks/notification.mjs +46 -21
- package/dist/hooks/notification.mjs.map +1 -1
- package/dist/hooks/post-tool-failure.mjs +47 -21
- package/dist/hooks/post-tool-failure.mjs.map +1 -1
- package/dist/hooks/post-tool-use.mjs +57 -22
- package/dist/hooks/post-tool-use.mjs.map +1 -1
- package/dist/hooks/pre-compact.mjs +26 -2
- package/dist/hooks/pre-compact.mjs.map +1 -1
- package/dist/hooks/pre-tool-use.mjs +19 -12
- package/dist/hooks/pre-tool-use.mjs.map +1 -1
- package/dist/hooks/prompt-submit.mjs +39 -16
- package/dist/hooks/prompt-submit.mjs.map +1 -1
- package/dist/hooks/session-end.mjs +26 -33
- package/dist/hooks/session-end.mjs.map +1 -1
- package/dist/hooks/session-start.mjs +28 -3
- package/dist/hooks/session-start.mjs.map +1 -1
- package/dist/hooks/stop.mjs +14 -17
- package/dist/hooks/stop.mjs.map +1 -1
- package/dist/hooks/subagent-start.mjs +31 -4
- package/dist/hooks/subagent-start.mjs.map +1 -1
- package/dist/hooks/subagent-stop.mjs +45 -20
- package/dist/hooks/subagent-stop.mjs.map +1 -1
- package/dist/hooks/task-completed.mjs +44 -21
- package/dist/hooks/task-completed.mjs.map +1 -1
- package/dist/iii-config.docker.yaml +3 -2
- package/dist/iii-config.yaml +11 -2
- package/dist/index.mjs +336 -57
- package/dist/index.mjs.map +1 -1
- package/dist/{src-gpTAJuBy.mjs → src-B8J9Exum.mjs} +323 -58
- package/dist/src-B8J9Exum.mjs.map +1 -0
- package/dist/{standalone-C4i7ktpn.mjs → standalone-CPfsVTBA.mjs} +92 -11
- package/dist/standalone-CPfsVTBA.mjs.map +1 -0
- package/dist/standalone.mjs +94 -9
- package/dist/standalone.mjs.map +1 -1
- package/dist/{tools-registry-B7Y6nJsr.mjs → tools-registry-DJizX9Az.mjs} +16 -2
- package/dist/tools-registry-DJizX9Az.mjs.map +1 -0
- package/dist/version-BWEBnKAp.mjs +6 -0
- package/dist/version-BWEBnKAp.mjs.map +1 -0
- package/dist/viewer/index.html +9 -2
- package/iii-config.docker.yaml +3 -2
- package/iii-config.yaml +11 -2
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +2 -2
- package/plugin/.codex-plugin/plugin.json +2 -2
- package/plugin/.mcp.copilot.json +15 -0
- package/plugin/hooks/hooks.copilot.json +72 -0
- package/plugin/plugin.json +15 -0
- package/plugin/scripts/notification.mjs +46 -21
- package/plugin/scripts/notification.mjs.map +1 -1
- package/plugin/scripts/post-tool-failure.mjs +47 -21
- package/plugin/scripts/post-tool-failure.mjs.map +1 -1
- package/plugin/scripts/post-tool-use.mjs +57 -22
- package/plugin/scripts/post-tool-use.mjs.map +1 -1
- package/plugin/scripts/pre-compact.mjs +26 -2
- package/plugin/scripts/pre-compact.mjs.map +1 -1
- package/plugin/scripts/pre-tool-use.mjs +19 -12
- package/plugin/scripts/pre-tool-use.mjs.map +1 -1
- package/plugin/scripts/prompt-submit.mjs +39 -16
- package/plugin/scripts/prompt-submit.mjs.map +1 -1
- package/plugin/scripts/session-end.mjs +26 -33
- package/plugin/scripts/session-end.mjs.map +1 -1
- package/plugin/scripts/session-start.mjs +28 -3
- package/plugin/scripts/session-start.mjs.map +1 -1
- package/plugin/scripts/stop.mjs +14 -17
- package/plugin/scripts/stop.mjs.map +1 -1
- package/plugin/scripts/subagent-start.mjs +31 -4
- package/plugin/scripts/subagent-start.mjs.map +1 -1
- package/plugin/scripts/subagent-stop.mjs +45 -20
- package/plugin/scripts/subagent-stop.mjs.map +1 -1
- package/plugin/scripts/task-completed.mjs +44 -21
- package/plugin/scripts/task-completed.mjs.map +1 -1
- package/dist/connect-BQQXpyDS.mjs.map +0 -1
- package/dist/src-gpTAJuBy.mjs.map +0 -1
- package/dist/standalone-C4i7ktpn.mjs.map +0 -1
- package/dist/tools-registry-B7Y6nJsr.mjs.map +0 -1
- package/dist/version-DvQMNbEH.mjs +0 -6
- package/dist/version-DvQMNbEH.mjs.map +0 -1
|
@@ -32,6 +32,30 @@ const AGENTMEMORY_MCP_BLOCK = {
|
|
|
32
32
|
AGENTMEMORY_TOOLS: "${AGENTMEMORY_TOOLS:-all}"
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
+
const COPILOT_MCP_COMMAND = process.platform === "win32" ? {
|
|
36
|
+
command: process.env["ComSpec"] || process.env["COMSPEC"] || "cmd.exe",
|
|
37
|
+
args: [
|
|
38
|
+
"/d",
|
|
39
|
+
"/s",
|
|
40
|
+
"/c",
|
|
41
|
+
"npx",
|
|
42
|
+
"-y",
|
|
43
|
+
"@agentmemory/mcp"
|
|
44
|
+
]
|
|
45
|
+
} : {
|
|
46
|
+
command: "npx",
|
|
47
|
+
args: ["-y", "@agentmemory/mcp"]
|
|
48
|
+
};
|
|
49
|
+
const AGENTMEMORY_COPILOT_MCP_BLOCK = {
|
|
50
|
+
type: "local",
|
|
51
|
+
...COPILOT_MCP_COMMAND,
|
|
52
|
+
env: {
|
|
53
|
+
AGENTMEMORY_URL: "${AGENTMEMORY_URL:-http://localhost:3111}",
|
|
54
|
+
AGENTMEMORY_SECRET: "${AGENTMEMORY_SECRET:-}",
|
|
55
|
+
AGENTMEMORY_TOOLS: "${AGENTMEMORY_TOOLS:-all}"
|
|
56
|
+
},
|
|
57
|
+
tools: ["*"]
|
|
58
|
+
};
|
|
35
59
|
function backupsDir() {
|
|
36
60
|
return join(homedir(), ".agentmemory", "backups");
|
|
37
61
|
}
|
|
@@ -76,13 +100,14 @@ function logBackup(target) {
|
|
|
76
100
|
|
|
77
101
|
//#endregion
|
|
78
102
|
//#region src/cli/connect/json-mcp-adapter.ts
|
|
79
|
-
function entryMatches$
|
|
103
|
+
function entryMatches$2(entry) {
|
|
80
104
|
if (!entry || typeof entry !== "object") return false;
|
|
81
105
|
const e = entry;
|
|
82
106
|
if (e["command"] !== "npx") return false;
|
|
83
107
|
return (Array.isArray(e["args"]) ? e["args"] : []).includes("@agentmemory/mcp");
|
|
84
108
|
}
|
|
85
109
|
function createJsonMcpAdapter(config) {
|
|
110
|
+
const wrapperKey = config.wrapperKey ?? "mcpServers";
|
|
86
111
|
return {
|
|
87
112
|
name: config.name,
|
|
88
113
|
displayName: config.displayName,
|
|
@@ -94,8 +119,8 @@ function createJsonMcpAdapter(config) {
|
|
|
94
119
|
async install(opts) {
|
|
95
120
|
const existing = readJsonSafe(config.configPath);
|
|
96
121
|
const next = existing ? { ...existing } : {};
|
|
97
|
-
const servers = { ...next
|
|
98
|
-
const alreadyHas = entryMatches$
|
|
122
|
+
const servers = { ...next[wrapperKey] ?? {} };
|
|
123
|
+
const alreadyHas = entryMatches$2(servers["agentmemory"]);
|
|
99
124
|
if (alreadyHas && !opts.force) {
|
|
100
125
|
logAlreadyWired(config.displayName, config.configPath);
|
|
101
126
|
return {
|
|
@@ -104,7 +129,7 @@ function createJsonMcpAdapter(config) {
|
|
|
104
129
|
};
|
|
105
130
|
}
|
|
106
131
|
if (opts.dryRun) {
|
|
107
|
-
p.log.info(`[dry-run] Would ${alreadyHas ? "overwrite" : "add"}
|
|
132
|
+
p.log.info(`[dry-run] Would ${alreadyHas ? "overwrite" : "add"} ${wrapperKey}.agentmemory in ${config.configPath}`);
|
|
108
133
|
return {
|
|
109
134
|
kind: "installed",
|
|
110
135
|
mutatedPath: config.configPath
|
|
@@ -115,11 +140,15 @@ function createJsonMcpAdapter(config) {
|
|
|
115
140
|
backupPath = backupFile(config.configPath, config.name);
|
|
116
141
|
logBackup(backupPath);
|
|
117
142
|
} else mkdirSync(dirname(config.configPath), { recursive: true });
|
|
118
|
-
servers["agentmemory"] =
|
|
119
|
-
|
|
143
|
+
servers["agentmemory"] = {
|
|
144
|
+
...AGENTMEMORY_MCP_BLOCK,
|
|
145
|
+
...config.extraEntryFields ?? {}
|
|
146
|
+
};
|
|
147
|
+
next[wrapperKey] = servers;
|
|
120
148
|
writeJsonAtomic(config.configPath, next);
|
|
121
|
-
|
|
122
|
-
|
|
149
|
+
const verifyServers = readJsonSafe(config.configPath)?.[wrapperKey];
|
|
150
|
+
if (!entryMatches$2(verifyServers?.["agentmemory"])) {
|
|
151
|
+
p.log.error(`Verification failed: ${config.configPath} did not contain ${wrapperKey}.agentmemory after write.`);
|
|
123
152
|
return {
|
|
124
153
|
kind: "skipped",
|
|
125
154
|
reason: "verification-failed"
|
|
@@ -138,7 +167,7 @@ function createJsonMcpAdapter(config) {
|
|
|
138
167
|
//#endregion
|
|
139
168
|
//#region src/cli/connect/antigravity.ts
|
|
140
169
|
const ANTIGRAVITY_DIR = platform() === "darwin" ? join(homedir(), "Library", "Application Support", "Antigravity", "User") : join(homedir(), ".config", "Antigravity", "User");
|
|
141
|
-
const adapter$
|
|
170
|
+
const adapter$16 = createJsonMcpAdapter({
|
|
142
171
|
name: "antigravity",
|
|
143
172
|
displayName: "Antigravity",
|
|
144
173
|
detectDir: ANTIGRAVITY_DIR,
|
|
@@ -200,7 +229,11 @@ function buildMergedHooks(existing, pluginRoot, manifestFile = "hooks.codex.json
|
|
|
200
229
|
return out;
|
|
201
230
|
}
|
|
202
231
|
function isAgentmemoryEntry(entry, scriptsDir) {
|
|
203
|
-
|
|
232
|
+
const normalizedScriptsDir = normalizePathForCommandMatch(scriptsDir);
|
|
233
|
+
return entry.hooks.some((handler) => normalizePathForCommandMatch(handler.command).includes(normalizedScriptsDir));
|
|
234
|
+
}
|
|
235
|
+
function normalizePathForCommandMatch(value) {
|
|
236
|
+
return value.replace(/\\/g, "/");
|
|
204
237
|
}
|
|
205
238
|
|
|
206
239
|
//#endregion
|
|
@@ -208,13 +241,13 @@ function isAgentmemoryEntry(entry, scriptsDir) {
|
|
|
208
241
|
const CLAUDE_DIR = join(homedir(), ".claude");
|
|
209
242
|
const CLAUDE_JSON = join(homedir(), ".claude.json");
|
|
210
243
|
const CLAUDE_SETTINGS = join(CLAUDE_DIR, "settings.json");
|
|
211
|
-
function entryMatches(entry) {
|
|
244
|
+
function entryMatches$1(entry) {
|
|
212
245
|
if (!entry || typeof entry !== "object") return false;
|
|
213
246
|
const e = entry;
|
|
214
247
|
if (e["command"] !== "npx") return false;
|
|
215
248
|
return (Array.isArray(e["args"]) ? e["args"] : []).includes("@agentmemory/mcp");
|
|
216
249
|
}
|
|
217
|
-
const adapter$
|
|
250
|
+
const adapter$15 = {
|
|
218
251
|
name: "claude-code",
|
|
219
252
|
displayName: "Claude Code",
|
|
220
253
|
docs: "https://github.com/rohitg00/agentmemory#claude-code-one-block-paste-it",
|
|
@@ -226,7 +259,7 @@ const adapter$9 = {
|
|
|
226
259
|
const existing = readJsonSafe(CLAUDE_JSON);
|
|
227
260
|
const next = existing ? { ...existing } : {};
|
|
228
261
|
const servers = { ...next.mcpServers ?? {} };
|
|
229
|
-
const alreadyHas = entryMatches(servers["agentmemory"]);
|
|
262
|
+
const alreadyHas = entryMatches$1(servers["agentmemory"]);
|
|
230
263
|
if (alreadyHas && !opts.force) {
|
|
231
264
|
logAlreadyWired("Claude Code", CLAUDE_JSON);
|
|
232
265
|
if (opts.withHooks) {
|
|
@@ -256,7 +289,7 @@ const adapter$9 = {
|
|
|
256
289
|
servers["agentmemory"] = AGENTMEMORY_MCP_BLOCK;
|
|
257
290
|
next.mcpServers = servers;
|
|
258
291
|
writeJsonAtomic(CLAUDE_JSON, next);
|
|
259
|
-
if (!entryMatches(readJsonSafe(CLAUDE_JSON)?.mcpServers?.["agentmemory"])) {
|
|
292
|
+
if (!entryMatches$1(readJsonSafe(CLAUDE_JSON)?.mcpServers?.["agentmemory"])) {
|
|
260
293
|
p.log.error(`Verification failed: ${CLAUDE_JSON} did not contain mcpServers.agentmemory after write.`);
|
|
261
294
|
return {
|
|
262
295
|
kind: "skipped",
|
|
@@ -324,6 +357,77 @@ function installClaudeHooks(opts) {
|
|
|
324
357
|
};
|
|
325
358
|
}
|
|
326
359
|
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/cli/connect/cline.ts
|
|
362
|
+
const adapter$14 = createJsonMcpAdapter({
|
|
363
|
+
name: "cline",
|
|
364
|
+
displayName: "Cline",
|
|
365
|
+
detectDir: join(homedir(), ".cline"),
|
|
366
|
+
configPath: join(homedir(), ".cline", "mcp.json"),
|
|
367
|
+
docs: "https://github.com/rohitg00/agentmemory#other-agents",
|
|
368
|
+
protocolNote: "→ Using MCP via ~/.cline/mcp.json (CLI). VS Code users: add the same block via Cline Settings → MCP Servers → Edit JSON."
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/cli/connect/copilot-cli.ts
|
|
373
|
+
const COPILOT_DIR = process.env["COPILOT_HOME"] || join(homedir(), ".copilot");
|
|
374
|
+
const COPILOT_MCP_JSON = join(COPILOT_DIR, "mcp-config.json");
|
|
375
|
+
function entryMatches(entry) {
|
|
376
|
+
if (!entry || typeof entry !== "object") return false;
|
|
377
|
+
return JSON.stringify(entry) === JSON.stringify(AGENTMEMORY_COPILOT_MCP_BLOCK);
|
|
378
|
+
}
|
|
379
|
+
const adapter$13 = {
|
|
380
|
+
name: "copilot-cli",
|
|
381
|
+
displayName: "GitHub Copilot CLI",
|
|
382
|
+
docs: "https://github.com/rohitg00/agentmemory#github-copilot-cli",
|
|
383
|
+
protocolNote: "→ Using MCP. Install the plugin too for full hooks/skills coverage.",
|
|
384
|
+
detect() {
|
|
385
|
+
return existsSync(COPILOT_DIR);
|
|
386
|
+
},
|
|
387
|
+
async install(opts) {
|
|
388
|
+
const existing = readJsonSafe(COPILOT_MCP_JSON);
|
|
389
|
+
const next = existing ? { ...existing } : {};
|
|
390
|
+
const servers = { ...next.mcpServers ?? {} };
|
|
391
|
+
const alreadyHas = entryMatches(servers["agentmemory"]);
|
|
392
|
+
if (alreadyHas && !opts.force) {
|
|
393
|
+
logAlreadyWired("GitHub Copilot CLI", COPILOT_MCP_JSON);
|
|
394
|
+
return {
|
|
395
|
+
kind: "already-wired",
|
|
396
|
+
mutatedPath: COPILOT_MCP_JSON
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
if (opts.dryRun) {
|
|
400
|
+
p.log.info(`[dry-run] Would ${alreadyHas ? "overwrite" : "add"} mcpServers.agentmemory in ${COPILOT_MCP_JSON}`);
|
|
401
|
+
return {
|
|
402
|
+
kind: "installed",
|
|
403
|
+
mutatedPath: COPILOT_MCP_JSON
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
let backupPath;
|
|
407
|
+
if (existsSync(COPILOT_MCP_JSON)) {
|
|
408
|
+
backupPath = backupFile(COPILOT_MCP_JSON, "copilot-cli");
|
|
409
|
+
logBackup(backupPath);
|
|
410
|
+
} else mkdirSync(dirname(COPILOT_MCP_JSON), { recursive: true });
|
|
411
|
+
servers["agentmemory"] = AGENTMEMORY_COPILOT_MCP_BLOCK;
|
|
412
|
+
next.mcpServers = servers;
|
|
413
|
+
writeJsonAtomic(COPILOT_MCP_JSON, next);
|
|
414
|
+
if (!entryMatches(readJsonSafe(COPILOT_MCP_JSON)?.mcpServers?.["agentmemory"])) {
|
|
415
|
+
p.log.error(`Verification failed: ${COPILOT_MCP_JSON} did not contain mcpServers.agentmemory after write.`);
|
|
416
|
+
return {
|
|
417
|
+
kind: "skipped",
|
|
418
|
+
reason: "verification-failed"
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
logInstalled("GitHub Copilot CLI", COPILOT_MCP_JSON);
|
|
422
|
+
p.log.info("Copilot picks up MCP servers on next launch or after `/mcp`. Install the plugin too for full hooks/skills.");
|
|
423
|
+
return {
|
|
424
|
+
kind: "installed",
|
|
425
|
+
mutatedPath: COPILOT_MCP_JSON,
|
|
426
|
+
...backupPath !== void 0 && { backupPath }
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
|
|
327
431
|
//#endregion
|
|
328
432
|
//#region src/cli/connect/codex.ts
|
|
329
433
|
const CODEX_DIR = join(homedir(), ".codex");
|
|
@@ -355,7 +459,7 @@ function stripExistingBlock(toml) {
|
|
|
355
459
|
}
|
|
356
460
|
return out.join("\n").replace(/\n{3,}$/, "\n\n").trimEnd() + "\n";
|
|
357
461
|
}
|
|
358
|
-
const adapter$
|
|
462
|
+
const adapter$12 = {
|
|
359
463
|
name: "codex",
|
|
360
464
|
displayName: "Codex CLI",
|
|
361
465
|
docs: "https://github.com/rohitg00/agentmemory#codex-cli-codex-plugin-platform",
|
|
@@ -449,9 +553,118 @@ function installCodexHooks(opts) {
|
|
|
449
553
|
};
|
|
450
554
|
}
|
|
451
555
|
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region src/cli/connect/continue.ts
|
|
558
|
+
const CONTINUE_DIR = join(homedir(), ".continue");
|
|
559
|
+
const YAML_PATH = join(CONTINUE_DIR, "config.yaml");
|
|
560
|
+
const JSON_PATH = join(CONTINUE_DIR, "config.json");
|
|
561
|
+
function buildEntry() {
|
|
562
|
+
return {
|
|
563
|
+
name: "agentmemory",
|
|
564
|
+
command: AGENTMEMORY_MCP_BLOCK.command,
|
|
565
|
+
args: [...AGENTMEMORY_MCP_BLOCK.args],
|
|
566
|
+
env: { ...AGENTMEMORY_MCP_BLOCK.env }
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
function entryIsAgentmemory(entry) {
|
|
570
|
+
if (!entry) return false;
|
|
571
|
+
return entry.name === "agentmemory" && entry.args.includes("@agentmemory/mcp");
|
|
572
|
+
}
|
|
573
|
+
function renderFreshYaml() {
|
|
574
|
+
const e = buildEntry();
|
|
575
|
+
const envLines = Object.entries(e.env ?? {}).map(([k, v]) => ` ${k}: "${v}"`).join("\n");
|
|
576
|
+
return [
|
|
577
|
+
"mcpServers:",
|
|
578
|
+
` - name: ${e.name}`,
|
|
579
|
+
` command: ${e.command}`,
|
|
580
|
+
" args:",
|
|
581
|
+
...e.args.map((a) => ` - "${a}"`),
|
|
582
|
+
" env:",
|
|
583
|
+
envLines,
|
|
584
|
+
""
|
|
585
|
+
].join("\n");
|
|
586
|
+
}
|
|
587
|
+
const adapter$11 = {
|
|
588
|
+
name: "continue",
|
|
589
|
+
displayName: "Continue",
|
|
590
|
+
docs: "https://github.com/rohitg00/agentmemory#other-agents",
|
|
591
|
+
protocolNote: "→ Using MCP via ~/.continue/config.yaml (preferred) or config.json (legacy, only when no yaml).",
|
|
592
|
+
detect() {
|
|
593
|
+
return existsSync(CONTINUE_DIR);
|
|
594
|
+
},
|
|
595
|
+
async install(opts) {
|
|
596
|
+
const yamlExists = existsSync(YAML_PATH);
|
|
597
|
+
const jsonExists = existsSync(JSON_PATH);
|
|
598
|
+
if (yamlExists) {
|
|
599
|
+
const manual = `\nMerge this block into ~/.continue/config.yaml (the snippet already includes the top-level mcpServers key — if your config already has a mcpServers list, append the agentmemory entry to it instead of duplicating the key):\n\n${renderFreshYaml().split("\n").map((l) => l ? ` ${l}` : l).join("\n")}`;
|
|
600
|
+
p.log.info(`Continue: ${YAML_PATH} already exists. Manual edit needed.${manual}`);
|
|
601
|
+
return {
|
|
602
|
+
kind: "stub",
|
|
603
|
+
reason: "config.yaml-needs-manual-edit"
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
if (jsonExists) {
|
|
607
|
+
const existing = readJsonSafe(JSON_PATH);
|
|
608
|
+
const next = existing ? { ...existing } : {};
|
|
609
|
+
const servers = Array.isArray(next.mcpServers) ? [...next.mcpServers] : [];
|
|
610
|
+
const idx = servers.findIndex((s) => s?.name === "agentmemory");
|
|
611
|
+
const alreadyHas = idx >= 0 && entryIsAgentmemory(servers[idx]);
|
|
612
|
+
if (alreadyHas && !opts.force) {
|
|
613
|
+
logAlreadyWired("Continue", JSON_PATH);
|
|
614
|
+
return {
|
|
615
|
+
kind: "already-wired",
|
|
616
|
+
mutatedPath: JSON_PATH
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
if (opts.dryRun) {
|
|
620
|
+
p.log.info(`[dry-run] Would ${alreadyHas ? "overwrite" : "add"} mcpServers[agentmemory] in ${JSON_PATH}`);
|
|
621
|
+
return {
|
|
622
|
+
kind: "installed",
|
|
623
|
+
mutatedPath: JSON_PATH
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
const backupPath = backupFile(JSON_PATH, "continue");
|
|
627
|
+
logBackup(backupPath);
|
|
628
|
+
const entry = buildEntry();
|
|
629
|
+
if (idx >= 0) servers[idx] = entry;
|
|
630
|
+
else servers.push(entry);
|
|
631
|
+
next.mcpServers = servers;
|
|
632
|
+
writeJsonAtomic(JSON_PATH, next);
|
|
633
|
+
const verifyEntry = readJsonSafe(JSON_PATH)?.mcpServers?.find((s) => s?.name === "agentmemory");
|
|
634
|
+
if (!entryIsAgentmemory(verifyEntry)) {
|
|
635
|
+
p.log.error(`Verification failed: ${JSON_PATH} did not contain mcpServers[agentmemory] after write.`);
|
|
636
|
+
return {
|
|
637
|
+
kind: "skipped",
|
|
638
|
+
reason: "verification-failed"
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
logInstalled("Continue (legacy config.json)", JSON_PATH);
|
|
642
|
+
return {
|
|
643
|
+
kind: "installed",
|
|
644
|
+
mutatedPath: JSON_PATH,
|
|
645
|
+
backupPath
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
if (opts.dryRun) {
|
|
649
|
+
p.log.info(`[dry-run] Would create ${YAML_PATH} with agentmemory entry`);
|
|
650
|
+
return {
|
|
651
|
+
kind: "installed",
|
|
652
|
+
mutatedPath: YAML_PATH
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
mkdirSync(dirname(YAML_PATH), { recursive: true });
|
|
656
|
+
writeFileSync(YAML_PATH, renderFreshYaml(), "utf-8");
|
|
657
|
+
logInstalled("Continue", YAML_PATH);
|
|
658
|
+
return {
|
|
659
|
+
kind: "installed",
|
|
660
|
+
mutatedPath: YAML_PATH
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
|
|
452
665
|
//#endregion
|
|
453
666
|
//#region src/cli/connect/cursor.ts
|
|
454
|
-
const adapter$
|
|
667
|
+
const adapter$10 = createJsonMcpAdapter({
|
|
455
668
|
name: "cursor",
|
|
456
669
|
displayName: "Cursor",
|
|
457
670
|
detectDir: join(homedir(), ".cursor"),
|
|
@@ -460,9 +673,21 @@ const adapter$7 = createJsonMcpAdapter({
|
|
|
460
673
|
protocolNote: "→ Using MCP (the only protocol Cursor speaks). Memory bridge runs at :3111 underneath."
|
|
461
674
|
});
|
|
462
675
|
|
|
676
|
+
//#endregion
|
|
677
|
+
//#region src/cli/connect/droid.ts
|
|
678
|
+
const adapter$9 = createJsonMcpAdapter({
|
|
679
|
+
name: "droid",
|
|
680
|
+
displayName: "Droid (Factory.ai)",
|
|
681
|
+
detectDir: join(homedir(), ".factory"),
|
|
682
|
+
configPath: join(homedir(), ".factory", "mcp.json"),
|
|
683
|
+
docs: "https://github.com/rohitg00/agentmemory#other-agents",
|
|
684
|
+
protocolNote: "→ Using MCP via ~/.factory/mcp.json. The `/mcp` slash command inside droid lists configured servers.",
|
|
685
|
+
extraEntryFields: { type: "stdio" }
|
|
686
|
+
});
|
|
687
|
+
|
|
463
688
|
//#endregion
|
|
464
689
|
//#region src/cli/connect/gemini-cli.ts
|
|
465
|
-
const adapter$
|
|
690
|
+
const adapter$8 = createJsonMcpAdapter({
|
|
466
691
|
name: "gemini-cli",
|
|
467
692
|
displayName: "Gemini CLI",
|
|
468
693
|
detectDir: join(homedir(), ".gemini"),
|
|
@@ -476,7 +701,7 @@ const adapter$6 = createJsonMcpAdapter({
|
|
|
476
701
|
const HERMES_DIR = join(homedir(), ".hermes");
|
|
477
702
|
const HERMES_CONFIG = join(HERMES_DIR, "config.yaml");
|
|
478
703
|
const DOCS$2 = "https://github.com/rohitg00/agentmemory/tree/main/integrations/hermes";
|
|
479
|
-
const adapter$
|
|
704
|
+
const adapter$7 = {
|
|
480
705
|
name: "hermes",
|
|
481
706
|
displayName: "Hermes Agent",
|
|
482
707
|
docs: DOCS$2,
|
|
@@ -508,7 +733,7 @@ const adapter$5 = {
|
|
|
508
733
|
|
|
509
734
|
//#endregion
|
|
510
735
|
//#region src/cli/connect/kiro.ts
|
|
511
|
-
const adapter$
|
|
736
|
+
const adapter$6 = createJsonMcpAdapter({
|
|
512
737
|
name: "kiro",
|
|
513
738
|
displayName: "Kiro",
|
|
514
739
|
detectDir: join(homedir(), ".kiro"),
|
|
@@ -519,7 +744,7 @@ const adapter$4 = createJsonMcpAdapter({
|
|
|
519
744
|
|
|
520
745
|
//#endregion
|
|
521
746
|
//#region src/cli/connect/openclaw.ts
|
|
522
|
-
const adapter$
|
|
747
|
+
const adapter$5 = createJsonMcpAdapter({
|
|
523
748
|
name: "openclaw",
|
|
524
749
|
displayName: "OpenClaw",
|
|
525
750
|
detectDir: join(homedir(), ".openclaw"),
|
|
@@ -532,7 +757,7 @@ const adapter$3 = createJsonMcpAdapter({
|
|
|
532
757
|
//#region src/cli/connect/openhuman.ts
|
|
533
758
|
const OPENHUMAN_DIR = join(homedir(), ".openhuman");
|
|
534
759
|
const DOCS$1 = "https://github.com/tinyhumansai/openhuman";
|
|
535
|
-
const adapter$
|
|
760
|
+
const adapter$4 = {
|
|
536
761
|
name: "openhuman",
|
|
537
762
|
displayName: "OpenHuman",
|
|
538
763
|
docs: DOCS$1,
|
|
@@ -562,7 +787,7 @@ const adapter$2 = {
|
|
|
562
787
|
const PI_DIR = join(homedir(), ".pi");
|
|
563
788
|
const PI_EXT_DIR = join(PI_DIR, "agent", "extensions", "agentmemory");
|
|
564
789
|
const DOCS = "https://github.com/rohitg00/agentmemory/tree/main/integrations/pi";
|
|
565
|
-
const adapter$
|
|
790
|
+
const adapter$3 = {
|
|
566
791
|
name: "pi",
|
|
567
792
|
displayName: "pi",
|
|
568
793
|
docs: DOCS,
|
|
@@ -593,7 +818,7 @@ const adapter$1 = {
|
|
|
593
818
|
|
|
594
819
|
//#endregion
|
|
595
820
|
//#region src/cli/connect/qwen.ts
|
|
596
|
-
const adapter = createJsonMcpAdapter({
|
|
821
|
+
const adapter$2 = createJsonMcpAdapter({
|
|
597
822
|
name: "qwen",
|
|
598
823
|
displayName: "Qwen Code",
|
|
599
824
|
detectDir: join(homedir(), ".qwen"),
|
|
@@ -602,6 +827,30 @@ const adapter = createJsonMcpAdapter({
|
|
|
602
827
|
protocolNote: "→ Using MCP via ~/.qwen/settings.json. Qwen Code's hook system can also be wired separately — see docs."
|
|
603
828
|
});
|
|
604
829
|
|
|
830
|
+
//#endregion
|
|
831
|
+
//#region src/cli/connect/warp.ts
|
|
832
|
+
const adapter$1 = createJsonMcpAdapter({
|
|
833
|
+
name: "warp",
|
|
834
|
+
displayName: "Warp",
|
|
835
|
+
detectDir: join(homedir(), ".warp"),
|
|
836
|
+
configPath: join(homedir(), ".warp", ".mcp.json"),
|
|
837
|
+
docs: "https://github.com/rohitg00/agentmemory#other-agents",
|
|
838
|
+
protocolNote: "→ Using MCP via ~/.warp/.mcp.json. Skills auto-discover from .claude/skills/ if the Claude Code plugin is also installed."
|
|
839
|
+
});
|
|
840
|
+
|
|
841
|
+
//#endregion
|
|
842
|
+
//#region src/cli/connect/zed.ts
|
|
843
|
+
const zedConfigDir = join(homedir(), ".config", "zed");
|
|
844
|
+
const adapter = createJsonMcpAdapter({
|
|
845
|
+
name: "zed",
|
|
846
|
+
displayName: "Zed",
|
|
847
|
+
detectDir: zedConfigDir,
|
|
848
|
+
configPath: join(zedConfigDir, "settings.json"),
|
|
849
|
+
wrapperKey: "context_servers",
|
|
850
|
+
docs: "https://github.com/rohitg00/agentmemory#other-agents",
|
|
851
|
+
protocolNote: "→ Using MCP via ~/.config/zed/settings.json (key: context_servers)."
|
|
852
|
+
});
|
|
853
|
+
|
|
605
854
|
//#endregion
|
|
606
855
|
//#region src/cli/connect/index.ts
|
|
607
856
|
var connect_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -612,17 +861,23 @@ var connect_exports = /* @__PURE__ */ __exportAll({
|
|
|
612
861
|
runConnect: () => runConnect
|
|
613
862
|
});
|
|
614
863
|
const ADAPTERS = [
|
|
615
|
-
adapter$
|
|
864
|
+
adapter$15,
|
|
865
|
+
adapter$13,
|
|
866
|
+
adapter$12,
|
|
867
|
+
adapter$10,
|
|
616
868
|
adapter$8,
|
|
617
|
-
adapter$
|
|
869
|
+
adapter$2,
|
|
870
|
+
adapter$16,
|
|
618
871
|
adapter$6,
|
|
872
|
+
adapter$1,
|
|
873
|
+
adapter$14,
|
|
874
|
+
adapter$11,
|
|
619
875
|
adapter,
|
|
620
|
-
adapter$
|
|
621
|
-
adapter$4,
|
|
622
|
-
adapter$3,
|
|
876
|
+
adapter$9,
|
|
623
877
|
adapter$5,
|
|
624
|
-
adapter$
|
|
625
|
-
adapter$
|
|
878
|
+
adapter$7,
|
|
879
|
+
adapter$3,
|
|
880
|
+
adapter$4
|
|
626
881
|
];
|
|
627
882
|
function resolveAdapter(name) {
|
|
628
883
|
const lower = name.toLowerCase();
|
|
@@ -671,13 +926,14 @@ async function runAdapter(adapter, opts) {
|
|
|
671
926
|
}
|
|
672
927
|
}
|
|
673
928
|
async function runConnect(args) {
|
|
674
|
-
|
|
929
|
+
const { dryRun, force, all, withHooks, positional } = parseFlags(args);
|
|
930
|
+
const allowWindowsAdapter = positional.length === 1 && positional[0]?.toLowerCase() === "copilot-cli";
|
|
931
|
+
if (platform() === "win32" && !allowWindowsAdapter) {
|
|
675
932
|
p.intro("agentmemory connect");
|
|
676
933
|
p.log.warn("Windows: automated `connect` is not supported yet. See https://github.com/rohitg00/agentmemory#other-agents for manual install steps.");
|
|
677
934
|
p.outro("Windows: manual install required — see docs");
|
|
678
935
|
return;
|
|
679
936
|
}
|
|
680
|
-
const { dryRun, force, all, withHooks, positional } = parseFlags(args);
|
|
681
937
|
const opts = {
|
|
682
938
|
dryRun,
|
|
683
939
|
force,
|
|
@@ -755,9 +1011,10 @@ function summarize(results) {
|
|
|
755
1011
|
p.note(lines.join("\n"), "summary");
|
|
756
1012
|
const stubs = results.filter((r) => r.result.kind === "stub");
|
|
757
1013
|
if (stubs.length > 0) p.log.info(`${stubs.length} agent(s) require manual install — see docs links above.`);
|
|
1014
|
+
if (results.some((r) => r.result.kind === "installed" || r.result.kind === "already-wired")) p.log.info("Next: install agentmemory's 8 skills into the same agent(s) so they know when to call the tools:\n npx skills add rohitg00/agentmemory -y");
|
|
758
1015
|
p.outro("Restart any wired agent (or open a new session) to pick up agentmemory.");
|
|
759
1016
|
}
|
|
760
1017
|
|
|
761
1018
|
//#endregion
|
|
762
1019
|
export { resolveAdapter as n, runAdapter as r, connect_exports as t };
|
|
763
|
-
//# sourceMappingURL=connect-
|
|
1020
|
+
//# sourceMappingURL=connect-Cf9bmBqO.mjs.map
|