agentcache 0.2.4 → 0.3.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/README.md CHANGED
@@ -27,33 +27,43 @@ No `init`. No `setup`. No config. No second command. The install itself:
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
29
29
  4. Sets up Claude Code hooks for automatic transcript recovery
30
+ 5. Spawns `compile-all` in background — compiles your entire transcript history from all IDEs immediately
30
31
 
31
32
  ## How It Works
32
33
 
33
34
  ```
34
- ┌─────────────────────────────────────────────────────────────────┐
35
- Your Machine
36
-
37
- │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
38
- │ │ Claude │ │ Cursor │ │ Roo │ │ Codex │ ...
39
- │ │ Code │ │ │ │ Code │ │ │
40
- │ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
41
- │ │ │ │ │
42
- │ └──────────────┴──────────────┴──────────────┘
43
- │ │
44
- │ MCP Protocol (stdio)
45
- │ │
46
- │ ┌────────────┴────────────┐
47
- │ │ AgentCache MCP Server │
48
- │ │ (agentcache serve) │
49
- └────────────┬────────────┘
50
-
51
- ┌─────────┴─────────┐
52
- ~/.agentcache/
53
- agentcache.db
54
- (SQLite + WAL)
55
- └───────────────────┘
56
- └─────────────────────────────────────────────────────────────────┘
35
+ ┌──────────────────────────────────────────────────────────────────────┐
36
+ Your Machine
37
+
38
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
39
+ │ │ Claude │ │ Cursor │ │ Roo │ │ Codex │ ...
40
+ │ │ Code │ │ │ │ Code │ │ │
41
+ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
42
+ │ │ │ │ │
43
+ │ └──────────────┴──────────────┴──────────────┘
44
+ │ │
45
+ │ MCP Protocol (stdio)
46
+ │ │
47
+ │ ┌────────────┴────────────┐ ┌────────────────────┐
48
+ │ │ AgentCache MCP Server │ agentcache │ │
49
+ │ │ (agentcache serve) │ compile-all │ │
50
+ │ │ │ │ (standalone CLI) │ │
51
+ spawns compile-all ─────┼───▶│
52
+ when pending > 20 │ │ Uses: claude, │ │
53
+ └────────────┬────────────┘ codex, gemini,
54
+ ollama, API keys
55
+ └─────────┬──────────┘
56
+ │ │
57
+ │ ┌─────────┴────────────────────────────┘ │
58
+ │ │ │
59
+ │ ▼ │
60
+ │ ┌───────────────────┐ │
61
+ │ │ ~/.agentcache/ │ │
62
+ │ │ agentcache.db │ │
63
+ │ │ compile-all.lock │ │
64
+ │ │ (SQLite + WAL) │ │
65
+ │ └───────────────────┘ │
66
+ └──────────────────────────────────────────────────────────────────────┘
57
67
  ```
58
68
 
59
69
  ### The Cycle
