@ureck/alexandria 0.5.0 → 0.5.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 +12 -7
- package/dist/{chunk-BCLBZ7NX.js → chunk-3ETM6PKR.js} +1 -1
- package/dist/{chunk-MLA3KZPZ.js → chunk-7G3NPKDO.js} +4 -1
- package/dist/{chunk-KHTYRYDR.js → chunk-IQM5S5N4.js} +8 -8
- package/dist/{chunk-RLVCH6CZ.js → chunk-UTXUGXDB.js} +1 -1
- package/dist/{chunk-OPUPZRP6.js → chunk-XITAQVOZ.js} +13 -4
- package/dist/cli.js +102 -22
- package/dist/hooks/on-prompt.js +3 -3
- package/dist/hooks/on-session-start.js +2 -2
- package/dist/mcp/server.js +3 -3
- package/dist/{viewer-57T7UOFE.js → viewer-G3N57646.js} +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ Verify:
|
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
$ ale --version
|
|
64
|
-
0.5.
|
|
64
|
+
0.5.2
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
## Getting started
|
|
@@ -169,10 +169,15 @@ $ ale stats
|
|
|
169
169
|
Plans: 6 (1 open) · Verifications: 14 (86% ✓)
|
|
170
170
|
Lessons: 9 (4 reused — each reuse = a debug session that never happened)
|
|
171
171
|
|
|
172
|
-
|
|
173
|
-
Context injections: 57
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
📊 Measured (facts, not estimates)
|
|
173
|
+
Context injections: 57
|
|
174
|
+
Solution cache hits: 12 (~9,400 tokens — clearest win: solutions not re-derived)
|
|
175
|
+
Injected tokens (cost): ~21,300
|
|
176
|
+
|
|
177
|
+
💰 Estimated savings (band, NOT audited)
|
|
178
|
+
~63,900 – 170,400 tokens
|
|
179
|
+
Assumption: injected context replaces re-reading 3–8× its size in files. Not a
|
|
180
|
+
measurement — the real number depends on what you'd have re-read without the vault.
|
|
176
181
|
```
|
|
177
182
|
|
|
178
183
|
### Audit your vault's health
|
|
@@ -251,7 +256,7 @@ AI agent session
|
|
|
251
256
|
|
|
252
257
|
| Command | What it does |
|
|
253
258
|
|---|---|
|
|
254
|
-
| `ale init [--project] [--path <dir>] [--agents <ids>] [--auto\|--manual] [--no-protocol]` | Installs everything: vault
|
|
259
|
+
| `ale init [--project] [--path <dir>] [--agents <ids>] [--auto\|--manual] [--no-protocol] [--portable]` | Installs everything: vault, hooks, MCP, .gitignore, project scan, CLAUDE.md. `--portable` writes an npx-based MCP command safe to commit for teams |
|
|
255
260
|
| `ale agents [ids] [--project]` | List agents / register the MCP server |
|
|
256
261
|
| `ale search <query> [-k n] [--expand]` | Hybrid search; `--expand` pulls graph neighbors |
|
|
257
262
|
| `ale add <title> [-c text] [--file <path>] [-t tags]` | Save a note (inline, from file, or stdin) |
|
|
@@ -274,7 +279,7 @@ AI agent session
|
|
|
274
279
|
- **Everything runs on your machine**: the embedding model is downloaded once (Hugging Face) and then works offline. Your notes never leave your disk. No telemetry.
|
|
275
280
|
- **No API keys, no accounts, no cost.**
|
|
276
281
|
- Dependency scanners (Socket, etc.) flag *network/shell/env access* in the dependency tree: those come from the ML runtime (`onnxruntime`/`transformers.js`, which needs filesystem access and the one-time model download) and the official MCP SDK — not from Alexandria's code. The published package runs no install scripts of its own.
|
|
277
|
-
- Generated configs (`.mcp.json`,
|
|
282
|
+
- Generated per-project configs (`.mcp.json`, `.vault.json`, etc.) point at your machine's install path, so `ale init --project` automatically gitignores them (and untracks any already committed) — they never leak to a shared repo. For a team that *wants* a shared MCP config, run `ale init --project --portable`, which writes an npx-based command that works on any machine.
|
|
278
283
|
|
|
279
284
|
## Support the project ☕
|
|
280
285
|
|
|
@@ -80,6 +80,9 @@ var VaultIndex = class _VaultIndex {
|
|
|
80
80
|
const rel = path.relative(this.vault.root, abs).split(path.sep).join("/");
|
|
81
81
|
onDisk.set(rel, { abs, mtime: fs.statSync(abs).mtimeMs });
|
|
82
82
|
}
|
|
83
|
+
if (withEmbeddings && this.emb === null && this.meta.chunks.length > 0) {
|
|
84
|
+
force = true;
|
|
85
|
+
}
|
|
83
86
|
const changed = [];
|
|
84
87
|
for (const [rel, info] of onDisk) {
|
|
85
88
|
if (force || this.meta.mtimes[rel] !== info.mtime) changed.push(rel);
|
|
@@ -168,7 +171,7 @@ ${c.text}`),
|
|
|
168
171
|
this.rebuildLinks();
|
|
169
172
|
this.save();
|
|
170
173
|
try {
|
|
171
|
-
const { writeStaticGraph } = await import("./viewer-
|
|
174
|
+
const { writeStaticGraph } = await import("./viewer-G3N57646.js");
|
|
172
175
|
writeStaticGraph(this);
|
|
173
176
|
} catch {
|
|
174
177
|
}
|
|
@@ -73,7 +73,10 @@ function hooksRegistered(settingsPath) {
|
|
|
73
73
|
return false;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function serverCommand(portable) {
|
|
77
|
+
return portable ? { command: "npx", args: ["-y", "@ureck/alexandria", "alexandria", "serve-mcp"] } : { command: "node", args: [path.join(distDir(), "mcp", "server.js")] };
|
|
78
|
+
}
|
|
79
|
+
function registerMcpProject(projectDir, portable = false) {
|
|
77
80
|
const file = path.join(projectDir, ".mcp.json");
|
|
78
81
|
let cfg = {};
|
|
79
82
|
try {
|
|
@@ -84,17 +87,14 @@ function registerMcpProject(projectDir) {
|
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
cfg.mcpServers ??= {};
|
|
87
|
-
cfg.mcpServers["alexandria"] =
|
|
88
|
-
command: "node",
|
|
89
|
-
args: [path.join(distDir(), "mcp", "server.js")]
|
|
90
|
-
};
|
|
90
|
+
cfg.mcpServers["alexandria"] = serverCommand(portable);
|
|
91
91
|
fs.writeFileSync(file, JSON.stringify(cfg, null, 2) + "\n");
|
|
92
92
|
return file;
|
|
93
93
|
}
|
|
94
|
-
function registerMcpGlobal() {
|
|
95
|
-
const
|
|
94
|
+
function registerMcpGlobal(portable = false) {
|
|
95
|
+
const { command, args } = serverCommand(portable);
|
|
96
96
|
try {
|
|
97
|
-
execFileSync("claude", ["mcp", "add", "--scope", "user", "alexandria", "--",
|
|
97
|
+
execFileSync("claude", ["mcp", "add", "--scope", "user", "alexandria", "--", command, ...args], {
|
|
98
98
|
stdio: "pipe",
|
|
99
99
|
timeout: 15e3
|
|
100
100
|
});
|
|
@@ -14,13 +14,17 @@ function logInjection(vault, line) {
|
|
|
14
14
|
} catch {
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
var EST_LOW = 3;
|
|
18
|
+
var EST_HIGH = 8;
|
|
17
19
|
function readStats(vault) {
|
|
18
20
|
const file = path.join(vault.cache, "stats.jsonl");
|
|
19
21
|
const summary = {
|
|
20
22
|
injections: 0,
|
|
21
23
|
solutionCacheHits: 0,
|
|
22
24
|
injectedTokens: 0,
|
|
23
|
-
|
|
25
|
+
cacheHitTokens: 0,
|
|
26
|
+
estSavedLow: 0,
|
|
27
|
+
estSavedHigh: 0
|
|
24
28
|
};
|
|
25
29
|
try {
|
|
26
30
|
for (const raw of fs.readFileSync(file, "utf8").split("\n")) {
|
|
@@ -28,14 +32,19 @@ function readStats(vault) {
|
|
|
28
32
|
try {
|
|
29
33
|
const line = JSON.parse(raw);
|
|
30
34
|
summary.injections++;
|
|
31
|
-
|
|
32
|
-
summary.injectedTokens +=
|
|
35
|
+
const tk = charsToTokens(line.injectedChars);
|
|
36
|
+
summary.injectedTokens += tk;
|
|
37
|
+
if (line.kind === "solution-cache") {
|
|
38
|
+
summary.solutionCacheHits++;
|
|
39
|
+
summary.cacheHitTokens += tk;
|
|
40
|
+
}
|
|
33
41
|
} catch {
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
} catch {
|
|
37
45
|
}
|
|
38
|
-
summary.
|
|
46
|
+
summary.estSavedLow = summary.injectedTokens * EST_LOW;
|
|
47
|
+
summary.estSavedHigh = summary.injectedTokens * EST_HIGH;
|
|
39
48
|
return summary;
|
|
40
49
|
}
|
|
41
50
|
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readStats
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XITAQVOZ.js";
|
|
5
5
|
import {
|
|
6
6
|
distDir,
|
|
7
7
|
globalSettingsPath,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
registerMcpGlobal,
|
|
14
14
|
registerMcpProject,
|
|
15
15
|
unregisterHooks
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IQM5S5N4.js";
|
|
17
17
|
import {
|
|
18
18
|
hybridSearch
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3ETM6PKR.js";
|
|
20
20
|
import {
|
|
21
21
|
defaultVaultPath,
|
|
22
22
|
ensureVaultStructure,
|
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
} from "./chunk-DYCARGQR.js";
|
|
31
31
|
import {
|
|
32
32
|
serveGraph
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-UTXUGXDB.js";
|
|
34
34
|
import {
|
|
35
35
|
VaultIndex
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-7G3NPKDO.js";
|
|
37
37
|
import {
|
|
38
38
|
createNote,
|
|
39
39
|
slugify,
|
|
@@ -438,27 +438,57 @@ async function showBanner(animate) {
|
|
|
438
438
|
import fs3 from "fs";
|
|
439
439
|
import os3 from "os";
|
|
440
440
|
import path3 from "path";
|
|
441
|
+
import { execFileSync as execFileSync3 } from "child_process";
|
|
442
|
+
var PERSONAL_CONFIG_FILES = [
|
|
443
|
+
".vault.json",
|
|
444
|
+
".mcp.json",
|
|
445
|
+
".cursor/mcp.json",
|
|
446
|
+
"opencode.json",
|
|
447
|
+
".vscode/mcp.json",
|
|
448
|
+
".gemini/settings.json"
|
|
449
|
+
];
|
|
441
450
|
function ensureGitignore(projectDir, vaultRoot) {
|
|
442
451
|
if (!fs3.existsSync(path3.join(projectDir, ".git"))) return null;
|
|
452
|
+
const entries = [];
|
|
443
453
|
const rel = path3.relative(projectDir, vaultRoot);
|
|
444
|
-
if (rel.startsWith(".."))
|
|
454
|
+
if (!rel.startsWith("..")) entries.push(`${rel.split(path3.sep).join("/")}/`);
|
|
455
|
+
entries.push(...PERSONAL_CONFIG_FILES);
|
|
445
456
|
const file = path3.join(projectDir, ".gitignore");
|
|
446
|
-
const entries = [`${rel.split(path3.sep).join("/")}/`];
|
|
447
457
|
let text = "";
|
|
448
458
|
try {
|
|
449
459
|
text = fs3.readFileSync(file, "utf8");
|
|
450
460
|
} catch {
|
|
451
461
|
}
|
|
452
|
-
const
|
|
462
|
+
const has = (e) => text.split("\n").some((l) => l.trim() === e || l.trim() === e.replace(/\/$/, ""));
|
|
463
|
+
const missing = entries.filter((e) => !has(e));
|
|
453
464
|
if (missing.length === 0) return null;
|
|
454
465
|
const block = `${text.trimEnd()}
|
|
455
466
|
|
|
456
|
-
# Alexandria (conocimiento personal
|
|
467
|
+
# Alexandria (conocimiento y config personal \u2014 no del repo)
|
|
457
468
|
${missing.join("\n")}
|
|
458
469
|
`;
|
|
459
470
|
fs3.writeFileSync(file, text.trim() ? block : block.trimStart());
|
|
460
471
|
return file;
|
|
461
472
|
}
|
|
473
|
+
function untrackPersonalConfigs(projectDir) {
|
|
474
|
+
if (!fs3.existsSync(path3.join(projectDir, ".git"))) return [];
|
|
475
|
+
const untracked = [];
|
|
476
|
+
for (const f of PERSONAL_CONFIG_FILES) {
|
|
477
|
+
if (!fs3.existsSync(path3.join(projectDir, f))) continue;
|
|
478
|
+
try {
|
|
479
|
+
const tracked = execFileSync3("git", ["ls-files", "--error-unmatch", f], {
|
|
480
|
+
cwd: projectDir,
|
|
481
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
482
|
+
});
|
|
483
|
+
if (tracked.toString().trim()) {
|
|
484
|
+
execFileSync3("git", ["rm", "--cached", "--quiet", f], { cwd: projectDir, stdio: "ignore" });
|
|
485
|
+
untracked.push(f);
|
|
486
|
+
}
|
|
487
|
+
} catch {
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
return untracked;
|
|
491
|
+
}
|
|
462
492
|
var CLAUDE_MD_START = "<!-- alexandria:start -->";
|
|
463
493
|
var CLAUDE_MD_END = "<!-- alexandria:end -->";
|
|
464
494
|
function configureClaudeMd(scope, projectDir) {
|
|
@@ -487,6 +517,24 @@ function configureClaudeMd(scope, projectDir) {
|
|
|
487
517
|
fs3.writeFileSync(file, text);
|
|
488
518
|
return file;
|
|
489
519
|
}
|
|
520
|
+
function removeClaudeMd(scope, projectDir) {
|
|
521
|
+
const file = scope === "project" ? path3.join(projectDir, "CLAUDE.md") : path3.join(os3.homedir(), ".claude", "CLAUDE.md");
|
|
522
|
+
let text;
|
|
523
|
+
try {
|
|
524
|
+
text = fs3.readFileSync(file, "utf8");
|
|
525
|
+
} catch {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
if (!text.includes(CLAUDE_MD_START)) return null;
|
|
529
|
+
const re = new RegExp(`\\n*${CLAUDE_MD_START}[\\s\\S]*?${CLAUDE_MD_END}\\n*`);
|
|
530
|
+
const cleaned = text.replace(re, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
531
|
+
if (cleaned === "") {
|
|
532
|
+
fs3.rmSync(file, { force: true });
|
|
533
|
+
} else {
|
|
534
|
+
fs3.writeFileSync(file, cleaned + "\n");
|
|
535
|
+
}
|
|
536
|
+
return file;
|
|
537
|
+
}
|
|
490
538
|
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", ".next", "dist", "build", ".vault", ".claude", "coverage", "Alexandria", "KnowledgeVault"]);
|
|
491
539
|
function scanProject(vault, projectDir) {
|
|
492
540
|
const name = path3.basename(projectDir);
|
|
@@ -544,15 +592,15 @@ ${readme.split("\n").slice(0, 15).join("\n")}`);
|
|
|
544
592
|
}
|
|
545
593
|
|
|
546
594
|
// src/cli.ts
|
|
547
|
-
function registerAgentsMcp(agents, scope, cwd) {
|
|
595
|
+
function registerAgentsMcp(agents, scope, cwd, portable = false) {
|
|
548
596
|
for (const agent of agents) {
|
|
549
597
|
if (agent.id === "claude") {
|
|
550
598
|
if (scope === "project") {
|
|
551
|
-
const file = registerMcpProject(cwd);
|
|
599
|
+
const file = registerMcpProject(cwd, portable);
|
|
552
600
|
console.log(pc.green(`\u2713 MCP \u2192 Claude Code (${file})`));
|
|
553
601
|
continue;
|
|
554
602
|
}
|
|
555
|
-
if (registerMcpGlobal()) {
|
|
603
|
+
if (registerMcpGlobal(portable)) {
|
|
556
604
|
console.log(pc.green("\u2713 MCP \u2192 Claude Code (scope user, v\xEDa claude mcp add)"));
|
|
557
605
|
continue;
|
|
558
606
|
}
|
|
@@ -599,7 +647,7 @@ async function ensureReady(vault = getVault()) {
|
|
|
599
647
|
program.command("init").description("Crea/conecta la b\xF3veda e instala TODO: modelo, hooks (Claude Code) y MCP en tus agentes de IA (una sola vez, persiste entre sesiones)").option("--project", "registrar para este proyecto (cwd): .vault.json + .claude/settings.json + .mcp.json").option("--global", "registrar para todas las sesiones del usuario (default)").option(
|
|
600
648
|
"--path <dir>",
|
|
601
649
|
"ruta del vault Obsidian (existente o nuevo). Default: ./Alexandria con --project, ~/Alexandria en global"
|
|
602
|
-
).option("--auto", "configurar el uso autom\xE1tico en CLAUDE.md sin preguntar").option("--manual", "no tocar CLAUDE.md (config\xFAralo t\xFA)").option("--no-protocol", "instalar sin el Protocolo Alexandria (solo b\xF3veda cl\xE1sica)").option("--skills", "al final, recomendar e instalar skills seg\xFAn el contenido").option(
|
|
650
|
+
).option("--auto", "configurar el uso autom\xE1tico en CLAUDE.md sin preguntar").option("--manual", "no tocar CLAUDE.md (config\xFAralo t\xFA)").option("--no-protocol", "instalar sin el Protocolo Alexandria (solo b\xF3veda cl\xE1sica)").option("--portable", "MCP con comando npx (commiteable en repos de equipo) en vez de ruta local").option("--skills", "al final, recomendar e instalar skills seg\xFAn el contenido").option(
|
|
603
651
|
"--agents <ids>",
|
|
604
652
|
`agentes de IA donde registrar el MCP: "all", "detected" o csv de ${AGENTS.map((a) => a.id).join(",")} (default: claude + detectados)`
|
|
605
653
|
).action(async (opts) => {
|
|
@@ -625,13 +673,20 @@ program.command("init").description("Crea/conecta la b\xF3veda e instala TODO: m
|
|
|
625
673
|
console.log(pc.dim(" SessionStart (digest) \xB7 UserPromptSubmit (contexto+captura) \xB7 Stop/PreCompact (sesiones)"));
|
|
626
674
|
const scope = isProject ? "project" : "global";
|
|
627
675
|
const chosen = opts.agents ? resolveAgents(opts.agents) : [...AGENTS.filter((a) => a.id === "claude" || a.detect())];
|
|
628
|
-
registerAgentsMcp(chosen, scope, cwd);
|
|
676
|
+
registerAgentsMcp(chosen, scope, cwd, opts.portable);
|
|
677
|
+
if (opts.portable) console.log(pc.dim(" MCP portable (npx) \u2014 apto para commitear en repos de equipo"));
|
|
629
678
|
const skipped = AGENTS.filter((a) => !chosen.includes(a));
|
|
630
679
|
if (skipped.length > 0) {
|
|
631
680
|
console.log(pc.dim(` Otros agentes disponibles: ${skipped.map((a) => a.id).join(", ")} \u2192 ale agents <ids>`));
|
|
632
681
|
}
|
|
633
682
|
if (isProject) {
|
|
634
683
|
const gi = ensureGitignore(cwd, vault.root);
|
|
684
|
+
if (!opts.portable) {
|
|
685
|
+
const untracked = untrackPersonalConfigs(cwd);
|
|
686
|
+
if (untracked.length > 0) {
|
|
687
|
+
console.log(pc.green(`\u2713 Configs personales sacados del \xEDndice de git: ${untracked.join(", ")}`));
|
|
688
|
+
}
|
|
689
|
+
}
|
|
635
690
|
if (gi) console.log(pc.green(`\u2713 B\xF3veda agregada a ${gi}`));
|
|
636
691
|
}
|
|
637
692
|
let auto = opts.auto ? true : opts.manual ? false : void 0;
|
|
@@ -873,11 +928,16 @@ program.command("stats").description("Estado de la b\xF3veda y tokens ahorrados"
|
|
|
873
928
|
const passed = verifs.filter((n) => n.status === "completed").length;
|
|
874
929
|
console.log(` Planes: ${plans.length} (${plans.filter((p) => p.status === "active").length} abiertos) \xB7 Verificaciones: ${verifs.length}${verifs.length ? ` (${Math.round(passed / verifs.length * 100)}% \u2713)` : ""}`);
|
|
875
930
|
console.log(` Lecciones: ${lessons.length} (${reused} reutilizadas \u2014 cada reuso = debug que no se repiti\xF3)`);
|
|
876
|
-
console.log(pc.bold("\n\u{
|
|
877
|
-
console.log(` Inyecciones de contexto: ${s.injections}
|
|
878
|
-
console.log(`
|
|
879
|
-
console.log(` Tokens
|
|
880
|
-
|
|
931
|
+
console.log(pc.bold("\n\u{1F4CA} Medido (hechos, no estimaci\xF3n)"));
|
|
932
|
+
console.log(` Inyecciones de contexto: ${s.injections}`);
|
|
933
|
+
console.log(` Aciertos de cach\xE9 de soluci\xF3n: ${s.solutionCacheHits} (${s.cacheHitTokens.toLocaleString()} tokens \u2014 el ahorro m\xE1s claro: soluciones no re-derivadas)`);
|
|
934
|
+
console.log(` Tokens inyectados (costo): ~${s.injectedTokens.toLocaleString()}`);
|
|
935
|
+
if (s.injectedTokens > 0) {
|
|
936
|
+
console.log(pc.bold("\n\u{1F4B0} Ahorro estimado ") + pc.dim("(banda, NO auditado)"));
|
|
937
|
+
console.log(` ~${pc.green(s.estSavedLow.toLocaleString())} \u2013 ${pc.green(s.estSavedHigh.toLocaleString())} tokens`);
|
|
938
|
+
console.log(pc.dim(` Supuesto: el contexto inyectado sustituye releer 3\u20138\xD7 su tama\xF1o en archivos. No es medici\xF3n; el n\xFAmero real depende de qu\xE9 habr\xEDas rele\xEDdo sin la b\xF3veda.`));
|
|
939
|
+
}
|
|
940
|
+
console.log();
|
|
881
941
|
});
|
|
882
942
|
async function runSkills(opts) {
|
|
883
943
|
const { vault } = await ensureReady();
|
|
@@ -947,11 +1007,31 @@ program.command("doctor").description("Verifica y repara la instalaci\xF3n (mode
|
|
|
947
1007
|
console.log(`${pc.green("\u2713")} \xCDndice al d\xEDa (${res.changed} reindexadas, ${Object.keys(idx.meta.notes).length} notas)
|
|
948
1008
|
`);
|
|
949
1009
|
});
|
|
950
|
-
program.command("uninstall").description("
|
|
951
|
-
const
|
|
1010
|
+
program.command("uninstall").description("Reversi\xF3n limpia: quita hooks, bloque de CLAUDE.md y MCP del proyecto (no borra la b\xF3veda ni las notas)").option("--project", "quitar del proyecto (cwd)").action((opts) => {
|
|
1011
|
+
const cwd = process.cwd();
|
|
1012
|
+
const scope = opts.project ? "project" : "global";
|
|
1013
|
+
const settings = opts.project ? projectSettingsPath(cwd) : globalSettingsPath();
|
|
952
1014
|
unregisterHooks(settings);
|
|
953
1015
|
console.log(pc.green(`\u2713 Hooks de alexandria eliminados de ${settings}`));
|
|
954
|
-
|
|
1016
|
+
const claudeMd = removeClaudeMd(scope, cwd);
|
|
1017
|
+
if (claudeMd) console.log(pc.green(`\u2713 Bloque de Alexandria removido de ${claudeMd}`));
|
|
1018
|
+
if (opts.project) {
|
|
1019
|
+
const mcpFile = path4.join(cwd, ".mcp.json");
|
|
1020
|
+
try {
|
|
1021
|
+
const cfg = JSON.parse(fs4.readFileSync(mcpFile, "utf8"));
|
|
1022
|
+
if (cfg.mcpServers?.alexandria) {
|
|
1023
|
+
delete cfg.mcpServers.alexandria;
|
|
1024
|
+
if (Object.keys(cfg.mcpServers).length === 0) delete cfg.mcpServers;
|
|
1025
|
+
if (Object.keys(cfg).length === 0) fs4.rmSync(mcpFile, { force: true });
|
|
1026
|
+
else fs4.writeFileSync(mcpFile, JSON.stringify(cfg, null, 2) + "\n");
|
|
1027
|
+
console.log(pc.green("\u2713 MCP removido de .mcp.json"));
|
|
1028
|
+
}
|
|
1029
|
+
} catch {
|
|
1030
|
+
}
|
|
1031
|
+
console.log(pc.dim(' Otros agentes (Cursor/OpenCode/\u2026): quita "alexandria" de su config si lo registraste.'));
|
|
1032
|
+
} else {
|
|
1033
|
+
console.log(pc.dim(" MCP global: qu\xEDtalo con `claude mcp remove alexandria`. Tus notas quedan intactas."));
|
|
1034
|
+
}
|
|
955
1035
|
});
|
|
956
1036
|
program.command("serve-mcp").description("Correr el servidor MCP por stdio (lo usa Claude Code internamente)").action(async () => {
|
|
957
1037
|
await import("./mcp/server.js");
|
package/dist/hooks/on-prompt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
logInjection
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-XITAQVOZ.js";
|
|
5
5
|
import {
|
|
6
6
|
projectName,
|
|
7
7
|
runHook,
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
} from "../chunk-DEDAOKAV.js";
|
|
10
10
|
import {
|
|
11
11
|
hybridSearch
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-3ETM6PKR.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveVault,
|
|
15
15
|
vaultExists
|
|
16
16
|
} from "../chunk-DYCARGQR.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-7G3NPKDO.js";
|
|
18
18
|
import {
|
|
19
19
|
createNote,
|
|
20
20
|
touchNote
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
logInjection
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-XITAQVOZ.js";
|
|
5
5
|
import {
|
|
6
6
|
projectName,
|
|
7
7
|
runHook,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "../chunk-DYCARGQR.js";
|
|
15
15
|
import {
|
|
16
16
|
VaultIndex
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-7G3NPKDO.js";
|
|
18
18
|
import "../chunk-XWR74BQ2.js";
|
|
19
19
|
import "../chunk-EDYBSJSS.js";
|
|
20
20
|
|
package/dist/mcp/server.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
pkgVersion
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-IQM5S5N4.js";
|
|
5
5
|
import {
|
|
6
6
|
hybridSearch
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-3ETM6PKR.js";
|
|
8
8
|
import {
|
|
9
9
|
ensureVaultStructure,
|
|
10
10
|
resolveVault
|
|
11
11
|
} from "../chunk-DYCARGQR.js";
|
|
12
12
|
import {
|
|
13
13
|
VaultIndex
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-7G3NPKDO.js";
|
|
15
15
|
import {
|
|
16
16
|
createNote,
|
|
17
17
|
setNoteStatus,
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
renderGraphHtml,
|
|
5
5
|
serveGraph,
|
|
6
6
|
writeStaticGraph
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-UTXUGXDB.js";
|
|
8
|
+
import "./chunk-7G3NPKDO.js";
|
|
9
9
|
import "./chunk-XWR74BQ2.js";
|
|
10
10
|
import "./chunk-EDYBSJSS.js";
|
|
11
11
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ureck/alexandria",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
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",
|