fathom-mcp 0.4.3 → 0.4.4
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/package.json
CHANGED
package/scripts/fathom-recall.sh
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
set -o pipefail
|
|
12
12
|
|
|
13
13
|
HOOK_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
14
|
-
TOAST="$HOOK_DIR/
|
|
14
|
+
TOAST="$HOOK_DIR/hook-toast.sh"
|
|
15
15
|
VSEARCH_CACHE="/tmp/fathom-vsearch-cache.json"
|
|
16
16
|
VSEARCH_LOCK="/tmp/fathom-vsearch.lock"
|
|
17
17
|
STALE_LOCK_SECONDS=180 # 3 minutes — lock older than this is considered stale
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
2
|
+
# hook-toast.sh — tmux popup notifications for agent hooks.
|
|
3
3
|
#
|
|
4
4
|
# Usage:
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
5
|
+
# hook-toast.sh <system> <message> # one-shot toast (auto-closes after 2s)
|
|
6
|
+
# hook-toast.sh <system> --status <id> # start a multi-stage toast (poll mode)
|
|
7
|
+
# hook-toast.sh --update <id> <message> # update a running toast
|
|
8
|
+
# hook-toast.sh --close <id> # close a running toast (after delay)
|
|
9
9
|
#
|
|
10
|
-
#
|
|
10
|
+
# Built-in systems: fathom, memento
|
|
11
11
|
# fathom → 📝 purple (colour141)
|
|
12
12
|
# memento → 🧠 teal (colour37)
|
|
13
13
|
#
|
|
14
|
+
# Any other system name works too — gets a default icon and grey border.
|
|
15
|
+
#
|
|
14
16
|
# Multi-stage example (PreCompact):
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
17
|
+
# hook-toast.sh memento --status precompact
|
|
18
|
+
# hook-toast.sh --update precompact "⏳ Getting context..."
|
|
19
|
+
# hook-toast.sh --update precompact "⏳ Extracting memories..."
|
|
20
|
+
# hook-toast.sh --update precompact "✓ Stored 7 memories"
|
|
21
|
+
# hook-toast.sh --close precompact
|
|
20
22
|
|
|
21
|
-
TOAST_DIR="/tmp/
|
|
23
|
+
TOAST_DIR="/tmp/hook-toast"
|
|
22
24
|
mkdir -p "$TOAST_DIR"
|
|
23
25
|
|
|
24
26
|
# Bail silently if not in tmux
|
|
@@ -27,8 +29,7 @@ if ! tmux info &>/dev/null; then
|
|
|
27
29
|
fi
|
|
28
30
|
|
|
29
31
|
get_style() {
|
|
30
|
-
|
|
31
|
-
case "$system" in
|
|
32
|
+
case "$1" in
|
|
32
33
|
memento) echo "colour37" ;;
|
|
33
34
|
fathom) echo "colour141" ;;
|
|
34
35
|
*) echo "colour245" ;;
|
|
@@ -36,8 +37,7 @@ get_style() {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
get_icon() {
|
|
39
|
-
|
|
40
|
-
case "$system" in
|
|
40
|
+
case "$1" in
|
|
41
41
|
memento) echo "🧠" ;;
|
|
42
42
|
fathom) echo "📝" ;;
|
|
43
43
|
*) echo "📌" ;;
|
|
@@ -45,11 +45,10 @@ get_icon() {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
get_title() {
|
|
48
|
-
|
|
49
|
-
case "$system" in
|
|
48
|
+
case "$1" in
|
|
50
49
|
memento) echo "Memento" ;;
|
|
51
50
|
fathom) echo "Fathom" ;;
|
|
52
|
-
*) echo "$
|
|
51
|
+
*) echo "$1" ;;
|
|
53
52
|
esac
|
|
54
53
|
}
|
|
55
54
|
|
|
@@ -99,17 +98,15 @@ toast_start() {
|
|
|
99
98
|
toast_update() {
|
|
100
99
|
local id="$1"
|
|
101
100
|
local message="$2"
|
|
102
|
-
|
|
103
|
-
echo "$message" > "$status_file"
|
|
101
|
+
echo "$message" > "$TOAST_DIR/$id"
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
# Close a running toast (remove status file — popup exits on next poll)
|
|
107
105
|
toast_close() {
|
|
108
106
|
local id="$1"
|
|
109
|
-
local status_file="$TOAST_DIR/$id"
|
|
110
107
|
# Give the popup time to display the final message
|
|
111
108
|
sleep 2
|
|
112
|
-
rm -f "$
|
|
109
|
+
rm -f "$TOAST_DIR/$id"
|
|
113
110
|
}
|
|
114
111
|
|
|
115
112
|
# --- Argument parsing ---
|
|
@@ -120,7 +117,18 @@ case "${1:-}" in
|
|
|
120
117
|
--close)
|
|
121
118
|
toast_close "$2"
|
|
122
119
|
;;
|
|
123
|
-
|
|
120
|
+
--*)
|
|
121
|
+
echo "Unknown option: $1" >&2
|
|
122
|
+
exit 1
|
|
123
|
+
;;
|
|
124
|
+
"")
|
|
125
|
+
echo "Usage: hook-toast.sh <system> <message>" >&2
|
|
126
|
+
echo " hook-toast.sh <system> --status <id>" >&2
|
|
127
|
+
echo " hook-toast.sh --update <id> <message>" >&2
|
|
128
|
+
echo " hook-toast.sh --close <id>" >&2
|
|
129
|
+
exit 1
|
|
130
|
+
;;
|
|
131
|
+
*)
|
|
124
132
|
SYSTEM="$1"
|
|
125
133
|
shift
|
|
126
134
|
if [ "${1:-}" = "--status" ]; then
|
|
@@ -129,11 +137,4 @@ case "${1:-}" in
|
|
|
129
137
|
toast_oneshot "$SYSTEM" "$*"
|
|
130
138
|
fi
|
|
131
139
|
;;
|
|
132
|
-
*)
|
|
133
|
-
echo "Usage: fathom-toast.sh <fathom|memento> <message>" >&2
|
|
134
|
-
echo " fathom-toast.sh <fathom|memento> --status <id>" >&2
|
|
135
|
-
echo " fathom-toast.sh --update <id> <message>" >&2
|
|
136
|
-
echo " fathom-toast.sh --close <id>" >&2
|
|
137
|
-
exit 1
|
|
138
|
-
;;
|
|
139
140
|
esac
|