eagle-mem 1.4.1 → 1.4.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.
- package/hooks/session-end.sh +14 -0
- package/hooks/session-start.sh +13 -4
- package/lib/db.sh +1 -0
- package/package.json +1 -1
package/hooks/session-end.sh
CHANGED
|
@@ -19,6 +19,20 @@ session_id=$(echo "$input" | jq -r '.session_id // empty')
|
|
|
19
19
|
[ -z "$session_id" ] && exit 0
|
|
20
20
|
[ ! -f "$EAGLE_MEM_DB" ] && exit 0
|
|
21
21
|
|
|
22
|
+
cwd=$(echo "$input" | jq -r '.cwd // empty')
|
|
23
|
+
project=$(eagle_project_from_cwd "$cwd")
|
|
24
|
+
|
|
25
|
+
# Final sweep: re-capture all task files to catch status changes
|
|
26
|
+
# Claude Code may update task status without triggering PostToolUse
|
|
27
|
+
task_dir="$HOME/.claude/tasks/$session_id"
|
|
28
|
+
if [ -d "$task_dir" ]; then
|
|
29
|
+
for task_file in "$task_dir"/*.json; do
|
|
30
|
+
[ ! -f "$task_file" ] && continue
|
|
31
|
+
eagle_capture_claude_task "$task_file" "$session_id" "$project"
|
|
32
|
+
done
|
|
33
|
+
eagle_log "INFO" "SessionEnd: re-synced tasks from $task_dir"
|
|
34
|
+
fi
|
|
35
|
+
|
|
22
36
|
eagle_end_session "$session_id"
|
|
23
37
|
eagle_log "INFO" "SessionEnd: session=$session_id marked completed"
|
|
24
38
|
|
package/hooks/session-start.sh
CHANGED
|
@@ -163,6 +163,7 @@ fi
|
|
|
163
163
|
synced_tasks=$(eagle_db "SELECT subject, status FROM claude_tasks
|
|
164
164
|
WHERE project = '$(eagle_sql_escape "$project")'
|
|
165
165
|
AND status IN ('in_progress', 'pending', 'todo', 'open')
|
|
166
|
+
AND updated_at > datetime('now', '-7 days')
|
|
166
167
|
ORDER BY updated_at DESC LIMIT 5;")
|
|
167
168
|
if [ -n "$synced_tasks" ]; then
|
|
168
169
|
context+="
|
|
@@ -181,12 +182,20 @@ context+="
|
|
|
181
182
|
=== EAGLE MEM INSTRUCTIONS ===
|
|
182
183
|
You have persistent memory powered by Eagle Mem. When you recall context from a previous session or use injected memory, attribute it: \"From Eagle Mem:\" or \"Eagle Mem recalls:\". This helps the user understand where the context came from.
|
|
183
184
|
|
|
184
|
-
IMPORTANT: At the start of your FIRST response after session start or /clear, show the user what Eagle Mem loaded. Use
|
|
185
|
+
IMPORTANT: At the start of your FIRST response after session start or /clear, show the user what Eagle Mem loaded. Use this exact format with the ASCII eagle:
|
|
185
186
|
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
\`\`\`
|
|
188
|
+
.~~~~-.
|
|
189
|
+
/ ,__\`)
|
|
190
|
+
| \\o/|'-. Eagle Mem loaded
|
|
191
|
+
| / ,\\ Project: <project name>
|
|
192
|
+
| ('--./ Sessions: N recent | Memories: N | Tasks: N pending
|
|
193
|
+
/ \\ Last: [one-line summary of most recent session]
|
|
194
|
+
/ , , , \\
|
|
195
|
+
\`--'--'--'--'
|
|
196
|
+
\`\`\`
|
|
188
197
|
|
|
189
|
-
This gives the user visibility into the context you received.
|
|
198
|
+
This gives the user visibility into the context you received.
|
|
190
199
|
|
|
191
200
|
Before your final response in this session, emit a summary block:
|
|
192
201
|
<eagle-summary>
|
package/lib/db.sh
CHANGED
|
@@ -101,6 +101,7 @@ eagle_get_recent_summaries() {
|
|
|
101
101
|
eagle_db "SELECT s.request, s.completed, s.learned, s.next_steps, s.created_at
|
|
102
102
|
FROM summaries s
|
|
103
103
|
WHERE s.project = '$project'
|
|
104
|
+
AND s.request NOT LIKE '%<local-command-caveat>%'
|
|
104
105
|
ORDER BY s.created_at DESC
|
|
105
106
|
LIMIT $limit;"
|
|
106
107
|
}
|