pi-ate-memory 1.3.2 → 1.3.3

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.
@@ -26,7 +26,10 @@ export function collectMemoryAssets(cwd: string): KnowledgeAsset[] {
26
26
  try {
27
27
  for (const f of fs.readdirSync(dir)) {
28
28
  if (!f.endsWith(".md") || f === "MEMORY.md") continue;
29
- assets.push({ entry: `${prefix}/${f}`, desc: "" });
29
+ // desc = 文件名 kw 段(--kw1,kw2,kw3 → "kw1 / kw2 / kw3")——零 IO、总有值
30
+ const kwSeg = f.replace(/\.md$/, "").split("--")[1] ?? "";
31
+ const desc = kwSeg.split(",").map(s => s.trim()).filter(Boolean).slice(0, 5).join(" / ");
32
+ assets.push({ entry: `${prefix}/${f}`, desc });
30
33
  }
31
34
  } catch {
32
35
  // 目录不存在(L2 常见):跳过
package/lib/routing.ts CHANGED
@@ -165,7 +165,14 @@ export class MemoryRouter {
165
165
  const candidates = hits.filter((a) => !this.readTracker.hasRead(a.entry)).slice(0, 3);
166
166
  if (candidates.length === 0) return;
167
167
 
168
- const lines = candidates.map((a) => `- ${a.entry}(${a.desc.slice(0, 60)})`).join("\n");
168
+ const lines = candidates.map((a) => {
169
+ const full = a.entry.startsWith("memory/")
170
+ ? `~/.pi/agent/${a.entry}`
171
+ : a.entry.startsWith(".pi/memory/")
172
+ ? `${this.cwd}/${a.entry}`
173
+ : `${this.cwd}/${a.entry}`;
174
+ return `- ${full}(${a.desc.slice(0, 60) || "关键词见文件名"})`;
175
+ }).join("\n");
169
176
  const stems = candidates.map((a) => (a.entry.split("/").pop() ?? "").split("--")[0]).join("、");
170
177
  pi.events.emit("ephemeral:hint", {
171
178
  text: `💡 记忆路由:本段工作与以下知识资产相关(你尚未读过):\n${lines}\n如相关请 read;无关可忽略。`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ate-memory",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "File-based persistent memory for AI coding agents",
5
5
  "keywords": [
6
6
  "pi-package"