create-ai-memory 0.10.0 → 0.11.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
@@ -276,7 +276,7 @@ optional. Set `AI_MEM_ROOT` in `~/.zshrc` first if you do not want the default
276
276
  | `ai-note <text>` | Append a timestamped note to today's session log while you work |
277
277
  | `ai-lesson <topic-slug> <problem> <solution>` | Append a dated Problem/Solution entry to a cross-project `_lessons/<topic-slug>.md` -- decisions, mistakes, solutions worth recalling outside the current project |
278
278
  | `ai-mem-lint` | Check the vault's links: orphaned session logs, dangling `previous` links, unreferenced project notes |
279
- | `ai-mem-search <term> [project]` | Grep across the vault (or one project's logs) for a term, with `file:line:excerpt` |
279
+ | `ai-mem-search <term> [project]` | Grep across the vault (or one project's logs) for a term, with `file:line:excerpt`. Also resolves any `[[wikilink]]` on a matched line to its project note and shows a short excerpt -- one hop out along the graph, always on, not a flag to remember |
280
280
  | `ai-mem-vault-backup` | Commit and push the vault if it's git-backed. `ai-note`/`ai-lesson` already call this; use it directly after editing a session log or project note by hand |
281
281
 
282
282
  Project is auto-resolved from the current git repo; pass a name to override.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ai-memory",
3
- "version": "0.10.0",
3
+ "version": "0.11.1",
4
4
  "description": "Persistent, agent-agnostic session memory for AI coding CLIs (Claude Code, Codex, Gemini, Cursor, opencode). One Markdown vault, any agent.",
5
5
  "bin": {
6
6
  "create-ai-memory": "bin/create-ai-memory.js"
package/shell/ai-mem.zsh CHANGED
@@ -690,7 +690,10 @@ ai-mem-lint() {
690
690
 
691
691
  # Full-text search across the vault. Plain grep -- no new dependency, and at
692
692
  # vault scale (a personal notes collection, not a codebase) there is no real
693
- # performance reason to reach for anything faster.
693
+ # performance reason to reach for anything faster. Always resolves one hop
694
+ # out along any [[wikilinks]] on a matched line (see below) -- not a flag,
695
+ # because a flag only helps if whoever's calling this remembers it exists,
696
+ # and the whole point is not depending on that.
694
697
  ai-mem-search() {
695
698
  local term="${1:-}"
696
699
  local project="${2:-}"
@@ -729,4 +732,24 @@ ai-mem-search() {
729
732
  print -r -- "$sorted"
730
733
  print -r -- "--"
731
734
  print -r -- "$(print -r -- "$raw" | wc -l | tr -d ' ') match(es) for '$term'"
735
+ # One hop out: resolve [[wikilinks]] found on matched lines to their
736
+ # target note (currently: project notes only -- the confirmed use case
737
+ # is a _lessons entry linking the project(s) it hit) and show a short
738
+ # excerpt, so a match doesn't leave you to manually chase the link
739
+ # yourself.
740
+ local links link target excerpt
741
+ links="$(print -r -- "$raw" | grep -oE '\[\[[^]]+\]\]' | sed -E 's/^\[\[|\]\]$//g' | sort -u)"
742
+ [[ -n "$links" ]] || return 0
743
+
744
+ print -r -- "--"
745
+ print -r -- "one hop out:"
746
+ while IFS= read -r link; do
747
+ [[ -n "$link" ]] || continue
748
+ target="$AI_MEM_PROJECT_DIR/${link}.md"
749
+ [[ -f "$target" ]] || continue
750
+ excerpt="$(grep -m1 -A1 '^\* \*\*Purpose:\*\*' "$target" 2>/dev/null | tail -1)"
751
+ [[ -n "$excerpt" ]] || excerpt="$(sed -n '/^---$/,/^---$/!p' "$target" | grep -m1 -v '^$')"
752
+ print -r -- " [[$link]] -> $target"
753
+ [[ -n "$excerpt" ]] && print -r -- " $excerpt"
754
+ done <<< "$links"
732
755
  }