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,6 +1,6 @@
1
1
  {
2
2
  "name": "wayfind",
3
- "version": "2.0.73",
3
+ "version": "2.0.74",
4
4
  "description": "Team decision trail for AI-assisted development. The connective tissue between product, engineering, and strategy.",
5
5
  "bin": {
6
6
  "wayfind": "./bin/team-context.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wayfind",
3
- "version": "2.0.73",
3
+ "version": "2.0.74",
4
4
  "description": "Team decision trail for AI-assisted development. Session memory, decision journals, and team digests.",
5
5
  "author": {
6
6
  "name": "Wayfind",
@@ -1,16 +1,78 @@
1
1
  #!/usr/bin/env bash
2
- # Wayfind — Rebuild Active Projects + version check on session start.
3
- # Rebuilds the Active Projects table from per-repo state files (idempotent,
4
- # concurrent-safe), then checks if the installed version meets the team
5
- # minimum configured in the team-context repo's wayfind.json.
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
- # Use installed wayfind CLI
13
- if command -v wayfind >/dev/null 2>&1; then
14
- wayfind status --write --quiet 2>/dev/null || true
15
- wayfind check-version 2>/dev/null || true
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 ""