@ureck/alexandria 1.2.0 → 1.3.0
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 +6 -5
- package/dist/cli.js +24 -2
- package/dist/mcp/server.js +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
Alexandria automatically captures your AI prompts and sessions, searches that knowledge **before** spending tokens, and connects everything in an Obsidian-style graph. **100% local**: no database, no API keys, no telemetry, no cost.
|
|
12
12
|
|
|
13
|
-
Works with the most popular agents via MCP: **Claude Code · Cursor · OpenCode ·
|
|
13
|
+
Works with the most popular agents via MCP: **Claude Code · Cursor · OpenCode · Devin CLI · Cline · Codex CLI · Gemini CLI · VS Code (Copilot) · OpenClaw · Hermes Agent · Windsurf (legacy)**.
|
|
14
14
|
|
|
15
15
|
## Why?
|
|
16
16
|
|
|
@@ -34,7 +34,7 @@ It lives in the MCP tools themselves — their names and descriptions carry the
|
|
|
34
34
|
| MCP tool | What the agent does with it | Token payoff |
|
|
35
35
|
|---|---|---|
|
|
36
36
|
| `plan_create(title, goal, dod, tasks, design?)` | Plans like an **architect**: clarifies vague goals first, optionally records the architecture (`design` → a `## Design` section), and the response surfaces **similar past plans + relevant lessons** plus quality hints (verifiable DoD, small tasks) — suggestions, never a gate | No wandering; open plans are re-injected next session so work is resumed, not repeated |
|
|
37
|
-
| `task_verify(plan, task, passed, verify_command)` | **Runs** `verify_command` (e.g. `npm test`) and takes the verdict from the real exit code — not from the agent's word. Flags a **discrepancy** if the agent claimed otherwise; without a command the note is tagged `self-reported` and `ale audit` calls it out | "✅ 12/12 passed" (5 tokens) instead of a 500-line log; on failure it automatically surfaces **past lessons** that match |
|
|
37
|
+
| `task_verify(plan, task, passed, verify_command, cwd?)` | **Runs** `verify_command` (e.g. `npm test`) and takes the verdict from the real exit code — not from the agent's word. Flags a **discrepancy** if the agent claimed otherwise; without a command the note is tagged `self-reported` and `ale audit` calls it out | "✅ 12/12 passed" (5 tokens) instead of a 500-line log; on failure it automatically surfaces **past lessons** that match |
|
|
38
38
|
| `lesson_extract(title, lesson, links)` | Distills the root cause + fix after solving something non-obvious | ~200 tokens today replace ~20,000 tokens of re-debugging next month |
|
|
39
39
|
|
|
40
40
|
Lessons and solutions get a ranking boost in search, so the most valuable knowledge always surfaces first. The protocol is **on by default**; toggle it anytime:
|
|
@@ -63,7 +63,7 @@ Verify:
|
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
65
|
$ ale --version
|
|
66
|
-
1.
|
|
66
|
+
1.3.0
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
## Getting started
|
|
@@ -142,7 +142,7 @@ ale init --off architect.enrich,digest.map # disable from the start
|
|
|
142
142
|
ale config set tokens.solutionCache false # scriptable, one by one
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
The
|
|
145
|
+
The toggles: Protocol manifest (~6% of the session digest), Architect enrichment in `plan_create` (~+90 tokens/plan), solution cache (up to ~500 tokens/prompt), per-prompt semantic search (the **main saving mechanism** — up to ~1500 tokens/prompt, disabling it defeats the point), project map in the digest (up to ~1000 tokens), title index (~200 tokens), and background index rebuild at session close (costs no tokens). All on by default; nothing changes unless you touch them.
|
|
146
146
|
|
|
147
147
|
### Deep project context (`ale scan`)
|
|
148
148
|
|
|
@@ -252,7 +252,8 @@ ale agents cursor,gemini # just these
|
|
|
252
252
|
| Claude Code | `.mcp.json` / `claude mcp add` + hooks | ✓ |
|
|
253
253
|
| Cursor | `~/.cursor/mcp.json` / `.cursor/mcp.json` | ✓ |
|
|
254
254
|
| OpenCode | `opencode.json` | ✓ |
|
|
255
|
-
|
|
|
255
|
+
| Devin CLI (Cognition) | `.devin/mcp_config.local.json` | ✓ |
|
|
256
|
+
| Windsurf (legacy) | `~/.codeium/windsurf/mcp_config.json` | — |
|
|
256
257
|
| Cline | `cline_mcp_settings.json` (VS Code) | — |
|
|
257
258
|
| Codex CLI | `~/.codex/config.toml` | — |
|
|
258
259
|
| Gemini CLI | `~/.gemini/settings.json` / `.gemini/settings.json` | ✓ |
|
package/dist/cli.js
CHANGED
|
@@ -455,13 +455,34 @@ var AGENTS = [
|
|
|
455
455
|
},
|
|
456
456
|
{
|
|
457
457
|
id: "windsurf",
|
|
458
|
-
name: "Windsurf",
|
|
458
|
+
name: "Windsurf (legacy \u2192 Devin)",
|
|
459
459
|
supportsProject: false,
|
|
460
460
|
detect: () => fs3.existsSync(home(".codeium", "windsurf")),
|
|
461
461
|
register() {
|
|
462
462
|
return mergeMcpServers(home(".codeium", "windsurf", "mcp_config.json"));
|
|
463
463
|
}
|
|
464
464
|
},
|
|
465
|
+
{
|
|
466
|
+
id: "devin",
|
|
467
|
+
name: "Devin CLI (Cognition)",
|
|
468
|
+
supportsProject: true,
|
|
469
|
+
// El CLI vive en ~/.local/bin/devin y guarda config MCP por proyecto en .devin/
|
|
470
|
+
detect: () => fs3.existsSync(home(".devin")) || fs3.existsSync(home(".local", "bin", "devin")),
|
|
471
|
+
register(scope, projectDir) {
|
|
472
|
+
const dir = scope === "project" ? projectDir : home();
|
|
473
|
+
const file = path3.join(dir, ".devin", "mcp_config.local.json");
|
|
474
|
+
try {
|
|
475
|
+
const cfg = readJsonSafe(file);
|
|
476
|
+
const servers = cfg["mcpServers"] ?? {};
|
|
477
|
+
servers["alexandria"] = { ...serverCmd(), transport: "stdio" };
|
|
478
|
+
cfg["mcpServers"] = servers;
|
|
479
|
+
writeJson(file, cfg);
|
|
480
|
+
return { ok: true, file };
|
|
481
|
+
} catch (e) {
|
|
482
|
+
return { ok: false, file, detail: e.message };
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
},
|
|
465
486
|
{
|
|
466
487
|
id: "cline",
|
|
467
488
|
name: "Cline (VS Code)",
|
|
@@ -684,7 +705,8 @@ var PERSONAL_CONFIG_FILES = [
|
|
|
684
705
|
".cursor/mcp.json",
|
|
685
706
|
"opencode.json",
|
|
686
707
|
".vscode/mcp.json",
|
|
687
|
-
".gemini/settings.json"
|
|
708
|
+
".gemini/settings.json",
|
|
709
|
+
".devin/mcp_config.local.json"
|
|
688
710
|
];
|
|
689
711
|
function ensureGitignore(projectDir, vaultRoot) {
|
|
690
712
|
if (!fs4.existsSync(path4.join(projectDir, ".git"))) return null;
|
package/dist/mcp/server.js
CHANGED
|
@@ -186,10 +186,11 @@ server.tool(
|
|
|
186
186
|
task: z.string().describe("Qu\xE9 tarea se verific\xF3"),
|
|
187
187
|
passed: z.boolean().describe("Lo que T\xDA crees que pas\xF3 (se compara contra el resultado real del comando)"),
|
|
188
188
|
verify_command: z.string().optional().describe('Comando a EJECUTAR para verificar de verdad; exit 0 = pas\xF3. Ej. "npm test", "npm run build". Preferido sobre evidence.'),
|
|
189
|
+
cwd: z.string().optional().describe("Directorio donde correr verify_command. Por defecto se usa el del agente (a menudo la RA\xCDZ del workspace, no tu subproyecto): si tu comando usa rutas relativas, pasa aqu\xED la carpeta del proyecto."),
|
|
189
190
|
evidence: z.string().optional().describe("Solo si NO hay comando: evidencia textual (queda marcada como auto-reportada, sin verificar)."),
|
|
190
191
|
completes_plan: z.boolean().optional().describe("true si esta era la \xFAltima tarea y el plan queda completado")
|
|
191
192
|
},
|
|
192
|
-
async ({ plan, task, passed, verify_command, evidence, completes_plan }) => {
|
|
193
|
+
async ({ plan, task, passed, verify_command, cwd, evidence, completes_plan }) => {
|
|
193
194
|
ensureVaultStructure(vault);
|
|
194
195
|
const idx = VaultIndex.load(vault);
|
|
195
196
|
const planNote = findByTitle(idx, plan);
|
|
@@ -197,11 +198,12 @@ server.tool(
|
|
|
197
198
|
let realEvidence;
|
|
198
199
|
let verified = false;
|
|
199
200
|
let discrepancy = "";
|
|
201
|
+
const runDir = cwd?.trim() && fs.existsSync(cwd.trim()) ? cwd.trim() : process.cwd();
|
|
200
202
|
if (verify_command && verify_command.trim()) {
|
|
201
203
|
verified = true;
|
|
202
204
|
try {
|
|
203
205
|
const out = execSync(verify_command, {
|
|
204
|
-
cwd:
|
|
206
|
+
cwd: runDir,
|
|
205
207
|
timeout: 18e4,
|
|
206
208
|
encoding: "utf8",
|
|
207
209
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -209,14 +211,14 @@ server.tool(
|
|
|
209
211
|
});
|
|
210
212
|
realPassed = true;
|
|
211
213
|
realEvidence = `$ ${verify_command}
|
|
212
|
-
(exit 0)
|
|
214
|
+
(cwd: ${runDir}, exit 0)
|
|
213
215
|
${tail(out, 1500)}`;
|
|
214
216
|
} catch (e) {
|
|
215
217
|
const err = e;
|
|
216
218
|
realPassed = false;
|
|
217
219
|
const output = ((err.stdout ?? "") + "\n" + (err.stderr ?? "")).trim() || err.message;
|
|
218
220
|
realEvidence = `$ ${verify_command}
|
|
219
|
-
(exit ${err.status ?? "\u22600"})
|
|
221
|
+
(cwd: ${runDir}, exit ${err.status ?? "\u22600"})
|
|
220
222
|
${tail(output, 1500)}`;
|
|
221
223
|
}
|
|
222
224
|
if (passed !== realPassed) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ureck/alexandria",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Alexandria — bóveda de conocimiento local para agentes de IA (Claude Code, Cursor, OpenCode, Windsurf y más): captura automática, búsqueda semántica offline y grafo de conexiones estilo Obsidian. Ahorra tokens inyectando solo el contexto relevante.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|