@senoldogann/context-manager 0.1.2 → 0.1.4
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 +41 -0
- package/bin/ccm.js +55 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @senoldogann/context-manager
|
|
2
|
+
|
|
3
|
+
> 🧠 The Neural Backbone for Autonomous AI Agents
|
|
4
|
+
|
|
5
|
+
This is the Node.js wrapper for the **Cognitive Codebase Matrix (CCM)**. It allows you to run the CCM CLI and MCP server without manually installing Rust or building from source.
|
|
6
|
+
|
|
7
|
+
## 🚀 Quick Start
|
|
8
|
+
|
|
9
|
+
### 1. Auto-Configure your Editor
|
|
10
|
+
The easiest way to get started. This will automatically add CCM to your Claude or Antigravity configuration:
|
|
11
|
+
```bash
|
|
12
|
+
npx @senoldogann/context-manager install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 2. Index your Project
|
|
16
|
+
Run the indexer in your project root:
|
|
17
|
+
```bash
|
|
18
|
+
npx @senoldogann/context-manager index --path .
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 🤖 AI Editor Integration (MCP)
|
|
22
|
+
|
|
23
|
+
Add this to your `mcp_config.json`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
"context-manager": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "@senoldogann/context-manager", "mcp"],
|
|
29
|
+
"env": {
|
|
30
|
+
"RUST_LOG": "info"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 📦 What this package does
|
|
36
|
+
This package is a lightweight wrapper that:
|
|
37
|
+
1. Detects your OS and CPU architecture.
|
|
38
|
+
2. Downloads the pre-built Rust binaries from GitHub Releases if not already present.
|
|
39
|
+
3. Automatically manages your global index and persistence in `~/.ccm`.
|
|
40
|
+
|
|
41
|
+
For more details, visit the [Main Repository](https://github.com/senoldogann/LLM-Context-Manager).
|
package/bin/ccm.js
CHANGED
|
@@ -6,10 +6,61 @@ const fs = require('fs');
|
|
|
6
6
|
const os = require('os');
|
|
7
7
|
const https = require('https');
|
|
8
8
|
|
|
9
|
-
const VERSION = '0.1.
|
|
9
|
+
const VERSION = '0.1.4';
|
|
10
10
|
const REPO = 'senoldogann/LLM-Context-Manager';
|
|
11
11
|
const BIN_DIR = path.join(os.homedir(), '.ccm', 'bin');
|
|
12
12
|
|
|
13
|
+
async function installMcp() {
|
|
14
|
+
const configPaths = [];
|
|
15
|
+
if (os.platform() === 'darwin') {
|
|
16
|
+
configPaths.push(path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'));
|
|
17
|
+
configPaths.push(path.join(os.homedir(), '.gemini', 'antigravity', 'mcp_config.json'));
|
|
18
|
+
} else if (os.platform() === 'win32') {
|
|
19
|
+
configPaths.push(path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json'));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const mcpConfig = {
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["-y", "@senoldogann/context-manager", "mcp"],
|
|
25
|
+
"env": {
|
|
26
|
+
"RUST_LOG": "info"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
let installedCount = 0;
|
|
31
|
+
for (const configPath of configPaths) {
|
|
32
|
+
const dir = path.dirname(configPath);
|
|
33
|
+
if (fs.existsSync(dir)) {
|
|
34
|
+
let config = { mcpServers: {} };
|
|
35
|
+
if (fs.existsSync(configPath)) {
|
|
36
|
+
try {
|
|
37
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
38
|
+
config = JSON.parse(content);
|
|
39
|
+
// Backup
|
|
40
|
+
fs.copyFileSync(configPath, `${configPath}.bak`);
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.warn(`[CCM] Could not parse ${configPath}, creating backup and starting fresh section.`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
47
|
+
config.mcpServers["context-manager"] = mcpConfig;
|
|
48
|
+
|
|
49
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
50
|
+
console.log(`[CCM] ✓ Successfully updated: ${configPath}`);
|
|
51
|
+
installedCount++;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (installedCount === 0) {
|
|
56
|
+
console.log("[CCM] No supported MCP config directories found.");
|
|
57
|
+
console.log("[CCM] Please add this to your mcp_config.json manually:");
|
|
58
|
+
console.log(JSON.stringify({ "context-manager": mcpConfig }, null, 2));
|
|
59
|
+
} else {
|
|
60
|
+
console.log("[CCM] Installation complete! Restart your AI editor to see the changes.");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
13
64
|
async function getBinary() {
|
|
14
65
|
const platform = os.platform(); // darwin, linux, win32
|
|
15
66
|
const arch = os.arch(); // x64, arm64
|
|
@@ -33,6 +84,9 @@ async function getBinary() {
|
|
|
33
84
|
// Handle: npx @ccm/context-manager mcp
|
|
34
85
|
commandName = 'ccm-mcp';
|
|
35
86
|
process.argv.splice(2, 1); // Remove 'mcp' from args to be passed to binary
|
|
87
|
+
} else if (process.argv[2] === 'install') {
|
|
88
|
+
await installMcp();
|
|
89
|
+
process.exit(0);
|
|
36
90
|
}
|
|
37
91
|
|
|
38
92
|
const binFilename = `${commandName}-${target}`;
|