@ureck/alexandria 1.3.0 → 1.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
@@ -63,7 +63,7 @@ Verify:
63
63
 
64
64
  ```bash
65
65
  $ ale --version
66
- 1.3.0
66
+ 1.3.1
67
67
  ```
68
68
 
69
69
  ## Getting started
@@ -29,6 +29,26 @@ import { execSync } from "child_process";
29
29
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
30
30
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
31
31
  import { z } from "zod";
32
+
33
+ // src/core/hints.ts
34
+ var NOT_FOUND = /no such file|not found|cannot find|ENOENT|does not exist/i;
35
+ var RELATIVE_PATH = /(?:^|\s)(?!-)(?!\/)[\w.-]*\.\w+|(?:^|\s)\.{1,2}\//;
36
+ function pathHint(cmd, cwdArg, runDir, evidence) {
37
+ if (!cmd) return "";
38
+ if (!NOT_FOUND.test(evidence)) return "";
39
+ if (!RELATIVE_PATH.test(cmd)) return "";
40
+ const asked = cwdArg?.trim();
41
+ const suggested = asked || "<carpeta-del-proyecto>";
42
+ const clientDropped = Boolean(asked) && asked !== runDir;
43
+ return `
44
+
45
+ \u{1F4A1} El comando se ejecut\xF3 en: ${runDir}` + (clientDropped ? ` \u2014 tu \`cwd\` NO lleg\xF3 (algunos clientes MCP descartan par\xE1metros nuevos hasta reiniciar la sesi\xF3n).` : ` \u2014 probablemente NO es la carpeta de tu proyecto.`) + `
46
+ Ruta relativa + directorio equivocado = "no such file". Dos salidas:
47
+ 1) comando autocontenido (funciona en CUALQUIER cliente): \`cd ${suggested} && ${cmd}\`
48
+ 2) rutas absolutas en el comando.`;
49
+ }
50
+
51
+ // src/mcp/server.ts
32
52
  var vault = resolveVault({ cwd: process.cwd() });
33
53
  var server = new McpServer({ name: "alexandria", version: pkgVersion() });
34
54
  var text = (t) => ({ content: [{ type: "text", text: t }] });
@@ -258,7 +278,7 @@ ${planNote ? `Plan: [[${planNote.title}]]` : ""}`
258
278
  if (!realPassed) {
259
279
  const lessons = await hybridSearch(vault, `${task} ${realEvidence.slice(0, 200)}`, 3);
260
280
  const useful = lessons.filter((l) => l.note.type === "lesson" || l.note.type === "solution");
261
- const head = `Fallo ${verified ? "CONFIRMADO por el comando" : "registrado (auto-reportado)"} (${path.relative(vault.root, file)}).${discrepancy}`;
281
+ const head = `Fallo ${verified ? "CONFIRMADO por el comando" : "registrado (auto-reportado)"} (${path.relative(vault.root, file)}).${discrepancy}` + pathHint(verify_command, cwd, runDir, realEvidence);
262
282
  if (useful.length > 0) {
263
283
  return text(
264
284
  `${head}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ureck/alexandria",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
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",