@@ -92,9 +102,33 @@ AgentCache exposes 8 tools via the Model Context Protocol (prefixed as `mcp--age
92
102
 
93
103
  ```bash
94
104
  agentcache status # Show knowledge stats for current project
105
+ agentcache compile-all # Batch-compile all unprocessed transcripts
95
106
  agentcache setup # Re-register with IDEs (only if postinstall failed)
96
107
  ```
97
108
 
109
+ ### `compile-all` — Standalone Batch Compilation
110
+
111
+ Processes all pending transcripts across every IDE without depending on MCP pipes or active sessions. Runs independently in a terminal.
112
+
113
+ ```bash
114
+ agentcache compile-all
115
+ ```
116
+
117
+ **LLM backend detection** (first available wins):
118
+ 1. CLI tools with stored auth: `claude`, `codex`, `gemini`, `copilot`, `aider`, `goose`
119
+ 2. Ollama running locally (`localhost:11434`)
120
+ 3. `ANTHROPIC_API_KEY` environment variable
121
+ 4. `OPENAI_API_KEY` environment variable
122
+
123
+ No API keys needed if you have any coding CLI installed — it uses their stored authentication.
124
+
125
+ **Automatic triggers:**
126
+ - Runs as a background process after `npm install -g agentcache` (clears initial backlog)
127
+ - Spawned by the MCP server when pending transcripts exceed 20 (ongoing janitor)
128
+ - Lockfile (`~/.agentcache/compile-all.lock`) prevents concurrent runs
129
+
130
+ **Transcript sources:** Claude Code, Continue, Codex, Roo Code, Goose
131
+
98
132
  Internal commands (called by hooks automatically, never by users):
99
133
  ```bash
100
134
  agentcache serve # MCP server (IDEs spawn this)
@@ -119,9 +153,10 @@ One database per developer (`~/.agentcache/agentcache.db`), not per project. Rul
119
153
 
120
154
  ### Resilient to Abrupt Exits
121
155
 
122
- Sessions can end without warning (crash, ctrl-c, network drop). AgentCache handles this through:
156
+ Sessions can end without warning (crash, ctrl-c, network drop, MCP pipe death). AgentCache handles this through:
123
157
  - **Incremental submission** — observations are saved as they happen, not batched at the end
124
- - **Transcript recovery** — for Claude Code and Continue, transcripts persist on disk and are compiled next session
158
+ - **Transcript recovery** — transcripts persist on disk across 5 IDEs (Claude Code, Continue, Codex, Roo Code, Goose) and are compiled by `compile-all`
159
+ - **Pipe-independent compilation** — `compile-all` runs as a standalone process, not through MCP stdio pipes that can break during long operations
125
160
  - **Pending queue in SQLite** — concurrent access is safe, nothing lost to race conditions
126
161
 
127
162
  ### Anti-Bloat
@@ -137,21 +172,18 @@ AgentCache prevents knowledge from growing unbounded:
137
172
  | IDE | MCP | Auto-Approve | Transcript Recovery | Hooks |
138
173
  |-----|-----|-------------|--------------------|----|
139
174
  | Claude Code | Yes | Yes (automatic) | Full (JSONL) | Stop, SessionStart, PreToolUse |
140
- | Cursor | Yes | **Manual** (see below) | Incremental only | — |
141
- | Roo Code | Yes | Yes (automatic) | Incremental only | — |
175
+ | Cursor | Yes | Yes (automatic) | Incremental only | — |
176
+ | Roo Code | Yes | Yes (automatic) | Full (JSON via compile-all) | — |
142
177
  | Windsurf | Yes | Yes (automatic) | Incremental only | — |
143
178
  | Continue | Yes | Yes (automatic) | Full (JSON) | — |
144
- | Codex | Yes | Yes (automatic) | Incremental only | — |
179
+ | Codex | Yes | Yes (automatic) | Full (JSONL via compile-all) | — |
180
+ | Goose | — | — | Full (SQLite via compile-all) | — |
145
181
 
146
- "Incremental only" means if the agent submits observations during the session, they're saved. If the session terminates before any submission, those observations are lost (no transcript access).
147
-
148
- ### Cursor: Enable Auto-Approve
182
+ All IDEs are fully auto-approved at install time no manual steps required.
149
183
 
150
- Cursor does not support programmatic auto-approve for MCP tools. After installing, you need to manually enable it once:
184
+ "Incremental only" means if the agent submits observations during the session, they're saved. If the session terminates before any submission, those observations are lost (no transcript access).
151
185
 
152
- 1. Open Cursor Settings MCP
153
- 2. Find **agentcache** in the server list
154
- 3. Set tool approval to **"Always allow"** (or enable "Yolo mode" in Cursor settings for all tools)
186
+ "via compile-all" means `agentcache compile-all` discovers and processes these transcripts in batch, independent of any active MCP session.
155
187
 
156
188
  ## Data Storage
157
189
 
@@ -182,7 +214,9 @@ Extract → Normalize → Canonicalize → Cluster → Detect Contradictions →
182
214
  - authority: AUTO/USER
183
215
  ```
184
216
 
185
- The compiler is the LLM itself (the agent in your session). AgentCache provides extraction prompts and the agent processes them — no separate API keys or LLM calls needed.
217
+ **Two compilation paths:**
218
+ - **In-session** — the agent in your IDE processes extraction prompts via MCP tools (no separate LLM calls needed)
219
+ - **Batch (`compile-all`)** — runs independently using any available LLM CLI or API, processes the full backlog without depending on active sessions
186
220
 
187
221
  ## Project Identity
188
222
 
@@ -191,6 +225,41 @@ Projects are identified by a hash of their full filesystem path, not just the fo
191
225
  - Renaming a folder creates a new project identity
192
226
  - Knowledge doesn't leak between same-named projects
193
227
 
228
+ ## Roadmap
229
+
230
+ ### More IDEs & Coding Agents
231
+
232
+ | Platform | Status |
233
+ |----------|--------|
234
+ | Claude Code | Supported |
235
+ | Cursor | Supported |
236
+ | Roo Code | Supported |
237
+ | Windsurf | Supported |
238
+ | Continue | Supported |
239
+ | Codex | Supported |
240
+ | Goose | Supported (transcript recovery via SQLite) |
241
+ | Aider | Coming soon |
242
+ | GitHub Copilot | Coming soon |
243
+ | Zed AI | Coming soon |
244
+
245
+ Any tool that supports MCP can use AgentCache today via `agentcache serve`. Native integrations for the above are planned to ensure zero-config setup.
246
+
247
+ ### Native Plugins
248
+
249
+ Marketplace listings and deeper UI integrations for all supported IDEs — surfacing knowledge inline, showing compilation status, and providing one-click management of rules and decisions.
250
+
251
+ ### Team Knowledge Sharing
252
+
253
+ Share compiled knowledge across your team. Rules and lessons that work for one developer benefit everyone.
254
+
255
+ ### Cloud Sync
256
+
257
+ Sync your knowledge database across machines. Same developer, different computers, same knowledge.
258
+
259
+ ### Analytics Dashboard
260
+
261
+ Visibility into what AgentCache is learning — compilation stats, knowledge growth, most-referenced rules, and session coverage.
262
+
194
263
  ## Contributing
195
264
 
196
265
  ```bash
@@ -0,0 +1,33 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
6
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
7
+ }) : x)(function(x) {
8
+ if (typeof require !== "undefined") return require.apply(this, arguments);
9
+ throw Error('Dynamic require of "' + x + '" is not supported');
10
+ });
11
+ var __esm = (fn, res) => function __init() {
12
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
+ };
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+
28
+ export {
29
+ __require,
30
+ __esm,
31
+ __export,
32
+ __toCommonJS
33
+ };