conare 0.3.9 → 0.4.1
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/index.js +318 -145
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1024,7 +1024,7 @@ var import_sisteransi, import_picocolors, uD, W, tD, eD, FD = function() {
|
|
|
1024
1024
|
` && (s && o && (F += z(s)), i && (F += K(i)));
|
|
1025
1025
|
}
|
|
1026
1026
|
return F;
|
|
1027
|
-
}, xD, B, AD, S, gD, vD = (e, u, t) => (u in e) ? gD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t), A, kD, $D = (e, u, t) => (u in e) ? kD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t), SD, TD, jD = (e, u, t) => (u in e) ? TD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, U = (e, u, t) => (jD(e, typeof u != "symbol" ? u + "" : u, t), t), MD, OD, PD = (e, u, t) => (u in e) ? OD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, J = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t), LD;
|
|
1027
|
+
}, xD, B, AD, S, gD, vD = (e, u, t) => (u in e) ? gD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t), dD, A, kD, $D = (e, u, t) => (u in e) ? kD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t), SD, TD, jD = (e, u, t) => (u in e) ? TD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, U = (e, u, t) => (jD(e, typeof u != "symbol" ? u + "" : u, t), t), MD, OD, PD = (e, u, t) => (u in e) ? OD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, J = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t), LD;
|
|
1028
1028
|
var init_dist = __esm(() => {
|
|
1029
1029
|
import_sisteransi = __toESM(require_src(), 1);
|
|
1030
1030
|
import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -1076,6 +1076,23 @@ var init_dist = __esm(() => {
|
|
|
1076
1076
|
AD = globalThis.process.platform.startsWith("win");
|
|
1077
1077
|
S = Symbol("clack:cancel");
|
|
1078
1078
|
gD = Object.defineProperty;
|
|
1079
|
+
dD = class dD extends x {
|
|
1080
|
+
get cursor() {
|
|
1081
|
+
return this.value ? 0 : 1;
|
|
1082
|
+
}
|
|
1083
|
+
get _value() {
|
|
1084
|
+
return this.cursor === 0;
|
|
1085
|
+
}
|
|
1086
|
+
constructor(u) {
|
|
1087
|
+
super(u, false), this.value = !!u.initialValue, this.on("value", () => {
|
|
1088
|
+
this.value = this._value;
|
|
1089
|
+
}), this.on("confirm", (t) => {
|
|
1090
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
|
|
1091
|
+
}), this.on("cursor", () => {
|
|
1092
|
+
this.value = !this.value;
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
};
|
|
1079
1096
|
A = new WeakMap;
|
|
1080
1097
|
kD = Object.defineProperty;
|
|
1081
1098
|
SD = class extends x {
|
|
@@ -1204,7 +1221,25 @@ ${import_picocolors2.default.gray(o)}` : ""}`;
|
|
|
1204
1221
|
${import_picocolors2.default.cyan(d2)}
|
|
1205
1222
|
`;
|
|
1206
1223
|
}
|
|
1207
|
-
} }).prompt(),
|
|
1224
|
+
} }).prompt(), ye = (t) => {
|
|
1225
|
+
const n = t.active ?? "Yes", r2 = t.inactive ?? "No";
|
|
1226
|
+
return new dD({ active: n, inactive: r2, initialValue: t.initialValue ?? true, render() {
|
|
1227
|
+
const i = `${import_picocolors2.default.gray(o)}
|
|
1228
|
+
${b2(this.state)} ${t.message}
|
|
1229
|
+
`, s = this.value ? n : r2;
|
|
1230
|
+
switch (this.state) {
|
|
1231
|
+
case "submit":
|
|
1232
|
+
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
|
|
1233
|
+
case "cancel":
|
|
1234
|
+
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
|
|
1235
|
+
${import_picocolors2.default.gray(o)}`;
|
|
1236
|
+
default:
|
|
1237
|
+
return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r2)}` : `${import_picocolors2.default.green(k2)} ${r2}`}
|
|
1238
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1239
|
+
`;
|
|
1240
|
+
}
|
|
1241
|
+
} }).prompt();
|
|
1242
|
+
}, ve = (t) => {
|
|
1208
1243
|
const n = (r2, i) => {
|
|
1209
1244
|
const s = r2.label ?? String(r2.value);
|
|
1210
1245
|
switch (i) {
|
|
@@ -1476,7 +1511,7 @@ async function selectChatSources(targets) {
|
|
|
1476
1511
|
return ensureValue(await fe({
|
|
1477
1512
|
message: "Select chat sources",
|
|
1478
1513
|
required: false,
|
|
1479
|
-
initialValues: targets.filter((target) => target.
|
|
1514
|
+
initialValues: targets.filter((target) => target.available !== false).map((target) => target.id),
|
|
1480
1515
|
options: targets.map((target) => ({
|
|
1481
1516
|
value: target.id,
|
|
1482
1517
|
label: target.label,
|
|
@@ -1488,16 +1523,16 @@ async function selectMcpTargets(targets) {
|
|
|
1488
1523
|
return ensureValue(await fe({
|
|
1489
1524
|
message: "Select where to install the MCP",
|
|
1490
1525
|
required: false,
|
|
1491
|
-
initialValues: targets.filter((target) => target.
|
|
1526
|
+
initialValues: targets.filter((target) => target.available !== false).map((target) => target.id),
|
|
1492
1527
|
options: targets.map((target) => ({
|
|
1493
1528
|
value: target.id,
|
|
1494
1529
|
label: target.label,
|
|
1495
|
-
hint: target.available === false ? "not detected" : "
|
|
1530
|
+
hint: target.available === false ? "not detected" : "detected"
|
|
1496
1531
|
}))
|
|
1497
1532
|
}));
|
|
1498
1533
|
}
|
|
1499
1534
|
async function confirmIndexCodebase() {
|
|
1500
|
-
return ensureValue(await
|
|
1535
|
+
return ensureValue(await ye({
|
|
1501
1536
|
message: "Index this codebase too?",
|
|
1502
1537
|
initialValue: false
|
|
1503
1538
|
}));
|
|
@@ -1575,27 +1610,23 @@ async function countCursorSessions(dbPath) {
|
|
|
1575
1610
|
}
|
|
1576
1611
|
async function detect() {
|
|
1577
1612
|
const home = homedir();
|
|
1613
|
+
const os = platform();
|
|
1578
1614
|
const tools = [];
|
|
1579
1615
|
const claudeDir = join(home, ".claude", "projects");
|
|
1580
1616
|
if (existsSync(claudeDir)) {
|
|
1581
1617
|
const sessionCount = countJsonlFiles(claudeDir);
|
|
1582
|
-
tools.push({
|
|
1583
|
-
name: "Claude Code",
|
|
1584
|
-
available: sessionCount > 0,
|
|
1585
|
-
path: claudeDir,
|
|
1586
|
-
sessionCount
|
|
1587
|
-
});
|
|
1618
|
+
tools.push({ name: "Claude Code", id: "claude", available: sessionCount > 0, path: claudeDir, sessionCount });
|
|
1588
1619
|
} else {
|
|
1589
|
-
tools.push({ name: "Claude Code", available: false, path: claudeDir, sessionCount: 0 });
|
|
1620
|
+
tools.push({ name: "Claude Code", id: "claude", available: false, path: claudeDir, sessionCount: 0 });
|
|
1590
1621
|
}
|
|
1622
|
+
const codexConfig = join(home, ".codex", "config.toml");
|
|
1591
1623
|
const codexHistory = join(home, ".codex", "history.jsonl");
|
|
1592
1624
|
const codexSessions = join(home, ".codex", "sessions");
|
|
1593
|
-
if (existsSync(codexHistory) || existsSync(codexSessions)) {
|
|
1625
|
+
if (existsSync(codexConfig) || existsSync(codexHistory) || existsSync(codexSessions)) {
|
|
1594
1626
|
let sessionCount = 0;
|
|
1595
1627
|
if (existsSync(codexHistory)) {
|
|
1596
1628
|
try {
|
|
1597
|
-
const
|
|
1598
|
-
const lines = readFileSync2(codexHistory, "utf-8").split(`
|
|
1629
|
+
const lines = readFileSync(codexHistory, "utf-8").split(`
|
|
1599
1630
|
`).filter(Boolean);
|
|
1600
1631
|
const sessions = new Set(lines.map((l) => {
|
|
1601
1632
|
try {
|
|
@@ -1608,16 +1639,10 @@ async function detect() {
|
|
|
1608
1639
|
sessionCount = sessions.size;
|
|
1609
1640
|
} catch {}
|
|
1610
1641
|
}
|
|
1611
|
-
tools.push({
|
|
1612
|
-
name: "Codex",
|
|
1613
|
-
available: true,
|
|
1614
|
-
path: existsSync(codexHistory) ? codexHistory : codexSessions,
|
|
1615
|
-
sessionCount
|
|
1616
|
-
});
|
|
1642
|
+
tools.push({ name: "Codex", id: "codex", available: true, path: codexConfig, sessionCount });
|
|
1617
1643
|
} else {
|
|
1618
|
-
tools.push({ name: "Codex", available: false, path:
|
|
1644
|
+
tools.push({ name: "Codex", id: "codex", available: false, path: codexConfig, sessionCount: 0 });
|
|
1619
1645
|
}
|
|
1620
|
-
const os = platform();
|
|
1621
1646
|
let cursorDbPath;
|
|
1622
1647
|
if (os === "darwin") {
|
|
1623
1648
|
cursorDbPath = join(home, "Library", "Application Support", "Cursor", "User", "globalStorage", "state.vscdb");
|
|
@@ -1628,10 +1653,65 @@ async function detect() {
|
|
|
1628
1653
|
}
|
|
1629
1654
|
tools.push({
|
|
1630
1655
|
name: "Cursor",
|
|
1656
|
+
id: "cursor",
|
|
1631
1657
|
available: existsSync(cursorDbPath),
|
|
1632
1658
|
path: cursorDbPath,
|
|
1633
1659
|
sessionCount: existsSync(cursorDbPath) ? await countCursorSessions(cursorDbPath) : 0
|
|
1634
1660
|
});
|
|
1661
|
+
const windsurfDir = join(home, ".codeium", "windsurf");
|
|
1662
|
+
tools.push({
|
|
1663
|
+
name: "Windsurf",
|
|
1664
|
+
id: "windsurf",
|
|
1665
|
+
available: existsSync(windsurfDir),
|
|
1666
|
+
path: join(windsurfDir, "mcp_config.json"),
|
|
1667
|
+
sessionCount: 0
|
|
1668
|
+
});
|
|
1669
|
+
let vscodePath;
|
|
1670
|
+
if (os === "darwin") {
|
|
1671
|
+
vscodePath = join(home, "Library", "Application Support", "Code");
|
|
1672
|
+
} else if (os === "win32") {
|
|
1673
|
+
vscodePath = join(process.env.APPDATA || join(home, "AppData", "Roaming"), "Code");
|
|
1674
|
+
} else {
|
|
1675
|
+
vscodePath = join(home, ".config", "Code");
|
|
1676
|
+
}
|
|
1677
|
+
tools.push({
|
|
1678
|
+
name: "VS Code Copilot",
|
|
1679
|
+
id: "vscode",
|
|
1680
|
+
available: existsSync(vscodePath),
|
|
1681
|
+
path: join(vscodePath, "User", "mcp.json"),
|
|
1682
|
+
sessionCount: 0
|
|
1683
|
+
});
|
|
1684
|
+
let clinePath;
|
|
1685
|
+
if (os === "darwin") {
|
|
1686
|
+
clinePath = join(home, "Library", "Application Support", "Code", "User", "globalStorage", "saoudrizwan.claude-dev");
|
|
1687
|
+
} else if (os === "win32") {
|
|
1688
|
+
clinePath = join(process.env.APPDATA || join(home, "AppData", "Roaming"), "Code", "User", "globalStorage", "saoudrizwan.claude-dev");
|
|
1689
|
+
} else {
|
|
1690
|
+
clinePath = join(home, ".config", "Code", "User", "globalStorage", "saoudrizwan.claude-dev");
|
|
1691
|
+
}
|
|
1692
|
+
tools.push({
|
|
1693
|
+
name: "Cline",
|
|
1694
|
+
id: "cline",
|
|
1695
|
+
available: existsSync(clinePath),
|
|
1696
|
+
path: join(clinePath, "settings", "cline_mcp_settings.json"),
|
|
1697
|
+
sessionCount: 0
|
|
1698
|
+
});
|
|
1699
|
+
const zedPath = os === "darwin" ? join(home, ".zed") : join(home, ".config", "zed");
|
|
1700
|
+
tools.push({
|
|
1701
|
+
name: "Zed",
|
|
1702
|
+
id: "zed",
|
|
1703
|
+
available: existsSync(zedPath),
|
|
1704
|
+
path: join(zedPath, "settings.json"),
|
|
1705
|
+
sessionCount: 0
|
|
1706
|
+
});
|
|
1707
|
+
const openclawDir = join(home, ".openclaw");
|
|
1708
|
+
tools.push({
|
|
1709
|
+
name: "OpenClaw",
|
|
1710
|
+
id: "openclaw",
|
|
1711
|
+
available: existsSync(openclawDir),
|
|
1712
|
+
path: join(openclawDir, "openclaw.json"),
|
|
1713
|
+
sessionCount: 0
|
|
1714
|
+
});
|
|
1635
1715
|
return tools;
|
|
1636
1716
|
}
|
|
1637
1717
|
|
|
@@ -2240,9 +2320,14 @@ import { spawnSync } from "node:child_process";
|
|
|
2240
2320
|
var CONARE_URL = "https://mcp.conare.ai";
|
|
2241
2321
|
var SERVER_NAME = "conare";
|
|
2242
2322
|
var MCP_TARGETS = [
|
|
2243
|
-
{ id: "claude", label: "Claude Code" },
|
|
2244
|
-
{ id: "
|
|
2245
|
-
{ id: "
|
|
2323
|
+
{ id: "claude", label: "Claude Code", defaultSelected: true },
|
|
2324
|
+
{ id: "codex", label: "Codex", defaultSelected: true },
|
|
2325
|
+
{ id: "cursor", label: "Cursor", defaultSelected: false },
|
|
2326
|
+
{ id: "windsurf", label: "Windsurf", defaultSelected: false },
|
|
2327
|
+
{ id: "vscode", label: "VS Code Copilot", defaultSelected: false },
|
|
2328
|
+
{ id: "cline", label: "Cline", defaultSelected: false },
|
|
2329
|
+
{ id: "zed", label: "Zed", defaultSelected: false },
|
|
2330
|
+
{ id: "openclaw", label: "OpenClaw", defaultSelected: false }
|
|
2246
2331
|
];
|
|
2247
2332
|
function readJsonFile(path) {
|
|
2248
2333
|
try {
|
|
@@ -2265,14 +2350,6 @@ function getServerConfig(apiKey) {
|
|
|
2265
2350
|
}
|
|
2266
2351
|
};
|
|
2267
2352
|
}
|
|
2268
|
-
function upsertMcpServer(path, apiKey) {
|
|
2269
|
-
const config = readJsonFile(path);
|
|
2270
|
-
if (!config.mcpServers || typeof config.mcpServers !== "object") {
|
|
2271
|
-
config.mcpServers = {};
|
|
2272
|
-
}
|
|
2273
|
-
config.mcpServers[SERVER_NAME] = getServerConfig(apiKey);
|
|
2274
|
-
writeJsonFile(path, config);
|
|
2275
|
-
}
|
|
2276
2353
|
function configureClaude(apiKey) {
|
|
2277
2354
|
const claudeConfigPath = join7(homedir5(), ".claude.json");
|
|
2278
2355
|
const claudeMcpPath = join7(homedir5(), ".claude", "mcp.json");
|
|
@@ -2282,16 +2359,193 @@ function configureClaude(apiKey) {
|
|
|
2282
2359
|
}).status === 0) {
|
|
2283
2360
|
return "Claude Code configured via `claude mcp add-json`";
|
|
2284
2361
|
}
|
|
2285
|
-
|
|
2362
|
+
const config = readJsonFile(claudeConfigPath);
|
|
2363
|
+
if (!config.mcpServers || typeof config.mcpServers !== "object") {
|
|
2364
|
+
config.mcpServers = {};
|
|
2365
|
+
}
|
|
2366
|
+
config.mcpServers[SERVER_NAME] = getServerConfig(apiKey);
|
|
2367
|
+
writeJsonFile(claudeConfigPath, config);
|
|
2286
2368
|
if (existsSync6(join7(homedir5(), ".claude"))) {
|
|
2287
|
-
|
|
2369
|
+
const mcpConfig = readJsonFile(claudeMcpPath);
|
|
2370
|
+
if (!mcpConfig.mcpServers || typeof mcpConfig.mcpServers !== "object") {
|
|
2371
|
+
mcpConfig.mcpServers = {};
|
|
2372
|
+
}
|
|
2373
|
+
mcpConfig.mcpServers[SERVER_NAME] = getServerConfig(apiKey);
|
|
2374
|
+
writeJsonFile(claudeMcpPath, mcpConfig);
|
|
2288
2375
|
}
|
|
2289
2376
|
return `Claude Code configured at ${claudeConfigPath}`;
|
|
2290
2377
|
}
|
|
2291
|
-
function
|
|
2292
|
-
|
|
2293
|
-
|
|
2378
|
+
function configureCodex(apiKey) {
|
|
2379
|
+
const configPath = join7(homedir5(), ".codex", "config.toml");
|
|
2380
|
+
if (spawnSync("codex", ["mcp", "add", SERVER_NAME, "--url", `${CONARE_URL}/mcp`, "--header", `Authorization: Bearer ${apiKey}`], {
|
|
2381
|
+
stdio: "ignore",
|
|
2382
|
+
shell: platform5() === "win32"
|
|
2383
|
+
}).status === 0) {
|
|
2384
|
+
return "Codex configured via `codex mcp add`";
|
|
2385
|
+
}
|
|
2386
|
+
let toml = "";
|
|
2387
|
+
try {
|
|
2388
|
+
toml = readFileSync7(configPath, "utf-8");
|
|
2389
|
+
} catch {}
|
|
2390
|
+
const sectionHeader = `[mcp_servers.${SERVER_NAME}]`;
|
|
2391
|
+
const newSection = [
|
|
2392
|
+
sectionHeader,
|
|
2393
|
+
`url = "${CONARE_URL}/mcp"`,
|
|
2394
|
+
`enabled = true`,
|
|
2395
|
+
"",
|
|
2396
|
+
`[mcp_servers.${SERVER_NAME}.http_headers]`,
|
|
2397
|
+
`"Authorization" = "Bearer ${apiKey}"`
|
|
2398
|
+
].join(`
|
|
2399
|
+
`);
|
|
2400
|
+
const sectionRegex = new RegExp(`\\[mcp_servers\\.${SERVER_NAME}(?:\\.[^\\]]*)?\\][^\\[]*`, "g");
|
|
2401
|
+
const cleaned = toml.replace(sectionRegex, "").replace(/\n{3,}/g, `
|
|
2402
|
+
|
|
2403
|
+
`).trim();
|
|
2404
|
+
const result = cleaned ? `${cleaned}
|
|
2405
|
+
|
|
2406
|
+
${newSection}
|
|
2407
|
+
` : `${newSection}
|
|
2408
|
+
`;
|
|
2409
|
+
mkdirSync2(dirname(configPath), { recursive: true });
|
|
2410
|
+
writeFileSync2(configPath, result);
|
|
2411
|
+
const oldMcpJson = join7(homedir5(), ".codex", "mcp.json");
|
|
2412
|
+
try {
|
|
2413
|
+
if (existsSync6(oldMcpJson)) {
|
|
2414
|
+
const old = readJsonFile(oldMcpJson);
|
|
2415
|
+
const servers = old.mcpServers;
|
|
2416
|
+
if (servers && (("conare" in servers) || ("conare-memory" in servers))) {
|
|
2417
|
+
delete servers["conare"];
|
|
2418
|
+
delete servers["conare-memory"];
|
|
2419
|
+
if (Object.keys(servers).length === 0) {
|
|
2420
|
+
rmSync(oldMcpJson);
|
|
2421
|
+
} else {
|
|
2422
|
+
writeJsonFile(oldMcpJson, old);
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
} catch {}
|
|
2427
|
+
return `Codex configured at ${configPath}`;
|
|
2428
|
+
}
|
|
2429
|
+
function configureCursor(apiKey) {
|
|
2430
|
+
const configPath = join7(homedir5(), ".cursor", "mcp.json");
|
|
2431
|
+
const config = readJsonFile(configPath);
|
|
2432
|
+
if (!config.mcpServers || typeof config.mcpServers !== "object") {
|
|
2433
|
+
config.mcpServers = {};
|
|
2434
|
+
}
|
|
2435
|
+
config.mcpServers[SERVER_NAME] = {
|
|
2436
|
+
url: `${CONARE_URL}/mcp`,
|
|
2437
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
2438
|
+
};
|
|
2439
|
+
writeJsonFile(configPath, config);
|
|
2440
|
+
return `Cursor configured at ${configPath}`;
|
|
2441
|
+
}
|
|
2442
|
+
function configureWindsurf(apiKey) {
|
|
2443
|
+
const configPath = join7(homedir5(), ".codeium", "windsurf", "mcp_config.json");
|
|
2444
|
+
const config = readJsonFile(configPath);
|
|
2445
|
+
if (!config.mcpServers || typeof config.mcpServers !== "object") {
|
|
2446
|
+
config.mcpServers = {};
|
|
2447
|
+
}
|
|
2448
|
+
config.mcpServers[SERVER_NAME] = {
|
|
2449
|
+
serverUrl: `${CONARE_URL}/mcp`,
|
|
2450
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
2451
|
+
};
|
|
2452
|
+
writeJsonFile(configPath, config);
|
|
2453
|
+
return `Windsurf configured at ${configPath}`;
|
|
2454
|
+
}
|
|
2455
|
+
function configureVscode(apiKey) {
|
|
2456
|
+
const os = platform5();
|
|
2457
|
+
let configPath;
|
|
2458
|
+
if (os === "darwin") {
|
|
2459
|
+
configPath = join7(homedir5(), "Library", "Application Support", "Code", "User", "mcp.json");
|
|
2460
|
+
} else if (os === "win32") {
|
|
2461
|
+
configPath = join7(process.env.APPDATA || join7(homedir5(), "AppData", "Roaming"), "Code", "User", "mcp.json");
|
|
2462
|
+
} else {
|
|
2463
|
+
configPath = join7(homedir5(), ".config", "Code", "User", "mcp.json");
|
|
2464
|
+
}
|
|
2465
|
+
const config = readJsonFile(configPath);
|
|
2466
|
+
if (!config.servers || typeof config.servers !== "object") {
|
|
2467
|
+
config.servers = {};
|
|
2468
|
+
}
|
|
2469
|
+
config.servers[SERVER_NAME] = {
|
|
2470
|
+
type: "http",
|
|
2471
|
+
url: `${CONARE_URL}/mcp`,
|
|
2472
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
2473
|
+
};
|
|
2474
|
+
writeJsonFile(configPath, config);
|
|
2475
|
+
return `VS Code Copilot configured at ${configPath}`;
|
|
2294
2476
|
}
|
|
2477
|
+
function configureCline(apiKey) {
|
|
2478
|
+
const os = platform5();
|
|
2479
|
+
let configPath;
|
|
2480
|
+
if (os === "darwin") {
|
|
2481
|
+
configPath = join7(homedir5(), "Library", "Application Support", "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json");
|
|
2482
|
+
} else if (os === "win32") {
|
|
2483
|
+
configPath = join7(process.env.APPDATA || join7(homedir5(), "AppData", "Roaming"), "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json");
|
|
2484
|
+
} else {
|
|
2485
|
+
configPath = join7(homedir5(), ".config", "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json");
|
|
2486
|
+
}
|
|
2487
|
+
const config = readJsonFile(configPath);
|
|
2488
|
+
if (!config.mcpServers || typeof config.mcpServers !== "object") {
|
|
2489
|
+
config.mcpServers = {};
|
|
2490
|
+
}
|
|
2491
|
+
config.mcpServers[SERVER_NAME] = {
|
|
2492
|
+
url: `${CONARE_URL}/mcp`,
|
|
2493
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
2494
|
+
disabled: false
|
|
2495
|
+
};
|
|
2496
|
+
writeJsonFile(configPath, config);
|
|
2497
|
+
return `Cline configured at ${configPath}`;
|
|
2498
|
+
}
|
|
2499
|
+
function configureZed(apiKey) {
|
|
2500
|
+
const os = platform5();
|
|
2501
|
+
let configPath;
|
|
2502
|
+
if (os === "darwin") {
|
|
2503
|
+
configPath = join7(homedir5(), ".zed", "settings.json");
|
|
2504
|
+
} else {
|
|
2505
|
+
configPath = join7(homedir5(), ".config", "zed", "settings.json");
|
|
2506
|
+
}
|
|
2507
|
+
const config = readJsonFile(configPath);
|
|
2508
|
+
if (!config.context_servers || typeof config.context_servers !== "object") {
|
|
2509
|
+
config.context_servers = {};
|
|
2510
|
+
}
|
|
2511
|
+
config.context_servers[SERVER_NAME] = {
|
|
2512
|
+
command: "npx",
|
|
2513
|
+
args: [
|
|
2514
|
+
"-y",
|
|
2515
|
+
"mcp-remote",
|
|
2516
|
+
`${CONARE_URL}/mcp`,
|
|
2517
|
+
"--header",
|
|
2518
|
+
`Authorization:Bearer ${apiKey}`
|
|
2519
|
+
],
|
|
2520
|
+
env: {}
|
|
2521
|
+
};
|
|
2522
|
+
writeJsonFile(configPath, config);
|
|
2523
|
+
return `Zed configured at ${configPath}`;
|
|
2524
|
+
}
|
|
2525
|
+
function configureOpenclaw(apiKey) {
|
|
2526
|
+
const configPath = join7(homedir5(), ".openclaw", "openclaw.json");
|
|
2527
|
+
const config = readJsonFile(configPath);
|
|
2528
|
+
if (!config.mcpServers || typeof config.mcpServers !== "object") {
|
|
2529
|
+
config.mcpServers = {};
|
|
2530
|
+
}
|
|
2531
|
+
config.mcpServers[SERVER_NAME] = {
|
|
2532
|
+
type: "streamable-http",
|
|
2533
|
+
url: `${CONARE_URL}/mcp`,
|
|
2534
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
2535
|
+
};
|
|
2536
|
+
writeJsonFile(configPath, config);
|
|
2537
|
+
return `OpenClaw configured at ${configPath}`;
|
|
2538
|
+
}
|
|
2539
|
+
var CLIENT_CONFIGURATORS = {
|
|
2540
|
+
claude: configureClaude,
|
|
2541
|
+
codex: configureCodex,
|
|
2542
|
+
cursor: configureCursor,
|
|
2543
|
+
windsurf: configureWindsurf,
|
|
2544
|
+
vscode: configureVscode,
|
|
2545
|
+
cline: configureCline,
|
|
2546
|
+
zed: configureZed,
|
|
2547
|
+
openclaw: configureOpenclaw
|
|
2548
|
+
};
|
|
2295
2549
|
var SKILL_MD = `---
|
|
2296
2550
|
name: conare
|
|
2297
2551
|
description: Complements the Conare MCP server by teaching the agent when and how to load prior project context, search past sessions, save durable preferences, list stored memories, and forget saved items. Use when the user asks what they worked on before, wants prior context loaded at the start of a task, asks to remember or forget something, or needs past conversations, decisions, or code recalled from memory.
|
|
@@ -2365,95 +2619,6 @@ Expected outcome: future \`recall\` calls surface the information automatically
|
|
|
2365
2619
|
- Keep \`limit\` low (3-5) for focused results, higher (10-15) for broad exploration
|
|
2366
2620
|
- When user asks to "remember" something, save it with \`save\` — it goes to the \`preferences\` container and gets surfaced by \`recall\` in future sessions
|
|
2367
2621
|
|
|
2368
|
-
## Examples
|
|
2369
|
-
|
|
2370
|
-
### Example 1: Start with context
|
|
2371
|
-
|
|
2372
|
-
User says: "Help me continue the OAuth migration in this repo."
|
|
2373
|
-
|
|
2374
|
-
Actions:
|
|
2375
|
-
1. Call \`recall\` with context like "continue OAuth migration in the current repository".
|
|
2376
|
-
2. Review returned memories for prior migration decisions, unresolved blockers, and saved preferences.
|
|
2377
|
-
3. Proceed with implementation using that context.
|
|
2378
|
-
|
|
2379
|
-
Result: the agent starts with the relevant project history instead of asking the user to restate it.
|
|
2380
|
-
|
|
2381
|
-
### Example 2: Find prior work
|
|
2382
|
-
|
|
2383
|
-
User says: "What did we decide last week about billing webhooks?"
|
|
2384
|
-
|
|
2385
|
-
Actions:
|
|
2386
|
-
1. Call \`search\` with a descriptive query such as "billing webhook decision refunds retries last week".
|
|
2387
|
-
2. If results are weak, retry with alternatives like "refund webhook handling" or "billing retry policy".
|
|
2388
|
-
3. Summarize the decision and note uncertainty if memories conflict.
|
|
2389
|
-
|
|
2390
|
-
Result: the agent retrieves prior decisions from memory rather than guessing.
|
|
2391
|
-
|
|
2392
|
-
### Example 3: Save a durable preference
|
|
2393
|
-
|
|
2394
|
-
User says: "Remember that I prefer ripgrep over grep."
|
|
2395
|
-
|
|
2396
|
-
Actions:
|
|
2397
|
-
1. Call \`save\` with the preference in durable wording.
|
|
2398
|
-
2. Confirm the preference was saved.
|
|
2399
|
-
|
|
2400
|
-
Result: future \`recall\` results can surface that preference automatically.
|
|
2401
|
-
|
|
2402
|
-
## Troubleshooting
|
|
2403
|
-
|
|
2404
|
-
### Weak or irrelevant search results
|
|
2405
|
-
|
|
2406
|
-
Cause:
|
|
2407
|
-
- Query is too short or too generic.
|
|
2408
|
-
- Search needs a different phrasing or time scope.
|
|
2409
|
-
|
|
2410
|
-
Response:
|
|
2411
|
-
1. Rewrite the query with concrete nouns, entities, and actions.
|
|
2412
|
-
2. Add \`after\`/\`before\` when the user implies a time window.
|
|
2413
|
-
3. Add \`project\` or \`containerTag\` when the scope is known.
|
|
2414
|
-
|
|
2415
|
-
### \`recall\` returns little useful context
|
|
2416
|
-
|
|
2417
|
-
Cause:
|
|
2418
|
-
- Conversation context passed to \`recall\` was too vague.
|
|
2419
|
-
- The project parameter was omitted when it should have been included.
|
|
2420
|
-
|
|
2421
|
-
Response:
|
|
2422
|
-
1. Retry \`recall\` with a more specific task description.
|
|
2423
|
-
2. Include \`project\` if the workspace or repository is known.
|
|
2424
|
-
3. Fall back to \`search\` for the exact topic the user cares about.
|
|
2425
|
-
|
|
2426
|
-
### Unsure whether to save something
|
|
2427
|
-
|
|
2428
|
-
Cause:
|
|
2429
|
-
- The information may be temporary rather than durable.
|
|
2430
|
-
|
|
2431
|
-
Response:
|
|
2432
|
-
1. Save it when it is likely to help in future sessions, especially if it reflects a preference, rule, decision, or durable project fact.
|
|
2433
|
-
2. Skip only clearly transient implementation notes unless the user explicitly asks to retain them.
|
|
2434
|
-
|
|
2435
|
-
## Triggering Tests
|
|
2436
|
-
|
|
2437
|
-
Use these tests to validate whether the skill description is tuned correctly.
|
|
2438
|
-
|
|
2439
|
-
Should trigger:
|
|
2440
|
-
- "What did we work on in this repo last week?"
|
|
2441
|
-
- "Load context for the auth refactor before we continue."
|
|
2442
|
-
- "Remember that I prefer pnpm in JavaScript projects."
|
|
2443
|
-
- "Forget the note about using staging Stripe keys."
|
|
2444
|
-
- "Search my past sessions for the DO migration fix."
|
|
2445
|
-
|
|
2446
|
-
Should not trigger:
|
|
2447
|
-
- "Write a sorting function in TypeScript."
|
|
2448
|
-
- "What is the weather in San Francisco?"
|
|
2449
|
-
- "Explain how PostgreSQL indexes work."
|
|
2450
|
-
- "Create a landing page from this mockup."
|
|
2451
|
-
|
|
2452
|
-
Success criteria:
|
|
2453
|
-
- Triggers on memory-oriented requests and start-of-task context loading.
|
|
2454
|
-
- Does not trigger on generic coding or research tasks with no memory component.
|
|
2455
|
-
- Uses \`recall\` first for new task continuation, and uses \`search\` only when the user asks about specific past work.
|
|
2456
|
-
|
|
2457
2622
|
## Setup
|
|
2458
2623
|
|
|
2459
2624
|
Install with a single command:
|
|
@@ -2486,16 +2651,17 @@ function installSkill() {
|
|
|
2486
2651
|
} catch {}
|
|
2487
2652
|
return "Agent Skill installed";
|
|
2488
2653
|
}
|
|
2489
|
-
function configureMcp(apiKey, targets = ["claude", "
|
|
2654
|
+
function configureMcp(apiKey, targets = ["claude", "codex"]) {
|
|
2490
2655
|
const results = [];
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2656
|
+
for (const target of targets) {
|
|
2657
|
+
const configurator = CLIENT_CONFIGURATORS[target];
|
|
2658
|
+
if (configurator) {
|
|
2659
|
+
try {
|
|
2660
|
+
results.push(configurator(apiKey));
|
|
2661
|
+
} catch (e) {
|
|
2662
|
+
results.push(`${target}: failed — ${e.message}`);
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2499
2665
|
}
|
|
2500
2666
|
try {
|
|
2501
2667
|
results.push(installSkill());
|
|
@@ -3132,10 +3298,13 @@ conare — AI memory for your coding tools
|
|
|
3132
3298
|
|
|
3133
3299
|
Usage:
|
|
3134
3300
|
conare Interactive setup with browser auth
|
|
3135
|
-
conare install Just install the MCP
|
|
3301
|
+
conare install Just install the MCP (all detected clients)
|
|
3136
3302
|
conare --key <api_key> Ingest chat history (key optional with browser auth)
|
|
3137
3303
|
conare --key <api_key> --index [path] Index codebase
|
|
3138
3304
|
|
|
3305
|
+
Supported clients:
|
|
3306
|
+
Claude Code, Codex, Cursor, Windsurf, VS Code Copilot, Cline, Zed, OpenClaw
|
|
3307
|
+
|
|
3139
3308
|
Options:
|
|
3140
3309
|
--key <key> Your Conare API key (optional if using browser auth, starts with cmem_)
|
|
3141
3310
|
--config-file <path> Read API key from JSON config file (e.g. ~/.conare/config.json)
|
|
@@ -3210,8 +3379,12 @@ async function runInstall() {
|
|
|
3210
3379
|
process.exit(1);
|
|
3211
3380
|
}
|
|
3212
3381
|
saveApiKey(apiKey);
|
|
3213
|
-
const
|
|
3214
|
-
const
|
|
3382
|
+
const detectedTools = await detect();
|
|
3383
|
+
const targets = MCP_TARGETS.filter((t) => {
|
|
3384
|
+
const detected = detectedTools.find((d3) => d3.id === t.id);
|
|
3385
|
+
return detected?.available || t.defaultSelected;
|
|
3386
|
+
}).map((t) => t.id);
|
|
3387
|
+
const lines = configureMcp(apiKey, targets);
|
|
3215
3388
|
for (const line of lines)
|
|
3216
3389
|
console.log(` ${line}`);
|
|
3217
3390
|
console.log("");
|
|
@@ -3243,7 +3416,7 @@ async function main() {
|
|
|
3243
3416
|
const savedApiKey = getSavedApiKey();
|
|
3244
3417
|
const hasTty = !!process.stdin.isTTY && !!process.stdout.isTTY;
|
|
3245
3418
|
const shouldRunInteractive = hasTty && !opts.dryRun && !opts.quiet && (opts.interactive || !opts.force && !opts.source && !opts.indexPath && !opts.configOnly && !opts.ingestOnly && !opts.wasmDir);
|
|
3246
|
-
let selectedTargets = MCP_TARGETS.map((
|
|
3419
|
+
let selectedTargets = MCP_TARGETS.filter((t) => t.defaultSelected).map((t) => t.id);
|
|
3247
3420
|
let effectiveConfigOnly = opts.configOnly;
|
|
3248
3421
|
let effectiveIngestOnly = opts.ingestOnly;
|
|
3249
3422
|
let effectiveIndexPath = opts.indexPath;
|
|
@@ -3254,19 +3427,19 @@ async function main() {
|
|
|
3254
3427
|
id: target.id,
|
|
3255
3428
|
label: target.label,
|
|
3256
3429
|
available: true,
|
|
3257
|
-
recommended:
|
|
3430
|
+
recommended: target.defaultSelected,
|
|
3258
3431
|
detectedCount: undefined
|
|
3259
3432
|
}));
|
|
3260
3433
|
let interactiveMode = false;
|
|
3261
3434
|
if (shouldRunInteractive) {
|
|
3262
3435
|
const detectedTools = await detect();
|
|
3263
3436
|
interactiveTargets = MCP_TARGETS.map((target) => {
|
|
3264
|
-
const detected = detectedTools.find((tool) =>
|
|
3437
|
+
const detected = detectedTools.find((tool) => tool.id === target.id);
|
|
3265
3438
|
return {
|
|
3266
3439
|
id: target.id,
|
|
3267
3440
|
label: target.label,
|
|
3268
3441
|
available: detected?.available,
|
|
3269
|
-
recommended: detected?.available !== false,
|
|
3442
|
+
recommended: target.defaultSelected && detected?.available !== false,
|
|
3270
3443
|
detectedCount: detected?.sessionCount
|
|
3271
3444
|
};
|
|
3272
3445
|
});
|