@ureck/alexandria 0.5.1 → 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
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
|
|
@@ -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,
|
|
@@ -928,11 +928,16 @@ program.command("stats").description("Estado de la b\xF3veda y tokens ahorrados"
|
|
|
928
928
|
const passed = verifs.filter((n) => n.status === "completed").length;
|
|
929
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)` : ""}`);
|
|
930
930
|
console.log(` Lecciones: ${lessons.length} (${reused} reutilizadas \u2014 cada reuso = debug que no se repiti\xF3)`);
|
|
931
|
-
console.log(pc.bold("\n\u{
|
|
932
|
-
console.log(` Inyecciones de contexto: ${s.injections}
|
|
933
|
-
console.log(`
|
|
934
|
-
console.log(` Tokens
|
|
935
|
-
|
|
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();
|
|
936
941
|
});
|
|
937
942
|
async function runSkills(opts) {
|
|
938
943
|
const { vault } = await ensureReady();
|
package/dist/hooks/on-prompt.js
CHANGED
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",
|