wayfind 2.0.73 → 2.0.74
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
|
@@ -1,16 +1,78 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Wayfind —
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
2
|
+
# Wayfind — SessionStart hook
|
|
3
|
+
# Pulls team context, indexes last session's conversations (solo mode only),
|
|
4
|
+
# rebuilds the Active Projects index, then prompts for the session goal.
|
|
5
|
+
#
|
|
6
|
+
# Runs synchronously so the user sees what Wayfind is doing before they type.
|
|
7
|
+
# Solo mode: no container_endpoint configured — reindex runs here instead of
|
|
8
|
+
# in a background container.
|
|
6
9
|
#
|
|
7
10
|
# Install: copy to ~/.claude/hooks/check-global-state.sh
|
|
8
11
|
# Register: add to ~/.claude/settings.json (see settings.json in this directory)
|
|
9
12
|
|
|
10
13
|
set -euo pipefail
|
|
11
14
|
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
# Find wayfind binary
|
|
16
|
+
WAYFIND="$(command -v wayfind 2>/dev/null || echo "")"
|
|
17
|
+
if [ -z "$WAYFIND" ]; then
|
|
18
|
+
for candidate in \
|
|
19
|
+
"$HOME/repos/wayfind/bin/team-context.js"; do
|
|
20
|
+
if [ -f "$candidate" ]; then
|
|
21
|
+
WAYFIND="node $candidate"
|
|
22
|
+
break
|
|
23
|
+
fi
|
|
24
|
+
done
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
if [ -z "$WAYFIND" ]; then
|
|
28
|
+
echo "[wayfind] CLI not found — install for full features: npm install -g wayfind" >&2
|
|
29
|
+
exit 0
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
echo ""
|
|
33
|
+
echo " ── Wayfind ────────────────────────────────────────"
|
|
34
|
+
|
|
35
|
+
# Pull latest team context (synchronous — start with fresh state)
|
|
36
|
+
echo ""
|
|
37
|
+
$WAYFIND context pull 2>/dev/null || true
|
|
38
|
+
|
|
39
|
+
# Detect solo mode: no container_endpoint means no background container running reindex
|
|
40
|
+
CONTEXT_JSON="${WAYFIND_DIR:-$HOME/.claude/team-context}/context.json"
|
|
41
|
+
HAS_CONTAINER=false
|
|
42
|
+
if [ -f "$CONTEXT_JSON" ] && grep -q '"container_endpoint"' "$CONTEXT_JSON" 2>/dev/null; then
|
|
43
|
+
HAS_CONTAINER=true
|
|
16
44
|
fi
|
|
45
|
+
|
|
46
|
+
# Solo mode: index last session's conversations now
|
|
47
|
+
# Teams rely on the container's scheduled reindex instead.
|
|
48
|
+
if [ "$HAS_CONTAINER" = "false" ]; then
|
|
49
|
+
LAST_RUN_FILE="${WAYFIND_DIR:-$HOME/.claude/team-context}/.last-reindex"
|
|
50
|
+
SHOULD_REINDEX=true
|
|
51
|
+
|
|
52
|
+
if [ -f "$LAST_RUN_FILE" ]; then
|
|
53
|
+
CHANGED=$(find "$HOME/.claude/projects" -name "*.jsonl" -newer "$LAST_RUN_FILE" -print -quit 2>/dev/null)
|
|
54
|
+
if [ -z "$CHANGED" ]; then
|
|
55
|
+
SHOULD_REINDEX=false
|
|
56
|
+
fi
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
if [ "$SHOULD_REINDEX" = "true" ]; then
|
|
60
|
+
echo ""
|
|
61
|
+
echo " Indexing last session's conversations..."
|
|
62
|
+
echo ""
|
|
63
|
+
$WAYFIND reindex --conversations-only --export --write-stats 2>/dev/null || true
|
|
64
|
+
mkdir -p "${WAYFIND_DIR:-$HOME/.claude/team-context}"
|
|
65
|
+
touch "$LAST_RUN_FILE"
|
|
66
|
+
fi
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# Rebuild Active Projects index (writes to global-state.md)
|
|
70
|
+
$WAYFIND status --write --quiet 2>/dev/null || true
|
|
71
|
+
|
|
72
|
+
# Version check — silent unless outdated
|
|
73
|
+
$WAYFIND check-version 2>/dev/null || true
|
|
74
|
+
|
|
75
|
+
echo ""
|
|
76
|
+
echo " What's the goal for this session?"
|
|
77
|
+
echo " ───────────────────────────────────────────────────"
|
|
78
|
+
echo ""
|