@ureck/alexandria 1.0.0 → 1.2.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 +17 -2
- package/dist/chunk-53SIGH5A.js +69 -0
- package/dist/{chunk-DYCARGQR.js → chunk-CIOCSIB5.js} +50 -0
- package/dist/{chunk-DCKYTO4O.js → chunk-FBGIFNIO.js} +1 -1
- package/dist/chunk-QB37UGO6.js +490 -0
- package/dist/{chunk-RZI7TYAG.js → chunk-UWB6RKVN.js} +2 -1
- package/dist/{chunk-DHXL36RG.js → chunk-ZIQYAQCF.js} +19 -33
- package/dist/cli.js +574 -159
- package/dist/hooks/on-prompt.js +41 -27
- package/dist/hooks/on-session-start.js +9 -9
- package/dist/hooks/on-stop.js +27 -3
- package/dist/mcp/server.js +10 -10
- package/dist/{viewer-73ZWPIDC.js → viewer-JQCSWJ3C.js} +2 -3
- package/package.json +1 -1
- package/dist/chunk-D5ROL42O.js +0 -267
- package/dist/chunk-DEDAOKAV.js +0 -44
- package/dist/chunk-XWR74BQ2.js +0 -170
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
hybridSearch
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UWB6RKVN.js";
|
|
5
5
|
|
|
6
6
|
// src/core/planning.ts
|
|
7
|
+
var MAX_ITEMS = 2;
|
|
8
|
+
var EXCERPT_CHARS = 150;
|
|
7
9
|
async function planContext(vault, query) {
|
|
8
10
|
const out = { similarPlans: [], lessons: [] };
|
|
9
11
|
try {
|
|
10
12
|
const results = await hybridSearch(vault, query, 8);
|
|
11
13
|
for (const r of results) {
|
|
12
|
-
const excerpt = (r.excerpts[0] ?? "").replace(/\n+/g, " ").slice(0,
|
|
13
|
-
if (r.note.type === "plan" && out.similarPlans.length <
|
|
14
|
-
out.similarPlans.push(`\xAB${r.note.title}\xBB (${r.note.status ?? "
|
|
15
|
-
} else if ((r.note.type === "lesson" || r.note.type === "solution") && out.lessons.length <
|
|
14
|
+
const excerpt = (r.excerpts[0] ?? "").replace(/\n+/g, " ").slice(0, EXCERPT_CHARS);
|
|
15
|
+
if (r.note.type === "plan" && out.similarPlans.length < MAX_ITEMS) {
|
|
16
|
+
out.similarPlans.push(`\xAB${r.note.title}\xBB (${r.note.status ?? "?"}): ${excerpt}`);
|
|
17
|
+
} else if ((r.note.type === "lesson" || r.note.type === "solution") && out.lessons.length < MAX_ITEMS) {
|
|
16
18
|
out.lessons.push(`\xAB${r.note.title}\xBB: ${excerpt}`);
|
|
17
19
|
}
|
|
18
20
|
}
|
|
@@ -21,39 +23,23 @@ async function planContext(vault, query) {
|
|
|
21
23
|
return out;
|
|
22
24
|
}
|
|
23
25
|
var FAT_TASK_CHARS = 140;
|
|
26
|
+
var MAX_HINTS = 3;
|
|
24
27
|
function planQualityHints(dod, tasks, design) {
|
|
25
28
|
const hints = [];
|
|
26
|
-
if (dod.length < 2) {
|
|
27
|
-
hints.push("DoD con menos de 2 criterios \u2014 agrega criterios verificables por comando (tests, build, curl).");
|
|
28
|
-
}
|
|
29
|
-
const vague = dod.filter((d) => /funcione bien|quede bonito|esté listo|sea mejor/i.test(d));
|
|
30
|
-
if (vague.length) {
|
|
31
|
-
hints.push(`Criterios no verificables (${vague.length}): reescr\xEDbelos como algo que un comando pueda confirmar.`);
|
|
32
|
-
}
|
|
33
29
|
const fat = tasks.filter((t) => t.length > FAT_TASK_CHARS);
|
|
34
|
-
if (fat.length) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return hints;
|
|
30
|
+
if (fat.length) hints.push(`${fat.length} tarea(s) gorda(s) (>${FAT_TASK_CHARS}c) \u2014 1 tarea = 1 task_verify`);
|
|
31
|
+
if (dod.length < 2) hints.push("DoD <2 criterios verificables");
|
|
32
|
+
const vague = dod.filter((d) => /funcione bien|quede bonito|esté listo|sea mejor/i.test(d));
|
|
33
|
+
if (vague.length) hints.push(`${vague.length} criterio(s) no verificable(s) por comando`);
|
|
34
|
+
if (tasks.length > 5 && !design?.trim()) hints.push("sin `design` (plan grande)");
|
|
35
|
+
return hints.slice(0, MAX_HINTS);
|
|
41
36
|
}
|
|
42
37
|
function architectBlock(ctx, hints) {
|
|
43
38
|
const parts = [];
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (ctx.lessons.length) {
|
|
49
|
-
parts.push(`LECCIONES RELEVANTES (consid\xE9ralas al planear):
|
|
50
|
-
${ctx.lessons.map((l) => `- ${l}`).join("\n")}`);
|
|
51
|
-
}
|
|
52
|
-
if (hints.length) {
|
|
53
|
-
parts.push(`SUGERENCIAS DE CALIDAD (el plan qued\xF3 guardado; mej\xF3ralo si aplican):
|
|
54
|
-
${hints.map((h) => `- ${h}`).join("\n")}`);
|
|
55
|
-
}
|
|
56
|
-
return parts.join("\n\n");
|
|
39
|
+
for (const p of ctx.similarPlans) parts.push(`Similar: ${p}`);
|
|
40
|
+
for (const l of ctx.lessons) parts.push(`Lecci\xF3n: ${l}`);
|
|
41
|
+
if (hints.length) parts.push(`Hints: ${hints.join(" \xB7 ")}`);
|
|
42
|
+
return parts.join("\n");
|
|
57
43
|
}
|
|
58
44
|
|
|
59
45
|
// src/core/register.ts
|
|
@@ -187,12 +173,12 @@ export {
|
|
|
187
173
|
planContext,
|
|
188
174
|
planQualityHints,
|
|
189
175
|
architectBlock,
|
|
190
|
-
distDir,
|
|
191
176
|
registerHooks,
|
|
192
177
|
unregisterHooks,
|
|
193
178
|
projectSettingsPath,
|
|
194
179
|
globalSettingsPath,
|
|
195
180
|
hooksRegistered,
|
|
181
|
+
serverCommand,
|
|
196
182
|
registerMcpProject,
|
|
197
183
|
registerMcpGlobal,
|
|
198
184
|
mcpRegisteredProject,
|