eagle-mem 4.7.0 → 4.8.0
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 +56 -12
- package/bin/eagle-mem +1 -0
- package/db/028_agent_artifact_tables.sql +124 -0
- package/db/029_orchestration_lanes.sql +45 -0
- package/db/030_orchestration_lane_scope.sql +88 -0
- package/db/031_orchestration_workers.sql +20 -0
- package/db/032_orchestration_run_keys.sql +9 -0
- package/hooks/post-tool-use.sh +2 -1
- package/hooks/pre-tool-use.sh +25 -1
- package/hooks/session-end.sh +2 -1
- package/hooks/session-start.sh +103 -13
- package/hooks/stop.sh +15 -13
- package/hooks/user-prompt-submit.sh +71 -12
- package/lib/common.sh +173 -2
- package/lib/db-backfill.sh +3 -3
- package/lib/db-mirrors.sh +59 -32
- package/lib/db-observations.sh +7 -0
- package/lib/db-sessions.sh +12 -6
- package/lib/db-summaries.sh +9 -5
- package/lib/hooks-posttool.sh +4 -4
- package/lib/provider.sh +224 -4
- package/package.json +3 -1
- package/scripts/config.sh +32 -0
- package/scripts/health.sh +71 -1
- package/scripts/help.sh +18 -7
- package/scripts/install.sh +12 -0
- package/scripts/memories.sh +50 -27
- package/scripts/orchestrate.sh +1268 -0
- package/scripts/refresh.sh +3 -3
- package/scripts/search.sh +21 -19
- package/scripts/statusline-em.sh +1 -1
- package/scripts/tasks.sh +186 -15
- package/scripts/update.sh +20 -1
- package/skills/eagle-mem-memories/SKILL.md +13 -13
- package/skills/eagle-mem-orchestrate/SKILL.md +149 -0
- package/skills/eagle-mem-tasks/SKILL.md +23 -15
package/scripts/config.sh
CHANGED
|
@@ -17,7 +17,32 @@ eagle_header "Config"
|
|
|
17
17
|
subcommand="${1:-show}"
|
|
18
18
|
shift 2>/dev/null || true
|
|
19
19
|
|
|
20
|
+
show_help() {
|
|
21
|
+
echo -e " ${BOLD}eagle-mem config${RESET} — Provider and token-guard settings"
|
|
22
|
+
echo ""
|
|
23
|
+
echo -e " ${BOLD}Usage:${RESET}"
|
|
24
|
+
echo -e " eagle-mem config ${DIM}# show current config${RESET}"
|
|
25
|
+
echo -e " eagle-mem config ${CYAN}init${RESET} ${DIM}# create config.toml${RESET}"
|
|
26
|
+
echo -e " eagle-mem config ${CYAN}set${RESET} section.key value"
|
|
27
|
+
echo -e " eagle-mem config ${CYAN}test${RESET} ${DIM}# test curator provider${RESET}"
|
|
28
|
+
echo ""
|
|
29
|
+
echo -e " ${BOLD}Examples:${RESET}"
|
|
30
|
+
echo -e " eagle-mem config set provider.type agent_cli"
|
|
31
|
+
echo -e " eagle-mem config set agent_cli.preferred current"
|
|
32
|
+
echo -e " eagle-mem config set orchestration.route opposite"
|
|
33
|
+
echo -e " eagle-mem config set orchestration.codex_worker_model gpt-5.5"
|
|
34
|
+
echo -e " eagle-mem config set orchestration.claude_worker_model claude-opus-4-7"
|
|
35
|
+
echo -e " eagle-mem config set token_guard.rtk enforce"
|
|
36
|
+
echo -e " eagle-mem config set token_guard.raw_bash block"
|
|
37
|
+
echo ""
|
|
38
|
+
exit 0
|
|
39
|
+
}
|
|
40
|
+
|
|
20
41
|
case "$subcommand" in
|
|
42
|
+
--help|-h|help)
|
|
43
|
+
show_help
|
|
44
|
+
;;
|
|
45
|
+
|
|
21
46
|
init)
|
|
22
47
|
eagle_config_init
|
|
23
48
|
eagle_ok "Config created: $EAGLE_CONFIG_FILE"
|
|
@@ -36,8 +61,15 @@ case "$subcommand" in
|
|
|
36
61
|
eagle_err "Usage: eagle-mem config set <section.key> <value>"
|
|
37
62
|
eagle_info "Examples:"
|
|
38
63
|
eagle_info " eagle-mem config set provider.type ollama"
|
|
64
|
+
eagle_info " eagle-mem config set provider.type agent_cli"
|
|
65
|
+
eagle_info " eagle-mem config set agent_cli.preferred current"
|
|
66
|
+
eagle_info " eagle-mem config set orchestration.route opposite"
|
|
67
|
+
eagle_info " eagle-mem config set orchestration.codex_worker_effort xhigh"
|
|
68
|
+
eagle_info " eagle-mem config set orchestration.claude_worker_effort xhigh"
|
|
39
69
|
eagle_info " eagle-mem config set ollama.model mistral"
|
|
40
70
|
eagle_info " eagle-mem config set anthropic.model claude-haiku-4-5-20251001"
|
|
71
|
+
eagle_info " eagle-mem config set token_guard.rtk enforce"
|
|
72
|
+
eagle_info " eagle-mem config set token_guard.raw_bash block"
|
|
41
73
|
exit 1
|
|
42
74
|
fi
|
|
43
75
|
section="${key%%.*}"
|
package/scripts/health.sh
CHANGED
|
@@ -39,6 +39,8 @@ if [ -z "$project" ]; then
|
|
|
39
39
|
exit 1
|
|
40
40
|
fi
|
|
41
41
|
|
|
42
|
+
eagle_ensure_db
|
|
43
|
+
|
|
42
44
|
p_esc=$(eagle_sql_escape "$project")
|
|
43
45
|
|
|
44
46
|
eagle_info "Project: ${BOLD}$project${RESET}"
|
|
@@ -133,7 +135,11 @@ max_score=$((max_score + 15))
|
|
|
133
135
|
|
|
134
136
|
provider=$(eagle_config_get "provider" "type" "none")
|
|
135
137
|
if [ "$provider" != "none" ]; then
|
|
136
|
-
|
|
138
|
+
if [ "$provider" = "agent_cli" ]; then
|
|
139
|
+
model=$(_eagle_agent_cli_target)
|
|
140
|
+
else
|
|
141
|
+
model=$(eagle_config_get "$provider" "model" "default")
|
|
142
|
+
fi
|
|
137
143
|
eagle_ok "Provider: ${provider} (${model})"
|
|
138
144
|
score=$((score + 15))
|
|
139
145
|
else
|
|
@@ -141,6 +147,50 @@ else
|
|
|
141
147
|
issues+=("Configure a provider: eagle-mem config init")
|
|
142
148
|
fi
|
|
143
149
|
|
|
150
|
+
# ─── Token guard visibility (informational) ────────────────
|
|
151
|
+
|
|
152
|
+
rtk_mode=$(eagle_config_get "token_guard" "rtk" "auto")
|
|
153
|
+
raw_bash_mode=$(eagle_config_get "token_guard" "raw_bash" "block")
|
|
154
|
+
rtk_bin=$(command -v rtk 2>/dev/null || true)
|
|
155
|
+
if [ -n "$rtk_bin" ]; then
|
|
156
|
+
eagle_ok "Token guard: RTK $rtk_mode (${rtk_bin}), raw_bash=$raw_bash_mode"
|
|
157
|
+
elif [ "$rtk_mode" = "enforce" ]; then
|
|
158
|
+
eagle_fail "Token guard: RTK enforce enabled, but rtk not found"
|
|
159
|
+
issues+=("Install RTK or run: eagle-mem config set token_guard.rtk auto")
|
|
160
|
+
else
|
|
161
|
+
eagle_dim " Token guard: RTK not found (mode: $rtk_mode, raw_bash: $raw_bash_mode)"
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
# ─── Orchestration visibility (informational) ───────────────
|
|
165
|
+
|
|
166
|
+
orch_route=$(eagle_config_get "orchestration" "route" "opposite")
|
|
167
|
+
orch_auto_worktree=$(eagle_config_get "orchestration" "auto_worktree" "true")
|
|
168
|
+
orch_worktree_root=$(eagle_config_get "orchestration" "worktree_root" "")
|
|
169
|
+
orch_codex_model=$(eagle_config_get "orchestration" "codex_worker_model" "gpt-5.5")
|
|
170
|
+
orch_codex_effort=$(eagle_config_get "orchestration" "codex_worker_effort" "xhigh")
|
|
171
|
+
orch_claude_model=$(eagle_config_get "orchestration" "claude_worker_model" "claude-opus-4-7")
|
|
172
|
+
orch_claude_effort=$(eagle_config_get "orchestration" "claude_worker_effort" "xhigh")
|
|
173
|
+
codex_bin=$(command -v codex 2>/dev/null || true)
|
|
174
|
+
claude_bin=$(command -v claude 2>/dev/null || true)
|
|
175
|
+
|
|
176
|
+
if [ -n "$codex_bin" ] && [ -n "$claude_bin" ]; then
|
|
177
|
+
eagle_ok "Orchestration: route=$orch_route, worktrees=$orch_auto_worktree, Codex + Claude workers available"
|
|
178
|
+
elif [ -n "$codex_bin" ]; then
|
|
179
|
+
eagle_warn "Orchestration: Codex available, Claude CLI missing"
|
|
180
|
+
issues+=("Install or authenticate Claude Code CLI before spawning Claude worker lanes.")
|
|
181
|
+
elif [ -n "$claude_bin" ]; then
|
|
182
|
+
eagle_warn "Orchestration: Claude available, Codex CLI missing"
|
|
183
|
+
issues+=("Install or authenticate Codex CLI before spawning Codex worker lanes.")
|
|
184
|
+
else
|
|
185
|
+
eagle_warn "Orchestration: worker CLIs not found"
|
|
186
|
+
issues+=("Install/authenticate Codex and Claude Code CLIs before using eagle-mem orchestrate spawn.")
|
|
187
|
+
fi
|
|
188
|
+
|
|
189
|
+
eagle_dim " Workers: codex=${orch_codex_model}/${orch_codex_effort}, claude-code=${orch_claude_model}/${orch_claude_effort}"
|
|
190
|
+
if [ -n "$orch_worktree_root" ]; then
|
|
191
|
+
eagle_dim " Worktree root: $orch_worktree_root"
|
|
192
|
+
fi
|
|
193
|
+
|
|
144
194
|
# ─── 5. Data quality (10 pts) ──────────────────────────
|
|
145
195
|
|
|
146
196
|
max_score=$((max_score + 10))
|
|
@@ -228,11 +278,31 @@ if [ "$JSON_OUT" -eq 1 ]; then
|
|
|
228
278
|
--argjson enriched_summaries "${enriched_summaries:-0}" \
|
|
229
279
|
--argjson features "${feature_count:-0}" \
|
|
230
280
|
--arg provider "$provider" \
|
|
281
|
+
--arg token_guard_rtk "$rtk_mode" \
|
|
282
|
+
--arg token_guard_raw_bash "$raw_bash_mode" \
|
|
283
|
+
--arg rtk_bin "${rtk_bin:-}" \
|
|
284
|
+
--arg orchestration_route "$orch_route" \
|
|
285
|
+
--arg orchestration_auto_worktree "$orch_auto_worktree" \
|
|
286
|
+
--arg orchestration_worktree_root "$orch_worktree_root" \
|
|
287
|
+
--arg codex_worker_model "$orch_codex_model" \
|
|
288
|
+
--arg codex_worker_effort "$orch_codex_effort" \
|
|
289
|
+
--arg claude_worker_model "$orch_claude_model" \
|
|
290
|
+
--arg claude_worker_effort "$orch_claude_effort" \
|
|
291
|
+
--arg codex_bin "${codex_bin:-}" \
|
|
292
|
+
--arg claude_bin "${claude_bin:-}" \
|
|
231
293
|
--argjson noise_pct "$noise_pct" \
|
|
232
294
|
--arg last_curated "${last_curated:-never}" \
|
|
233
295
|
'{project:$project, score:$score, max:$max_score, pct:$pct, grade:$grade,
|
|
234
296
|
capture:{sessions:$total_sessions, summaries:$total_summaries, heuristic:$heuristic_summaries},
|
|
235
297
|
enrichment:$enriched_summaries,
|
|
236
298
|
features:$features, provider:$provider,
|
|
299
|
+
token_guard:{rtk:$token_guard_rtk, raw_bash:$token_guard_raw_bash, rtk_bin:$rtk_bin},
|
|
300
|
+
orchestration:{
|
|
301
|
+
route:$orchestration_route,
|
|
302
|
+
auto_worktree:$orchestration_auto_worktree,
|
|
303
|
+
worktree_root:$orchestration_worktree_root,
|
|
304
|
+
codex:{model:$codex_worker_model, effort:$codex_worker_effort, cli:$codex_bin},
|
|
305
|
+
claude_code:{model:$claude_worker_model, effort:$claude_worker_effort, cli:$claude_bin}
|
|
306
|
+
},
|
|
237
307
|
noise_pct:$noise_pct, last_curated:$last_curated}' >&3
|
|
238
308
|
fi
|
package/scripts/help.sh
CHANGED
|
@@ -21,11 +21,12 @@ echo -e " ${CYAN}update${RESET} Re-deploy hooks and run migrations"
|
|
|
21
21
|
echo -e " ${CYAN}uninstall${RESET} Remove hooks and optionally delete data"
|
|
22
22
|
echo -e " ${CYAN}search${RESET} Search past sessions, memories, and code"
|
|
23
23
|
echo -e " ${CYAN}health${RESET} Diagnose pipeline health and background automation"
|
|
24
|
-
echo -e " ${CYAN}config${RESET} View or change
|
|
24
|
+
echo -e " ${CYAN}config${RESET} View or change provider and token-guard settings"
|
|
25
25
|
echo -e " ${CYAN}guard${RESET} Manage regression guardrails for files"
|
|
26
26
|
echo -e " ${CYAN}overview${RESET} Build or view project overview"
|
|
27
|
-
echo -e " ${CYAN}memories${RESET} View/sync
|
|
27
|
+
echo -e " ${CYAN}memories${RESET} View/sync agent memories"
|
|
28
28
|
echo -e " ${CYAN}tasks${RESET} View mirrored tasks"
|
|
29
|
+
echo -e " ${CYAN}orchestrate${RESET} Durable worker-lane coordination"
|
|
29
30
|
echo -e " ${CYAN}curate${RESET} Run curator (co-edits, hot files, guardrails)"
|
|
30
31
|
echo -e " ${CYAN}feature${RESET} Track, verify, and unblock features"
|
|
31
32
|
echo -e " ${CYAN}prune${RESET} Clean old sessions and stale data"
|
|
@@ -44,11 +45,21 @@ echo -e " ${DIM}\$${RESET} eagle-mem feature pending ${DIM}# pending re
|
|
|
44
45
|
echo -e " ${DIM}\$${RESET} eagle-mem feature verify NAME ${DIM}# verify current diff after testing${RESET}"
|
|
45
46
|
echo -e " ${DIM}\$${RESET} eagle-mem feature waive ID ${DIM}# intentional exception${RESET}"
|
|
46
47
|
echo ""
|
|
47
|
-
echo -e " ${BOLD}
|
|
48
|
-
echo -e " ${
|
|
49
|
-
echo -e " ${
|
|
50
|
-
echo -e " ${
|
|
51
|
-
echo -e " ${
|
|
48
|
+
echo -e " ${BOLD}Orchestration:${RESET}"
|
|
49
|
+
echo -e " ${DIM}Agent-run protocol for broad multi-lane work; users normally do not run this manually.${RESET}"
|
|
50
|
+
echo -e " ${DIM}Codex sessions spawn Claude workers; Claude sessions spawn Codex workers by default.${RESET}"
|
|
51
|
+
echo -e " ${DIM}\$${RESET} eagle-mem orchestrate init \"Ship release\""
|
|
52
|
+
echo -e " ${DIM}\$${RESET} eagle-mem orchestrate lane add api --agent codex --validate \"npm test\""
|
|
53
|
+
echo -e " ${DIM}\$${RESET} eagle-mem orchestrate spawn api ${DIM}# worktree + worker process${RESET}"
|
|
54
|
+
echo -e " ${DIM}\$${RESET} eagle-mem orchestrate sync ${DIM}# reconcile worker status${RESET}"
|
|
55
|
+
echo -e " ${DIM}\$${RESET} eagle-mem orchestrate handoff --write docs/handoff-context.md"
|
|
56
|
+
echo ""
|
|
57
|
+
echo -e " ${BOLD}Skills${RESET} ${DIM}(inside Claude Code and Codex sessions):${RESET}"
|
|
58
|
+
echo -e " ${CYAN}eagle-mem-search${RESET} Search memory and past sessions"
|
|
59
|
+
echo -e " ${CYAN}eagle-mem-overview${RESET} Build or update project overview"
|
|
60
|
+
echo -e " ${CYAN}eagle-mem-memories${RESET} View/sync agent memories"
|
|
61
|
+
echo -e " ${CYAN}eagle-mem-tasks${RESET} TaskAware Compact Loop for multi-step work"
|
|
62
|
+
echo -e " ${CYAN}eagle-mem-orchestrate${RESET} Orchestrator/worker lane handoffs"
|
|
52
63
|
echo ""
|
|
53
64
|
echo -e " ${DIM}Everything else is automatic — scan, index, prune, and${RESET}"
|
|
54
65
|
echo -e " ${DIM}curator all run in the background via hooks.${RESET}"
|
package/scripts/install.sh
CHANGED
|
@@ -251,6 +251,18 @@ if [ "$claude_found" = true ] && [ -d "$PACKAGE_DIR/skills" ]; then
|
|
|
251
251
|
done
|
|
252
252
|
fi
|
|
253
253
|
|
|
254
|
+
if [ "$codex_found" = true ] && [ -d "$PACKAGE_DIR/skills" ]; then
|
|
255
|
+
mkdir -p "$EAGLE_CODEX_SKILLS_DIR"
|
|
256
|
+
for skill_dir in "$PACKAGE_DIR"/skills/*/; do
|
|
257
|
+
[ ! -d "$skill_dir" ] && continue
|
|
258
|
+
skill_name=$(basename "$skill_dir")
|
|
259
|
+
dst="$EAGLE_CODEX_SKILLS_DIR/$skill_name"
|
|
260
|
+
[ -L "$dst" ] && rm "$dst"
|
|
261
|
+
ln -sf "$skill_dir" "$dst"
|
|
262
|
+
eagle_ok "Codex skill: $skill_name"
|
|
263
|
+
done
|
|
264
|
+
fi
|
|
265
|
+
|
|
254
266
|
# ─── Statusline integration ───────────────────────────────
|
|
255
267
|
|
|
256
268
|
if [ "$claude_found" = true ]; then
|
package/scripts/memories.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# ═══════════════════════════════════════════════════════════
|
|
3
|
-
# Eagle Mem —
|
|
4
|
-
# List, show, search, and sync
|
|
3
|
+
# Eagle Mem — Agent Memory Mirror CLI
|
|
4
|
+
# List, show, search, and sync mirrored memories/plans/tasks
|
|
5
5
|
# ═══════════════════════════════════════════════════════════
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
|
|
@@ -28,7 +28,7 @@ limit=20
|
|
|
28
28
|
query=""
|
|
29
29
|
|
|
30
30
|
show_help() {
|
|
31
|
-
echo -e " ${BOLD}eagle-mem memories${RESET} —
|
|
31
|
+
echo -e " ${BOLD}eagle-mem memories${RESET} — Agent memory, plan & task mirror"
|
|
32
32
|
echo ""
|
|
33
33
|
echo -e " ${BOLD}Usage:${RESET}"
|
|
34
34
|
echo -e " eagle-mem memories ${DIM}# list all mirrored memories${RESET}"
|
|
@@ -48,7 +48,7 @@ show_help() {
|
|
|
48
48
|
echo -e " ${CYAN}-l, --limit${RESET} <N> Max results (default: 20)"
|
|
49
49
|
echo ""
|
|
50
50
|
echo -e " ${BOLD}How it works:${RESET}"
|
|
51
|
-
echo -e " ${DOT} Eagle Mem
|
|
51
|
+
echo -e " ${DOT} Eagle Mem mirrors agent memory, plan, and task writes"
|
|
52
52
|
echo -e " ${DOT} All are mirrored into Eagle Mem's SQLite + FTS5"
|
|
53
53
|
echo -e " ${DOT} Use ${CYAN}sync${RESET} to backfill items written before mirroring was enabled"
|
|
54
54
|
echo ""
|
|
@@ -92,12 +92,12 @@ memories_list() {
|
|
|
92
92
|
eagle_header "Memories"
|
|
93
93
|
|
|
94
94
|
local result
|
|
95
|
-
result=$(
|
|
95
|
+
result=$(eagle_list_agent_memories "$project" "$limit")
|
|
96
96
|
|
|
97
97
|
if [ -z "$result" ]; then
|
|
98
98
|
eagle_dim "No mirrored memories found."
|
|
99
99
|
echo ""
|
|
100
|
-
eagle_dim "Memories are captured automatically when
|
|
100
|
+
eagle_dim "Memories are captured automatically when supported agents write memory files."
|
|
101
101
|
eagle_dim "Run 'eagle-mem memories sync' to backfill existing memories."
|
|
102
102
|
echo ""
|
|
103
103
|
return
|
|
@@ -137,7 +137,7 @@ memories_search() {
|
|
|
137
137
|
echo ""
|
|
138
138
|
|
|
139
139
|
local result
|
|
140
|
-
result=$(
|
|
140
|
+
result=$(eagle_search_agent_memories "$query" "$project" "$limit")
|
|
141
141
|
|
|
142
142
|
if [ -z "$result" ]; then
|
|
143
143
|
eagle_dim "No memories matching '$query'"
|
|
@@ -179,7 +179,7 @@ memories_show() {
|
|
|
179
179
|
|
|
180
180
|
local meta
|
|
181
181
|
meta=$(eagle_db "SELECT memory_name, memory_type, description, file_path, updated_at, origin_session_id, origin_agent
|
|
182
|
-
FROM
|
|
182
|
+
FROM agent_memories WHERE file_path = '$(eagle_sql_escape "$query")';")
|
|
183
183
|
|
|
184
184
|
if [ -z "$meta" ]; then
|
|
185
185
|
eagle_err "Memory not found: $query"
|
|
@@ -216,12 +216,12 @@ plans_list() {
|
|
|
216
216
|
eagle_header "Plans"
|
|
217
217
|
|
|
218
218
|
local result
|
|
219
|
-
result=$(
|
|
219
|
+
result=$(eagle_list_agent_plans "$project" "$limit")
|
|
220
220
|
|
|
221
221
|
if [ -z "$result" ]; then
|
|
222
222
|
eagle_dim "No captured plans found."
|
|
223
223
|
echo ""
|
|
224
|
-
eagle_dim "Plans are captured when
|
|
224
|
+
eagle_dim "Plans are captured when supported agents write plan files."
|
|
225
225
|
eagle_dim "Run 'eagle-mem memories sync' to backfill existing plans."
|
|
226
226
|
echo ""
|
|
227
227
|
return
|
|
@@ -255,7 +255,7 @@ plans_search() {
|
|
|
255
255
|
echo ""
|
|
256
256
|
|
|
257
257
|
local result
|
|
258
|
-
result=$(
|
|
258
|
+
result=$(eagle_search_agent_plans "$query" "$project" "$limit")
|
|
259
259
|
|
|
260
260
|
if [ -z "$result" ]; then
|
|
261
261
|
eagle_dim "No plans matching '$query'"
|
|
@@ -289,7 +289,7 @@ plans_show() {
|
|
|
289
289
|
|
|
290
290
|
local meta
|
|
291
291
|
meta=$(eagle_db "SELECT title, project, file_path, updated_at, origin_session_id, origin_agent
|
|
292
|
-
FROM
|
|
292
|
+
FROM agent_plans WHERE file_path = '$(eagle_sql_escape "$query")';")
|
|
293
293
|
|
|
294
294
|
if [ -z "$meta" ]; then
|
|
295
295
|
eagle_err "Plan not found: $query"
|
|
@@ -320,15 +320,15 @@ plans_show() {
|
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
tasks_list() {
|
|
323
|
-
eagle_header "
|
|
323
|
+
eagle_header "Agent Tasks"
|
|
324
324
|
|
|
325
325
|
local result
|
|
326
|
-
result=$(
|
|
326
|
+
result=$(eagle_list_agent_tasks "$project" "$limit")
|
|
327
327
|
|
|
328
328
|
if [ -z "$result" ]; then
|
|
329
329
|
eagle_dim "No captured tasks found."
|
|
330
330
|
echo ""
|
|
331
|
-
eagle_dim "Tasks are captured when
|
|
331
|
+
eagle_dim "Tasks are captured when supported agents use task lifecycle tools."
|
|
332
332
|
eagle_dim "Run 'eagle-mem memories sync' to backfill existing tasks."
|
|
333
333
|
echo ""
|
|
334
334
|
return
|
|
@@ -366,7 +366,7 @@ tasks_search() {
|
|
|
366
366
|
echo ""
|
|
367
367
|
|
|
368
368
|
local result
|
|
369
|
-
result=$(
|
|
369
|
+
result=$(eagle_search_agent_tasks "$query" "$project" "$limit")
|
|
370
370
|
|
|
371
371
|
if [ -z "$result" ]; then
|
|
372
372
|
eagle_dim "No tasks matching '$query'"
|
|
@@ -404,7 +404,7 @@ tasks_show() {
|
|
|
404
404
|
|
|
405
405
|
local meta
|
|
406
406
|
meta=$(eagle_db "SELECT subject, status, description, active_form, source_session_id, source_task_id, file_path, updated_at, origin_agent
|
|
407
|
-
FROM
|
|
407
|
+
FROM agent_tasks WHERE file_path = '$(eagle_sql_escape "$query")';")
|
|
408
408
|
|
|
409
409
|
if [ -z "$meta" ]; then
|
|
410
410
|
eagle_err "Task not found: $query"
|
|
@@ -442,7 +442,7 @@ memories_sync() {
|
|
|
442
442
|
eagle_header "Memory, Plan & Task Sync"
|
|
443
443
|
|
|
444
444
|
# ─── Sync memories ───────────────────────────────────
|
|
445
|
-
eagle_info "Scanning for
|
|
445
|
+
eagle_info "Scanning for agent memory files..."
|
|
446
446
|
echo ""
|
|
447
447
|
|
|
448
448
|
local claude_mem_root="$EAGLE_CLAUDE_PROJECTS_DIR"
|
|
@@ -456,7 +456,7 @@ memories_sync() {
|
|
|
456
456
|
[ "$base" = "MEMORY.md" ] && continue
|
|
457
457
|
|
|
458
458
|
local existing_hash
|
|
459
|
-
existing_hash=$(eagle_db "SELECT content_hash FROM
|
|
459
|
+
existing_hash=$(eagle_db "SELECT content_hash FROM agent_memories WHERE file_path = '$(eagle_sql_escape "$memfile")';")
|
|
460
460
|
local new_hash
|
|
461
461
|
new_hash=$(shasum -a 256 "$memfile" | awk '{print $1}')
|
|
462
462
|
|
|
@@ -465,17 +465,40 @@ memories_sync() {
|
|
|
465
465
|
continue
|
|
466
466
|
fi
|
|
467
467
|
|
|
468
|
-
|
|
468
|
+
eagle_capture_agent_memory "$memfile" "" ""
|
|
469
469
|
mem_synced=$((mem_synced + 1))
|
|
470
470
|
eagle_ok "Memory: $base"
|
|
471
471
|
done < <(find "$claude_mem_root" -path "*/memory/*.md" -print0 2>/dev/null)
|
|
472
472
|
fi
|
|
473
473
|
|
|
474
|
+
local codex_mem_root="$EAGLE_CODEX_MEMORIES_DIR"
|
|
475
|
+
if [ -d "$codex_mem_root" ]; then
|
|
476
|
+
local codex_project="$project"
|
|
477
|
+
[ -z "$codex_project" ] && codex_project=$(eagle_project_from_cwd "$(pwd)")
|
|
478
|
+
for memfile in "$codex_mem_root/MEMORY.md" "$codex_mem_root/memory_summary.md"; do
|
|
479
|
+
[ ! -f "$memfile" ] && continue
|
|
480
|
+
|
|
481
|
+
local existing_hash
|
|
482
|
+
existing_hash=$(eagle_db "SELECT content_hash FROM agent_memories WHERE file_path = '$(eagle_sql_escape "$memfile")';")
|
|
483
|
+
local new_hash
|
|
484
|
+
new_hash=$(shasum -a 256 "$memfile" | awk '{print $1}')
|
|
485
|
+
|
|
486
|
+
if [ "$existing_hash" = "$new_hash" ]; then
|
|
487
|
+
mem_skipped=$((mem_skipped + 1))
|
|
488
|
+
continue
|
|
489
|
+
fi
|
|
490
|
+
|
|
491
|
+
eagle_capture_agent_memory "$memfile" "" "$codex_project" "codex"
|
|
492
|
+
mem_synced=$((mem_synced + 1))
|
|
493
|
+
eagle_ok "Codex memory: $(basename "$memfile")"
|
|
494
|
+
done
|
|
495
|
+
fi
|
|
496
|
+
|
|
474
497
|
eagle_kv "Memories:" "$mem_synced synced, $mem_skipped unchanged"
|
|
475
498
|
echo ""
|
|
476
499
|
|
|
477
500
|
# ─── Sync plans ──────────────────────────────────────
|
|
478
|
-
eagle_info "Scanning for
|
|
501
|
+
eagle_info "Scanning for agent plan files..."
|
|
479
502
|
echo ""
|
|
480
503
|
|
|
481
504
|
local plans_dir="$EAGLE_CLAUDE_PLANS_DIR"
|
|
@@ -487,7 +510,7 @@ memories_sync() {
|
|
|
487
510
|
[ ! -f "$planfile" ] && continue
|
|
488
511
|
|
|
489
512
|
local existing_hash
|
|
490
|
-
existing_hash=$(eagle_db "SELECT content_hash FROM
|
|
513
|
+
existing_hash=$(eagle_db "SELECT content_hash FROM agent_plans WHERE file_path = '$(eagle_sql_escape "$planfile")';")
|
|
491
514
|
local new_hash
|
|
492
515
|
new_hash=$(shasum -a 256 "$planfile" | awk '{print $1}')
|
|
493
516
|
|
|
@@ -496,7 +519,7 @@ memories_sync() {
|
|
|
496
519
|
continue
|
|
497
520
|
fi
|
|
498
521
|
|
|
499
|
-
|
|
522
|
+
eagle_capture_agent_plan "$planfile" "" ""
|
|
500
523
|
plan_synced=$((plan_synced + 1))
|
|
501
524
|
local ptitle
|
|
502
525
|
ptitle=$(awk '/^# /{print; exit}' "$planfile" | sed 's/^# //')
|
|
@@ -508,7 +531,7 @@ memories_sync() {
|
|
|
508
531
|
echo ""
|
|
509
532
|
|
|
510
533
|
# ─── Sync tasks ──────────────────────────────────────
|
|
511
|
-
eagle_info "Scanning for
|
|
534
|
+
eagle_info "Scanning for agent task files..."
|
|
512
535
|
echo ""
|
|
513
536
|
|
|
514
537
|
local tasks_dir="$EAGLE_CLAUDE_TASKS_DIR"
|
|
@@ -528,7 +551,7 @@ memories_sync() {
|
|
|
528
551
|
[ ! -f "$taskfile" ] && continue
|
|
529
552
|
|
|
530
553
|
local existing_hash
|
|
531
|
-
existing_hash=$(eagle_db "SELECT content_hash FROM
|
|
554
|
+
existing_hash=$(eagle_db "SELECT content_hash FROM agent_tasks WHERE file_path = '$(eagle_sql_escape "$taskfile")';")
|
|
532
555
|
local new_hash
|
|
533
556
|
new_hash=$(shasum -a 256 "$taskfile" | awk '{print $1}')
|
|
534
557
|
|
|
@@ -537,7 +560,7 @@ memories_sync() {
|
|
|
537
560
|
continue
|
|
538
561
|
fi
|
|
539
562
|
|
|
540
|
-
|
|
563
|
+
eagle_capture_agent_task "$taskfile" "$sid" "$task_project"
|
|
541
564
|
task_synced=$((task_synced + 1))
|
|
542
565
|
done
|
|
543
566
|
done
|
|
@@ -547,7 +570,7 @@ memories_sync() {
|
|
|
547
570
|
echo ""
|
|
548
571
|
|
|
549
572
|
# ─── Backfill project names ──────────────────────────
|
|
550
|
-
eagle_info "Resolving project names from
|
|
573
|
+
eagle_info "Resolving project names from agent transcripts..."
|
|
551
574
|
|
|
552
575
|
local backfilled
|
|
553
576
|
backfilled=$(eagle_backfill_projects)
|