agentcache 0.1.0 → 0.1.2
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
CHANGED
|
@@ -20,9 +20,9 @@ AgentCache fixes this. It's a persistent knowledge layer that:
|
|
|
20
20
|
npm install -g agentcache
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Done. Start a new session in any IDE. AgentCache is already running.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
No `init`. No `setup`. No config. No second command. The install itself:
|
|
26
26
|
1. Creates `~/.loop/loop.db` (your knowledge store)
|
|
27
27
|
2. Detects installed IDEs (Claude Code, Cursor, Roo Code, Windsurf, Continue, Codex)
|
|
28
28
|
3. Registers itself as an MCP server in each
|
|
@@ -90,12 +90,16 @@ AgentCache exposes 8 tools via the Model Context Protocol:
|
|
|
90
90
|
## CLI Commands
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
agentcache setup # Re-detect IDEs and register (runs automatically on install)
|
|
94
|
-
agentcache serve # Start MCP server (IDEs spawn this automatically)
|
|
95
93
|
agentcache status # Show knowledge stats for current project
|
|
96
|
-
agentcache
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
agentcache setup # Re-register with IDEs (only if postinstall failed)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Internal commands (called by hooks automatically, never by users):
|
|
98
|
+
```bash
|
|
99
|
+
agentcache serve # MCP server (IDEs spawn this)
|
|
100
|
+
agentcache compile-session # Stop hook
|
|
101
|
+
agentcache discover # SessionStart hook
|
|
102
|
+
agentcache enforce # PreToolUse hook
|
|
99
103
|
```
|
|
100
104
|
|
|
101
105
|
## Design Principles
|
|
@@ -48,26 +48,32 @@ function detectInstalledIdes() {
|
|
|
48
48
|
import { existsSync as existsSync2, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
49
49
|
import { join as join2, dirname } from "path";
|
|
50
50
|
import { homedir as homedir2 } from "os";
|
|
51
|
-
var
|
|
51
|
+
var MCP_ENTRY_STDIO = {
|
|
52
|
+
type: "stdio",
|
|
53
|
+
command: "agentcache",
|
|
54
|
+
args: ["serve"],
|
|
55
|
+
env: {}
|
|
56
|
+
};
|
|
57
|
+
var MCP_ENTRY_SIMPLE = {
|
|
52
58
|
command: "agentcache",
|
|
53
59
|
args: ["serve"]
|
|
54
60
|
};
|
|
55
61
|
function registerMcpServer(ide) {
|
|
56
62
|
if (!ide.detected) return false;
|
|
57
63
|
if (ide.mcpConfigFormat === "claude-settings") {
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
const claudeJsonPath = join2(homedir2(), ".claude.json");
|
|
65
|
+
let config = {};
|
|
66
|
+
if (existsSync2(claudeJsonPath)) {
|
|
60
67
|
try {
|
|
61
|
-
|
|
68
|
+
config = JSON.parse(readFileSync(claudeJsonPath, "utf-8"));
|
|
62
69
|
} catch {
|
|
63
|
-
|
|
70
|
+
config = {};
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
|
-
if (!
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
writeFileSync(ide.mcpConfigPath, JSON.stringify(settings, null, 2));
|
|
73
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
74
|
+
if (config.mcpServers.agentcache) return false;
|
|
75
|
+
config.mcpServers.agentcache = MCP_ENTRY_STDIO;
|
|
76
|
+
writeFileSync(claudeJsonPath, JSON.stringify(config, null, 2));
|
|
71
77
|
return true;
|
|
72
78
|
}
|
|
73
79
|
if (ide.mcpConfigFormat === "mcp-json") {
|
|
@@ -81,7 +87,7 @@ function registerMcpServer(ide) {
|
|
|
81
87
|
}
|
|
82
88
|
if (!config.mcpServers) config.mcpServers = {};
|
|
83
89
|
if (config.mcpServers.agentcache) return false;
|
|
84
|
-
config.mcpServers.agentcache =
|
|
90
|
+
config.mcpServers.agentcache = MCP_ENTRY_SIMPLE;
|
|
85
91
|
mkdirSync(dirname(ide.mcpConfigPath), { recursive: true });
|
|
86
92
|
writeFileSync(ide.mcpConfigPath, JSON.stringify(config, null, 2));
|
|
87
93
|
return true;
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Command } from "commander";
|
|
|
5
5
|
var program = new Command();
|
|
6
6
|
program.name("agentcache").description("Engineering Knowledge Compiler \u2014 universal, zero-config").version("0.3.0");
|
|
7
7
|
program.command("setup").description("Detect IDEs and register Loop (runs automatically on install)").action(async () => {
|
|
8
|
-
const { runSetup } = await import("./setup-
|
|
8
|
+
const { runSetup } = await import("./setup-5Z5AHD2U.js");
|
|
9
9
|
await runSetup();
|
|
10
10
|
});
|
|
11
11
|
program.command("serve").description("Start Loop MCP server (spawned by IDEs automatically)").action(async () => {
|
package/dist/postinstall.js
CHANGED