eagle-mem 4.1.1 → 4.1.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/lib/common.sh +39 -0
- package/package.json +1 -1
- package/scripts/install.sh +8 -0
- package/scripts/update.sh +8 -0
package/lib/common.sh
CHANGED
|
@@ -157,3 +157,42 @@ eagle_collect_files() {
|
|
|
157
157
|
| sed 's|^\./||') > "$output_file"
|
|
158
158
|
fi
|
|
159
159
|
}
|
|
160
|
+
|
|
161
|
+
eagle_patch_claude_md() {
|
|
162
|
+
local claude_md="$HOME/.claude/CLAUDE.md"
|
|
163
|
+
local marker="## Eagle Mem — Persistent Memory"
|
|
164
|
+
|
|
165
|
+
if [ -f "$claude_md" ] && grep -qF "$marker" "$claude_md" 2>/dev/null; then
|
|
166
|
+
return 1
|
|
167
|
+
fi
|
|
168
|
+
|
|
169
|
+
mkdir -p "$HOME/.claude"
|
|
170
|
+
|
|
171
|
+
cat >> "$claude_md" << 'EAGLE_MD'
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Eagle Mem — Persistent Memory
|
|
176
|
+
|
|
177
|
+
Eagle Mem hooks are active in every project. SessionStart injects context (overview, recent sessions, memories, tasks, core files). Stop captures session summaries. PostToolUse mirrors memories/plans/tasks.
|
|
178
|
+
|
|
179
|
+
**Rule:** Before your final response in every session, emit an `<eagle-summary>` block so the Stop hook can capture a rich summary instead of just heuristics.
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
<eagle-summary>
|
|
183
|
+
request: [what user asked] | completed: [what shipped] | learned: [non-obvious discoveries]
|
|
184
|
+
next_steps: [concrete actions] | decisions: [choice — why] | gotchas: [what surprised]
|
|
185
|
+
key_files: [path — role] | files_read: [...] | files_modified: [...]
|
|
186
|
+
</eagle-summary>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Why:** Without this block, summaries degrade to "(auto-captured)" with no decisions, gotchas, or learned context. Rich summaries are what make future sessions useful.
|
|
190
|
+
|
|
191
|
+
**How to apply:**
|
|
192
|
+
- Emit `<eagle-summary>` before your final text response, every session
|
|
193
|
+
- When Eagle Mem injects context at SessionStart, attribute it: "Eagle Mem recalls:"
|
|
194
|
+
- Do not revert decisions surfaced by PostToolUse without asking the user
|
|
195
|
+
- Never put raw secrets in the summary — Eagle Mem redacts but defense in depth
|
|
196
|
+
- If you contradict a loaded memory, update the memory file
|
|
197
|
+
EAGLE_MD
|
|
198
|
+
}
|
package/package.json
CHANGED
package/scripts/install.sh
CHANGED
|
@@ -271,6 +271,14 @@ else
|
|
|
271
271
|
eagle_ok "Config ${DIM}(already exists)${RESET}"
|
|
272
272
|
fi
|
|
273
273
|
|
|
274
|
+
# ─── Patch CLAUDE.md with Eagle Mem instructions ─────────
|
|
275
|
+
|
|
276
|
+
if eagle_patch_claude_md; then
|
|
277
|
+
eagle_ok "CLAUDE.md ${DIM}(eagle-summary instructions added)${RESET}"
|
|
278
|
+
else
|
|
279
|
+
eagle_ok "CLAUDE.md ${DIM}(already has Eagle Mem section)${RESET}"
|
|
280
|
+
fi
|
|
281
|
+
|
|
274
282
|
# ─── Save installed version ───────────────────────────────
|
|
275
283
|
|
|
276
284
|
version=$(jq -r .version "$PACKAGE_DIR/package.json" 2>/dev/null || echo "unknown")
|
package/scripts/update.sh
CHANGED
|
@@ -114,6 +114,14 @@ else
|
|
|
114
114
|
eagle_ok "Project names up to date"
|
|
115
115
|
fi
|
|
116
116
|
|
|
117
|
+
# ─── Patch CLAUDE.md with Eagle Mem instructions ─────────
|
|
118
|
+
|
|
119
|
+
if eagle_patch_claude_md; then
|
|
120
|
+
eagle_ok "CLAUDE.md updated ${DIM}(eagle-summary instructions added)${RESET}"
|
|
121
|
+
else
|
|
122
|
+
eagle_ok "CLAUDE.md up to date"
|
|
123
|
+
fi
|
|
124
|
+
|
|
117
125
|
# ─── Save installed version ───────────────────────────────
|
|
118
126
|
|
|
119
127
|
version=$(jq -r .version "$PACKAGE_DIR/package.json" 2>/dev/null || echo "unknown")
|