wayfind 2.0.72 → 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 +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.json +2 -2
- package/plugin/scripts/session-end.sh +10 -29
- package/plugin/scripts/session-start.sh +50 -10
- package/specializations/claude-code/hooks/check-global-state.sh +70 -8
- package/specializations/claude-code/hooks/session-end.sh +21 -39
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wayfind",
|
|
3
|
-
"version": "2.0.
|
|
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",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test:all": "npm test && npm run test:sim"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
49
|
+
"node": ">=20"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
package/plugin/hooks/hooks.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/session-start.sh",
|
|
10
|
-
"timeout":
|
|
10
|
+
"timeout": 60
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
{
|
|
20
20
|
"type": "command",
|
|
21
21
|
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/session-end.sh",
|
|
22
|
-
"timeout":
|
|
22
|
+
"timeout": 20
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Wayfind plugin — Stop hook
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# and the container's journal indexer picks them up.
|
|
3
|
+
# Persists the session: splits journal files by team suffix, then syncs to
|
|
4
|
+
# team-context repo. No LLM calls — fast, reliable, durability only.
|
|
6
5
|
#
|
|
7
|
-
#
|
|
6
|
+
# Heavy work (reindex, embeddings, context shift detection) is handled by
|
|
7
|
+
# the container on a schedule, or by the session-start hook for solo users.
|
|
8
8
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
11
|
-
# Skip
|
|
12
|
-
# Set TEAM_CONTEXT_SKIP_EXPORT=1 when spawning worker agents so only the
|
|
13
|
-
# orchestrator's decisions flow into the journal.
|
|
11
|
+
# Skip for worker agents in multi-agent swarms.
|
|
14
12
|
if [ "${TEAM_CONTEXT_SKIP_EXPORT:-}" = "1" ]; then
|
|
15
13
|
exit 0
|
|
16
14
|
fi
|
|
@@ -28,29 +26,12 @@ if [ -z "$WAYFIND" ]; then
|
|
|
28
26
|
fi
|
|
29
27
|
|
|
30
28
|
if [ -z "$WAYFIND" ]; then
|
|
31
|
-
echo "[wayfind] CLI not found — decision extraction skipped. Install: npm install -g wayfind" >&2
|
|
32
29
|
exit 0
|
|
33
30
|
fi
|
|
34
31
|
|
|
35
|
-
#
|
|
36
|
-
|
|
37
|
-
if [ -f "$LAST_RUN_FILE" ]; then
|
|
38
|
-
CHANGED=$(find "$HOME/.claude/projects" -name "*.jsonl" -newer "$LAST_RUN_FILE" -print -quit 2>/dev/null)
|
|
39
|
-
if [ -z "$CHANGED" ]; then
|
|
40
|
-
# No conversation files changed — skip expensive reindex, just split and sync journals
|
|
41
|
-
$WAYFIND journal split 2>/dev/null
|
|
42
|
-
$WAYFIND journal sync 2>/dev/null &
|
|
43
|
-
exit 0
|
|
44
|
-
fi
|
|
45
|
-
fi
|
|
46
|
-
|
|
47
|
-
# Run incremental reindex
|
|
48
|
-
$WAYFIND reindex --conversations-only --export --detect-shifts --write-stats 2>/dev/null || true
|
|
49
|
-
|
|
50
|
-
# Update the marker so the next session's fast-path check works
|
|
51
|
-
mkdir -p "$HOME/.claude/team-context"
|
|
52
|
-
touch "$LAST_RUN_FILE"
|
|
32
|
+
# Split any unsuffixed journal files by team (fast, filesystem only)
|
|
33
|
+
$WAYFIND journal split >/dev/null 2>&1 || true
|
|
53
34
|
|
|
54
|
-
#
|
|
55
|
-
|
|
56
|
-
$WAYFIND journal sync 2>/dev/null
|
|
35
|
+
# Sync journals to team-context repo — the durability guarantee.
|
|
36
|
+
# Runs synchronously so the push completes before the hook exits.
|
|
37
|
+
$WAYFIND journal sync 2>/dev/null || true
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Wayfind plugin — SessionStart hook
|
|
3
|
-
#
|
|
4
|
-
#
|
|
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.
|
|
5
9
|
|
|
6
10
|
set -euo pipefail
|
|
7
11
|
|
|
8
12
|
# Find wayfind binary
|
|
9
13
|
WAYFIND="$(command -v wayfind 2>/dev/null || echo "")"
|
|
10
14
|
if [ -z "$WAYFIND" ]; then
|
|
11
|
-
# Try common local checkout paths
|
|
12
15
|
for candidate in \
|
|
13
16
|
"$HOME/repos/wayfind/bin/team-context.js"; do
|
|
14
17
|
if [ -f "$candidate" ]; then
|
|
@@ -19,17 +22,54 @@ if [ -z "$WAYFIND" ]; then
|
|
|
19
22
|
fi
|
|
20
23
|
|
|
21
24
|
if [ -z "$WAYFIND" ]; then
|
|
22
|
-
|
|
23
|
-
echo "[wayfind] CLI not found. Skills work, but install the CLI for full features: npm install -g wayfind" >&2
|
|
25
|
+
echo "[wayfind] CLI not found — install for full features: npm install -g wayfind" >&2
|
|
24
26
|
exit 0
|
|
25
27
|
fi
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
$WAYFIND context pull --quiet --background 2>/dev/null || true
|
|
29
|
+
echo ""
|
|
30
|
+
echo " ── Wayfind ────────────────────────────────────────"
|
|
30
31
|
|
|
31
|
-
#
|
|
32
|
+
# Pull latest team context (synchronous — start with fresh state)
|
|
33
|
+
echo ""
|
|
34
|
+
$WAYFIND context pull 2>/dev/null || true
|
|
35
|
+
|
|
36
|
+
# Detect solo mode: no container_endpoint means no background container running reindex
|
|
37
|
+
CONTEXT_JSON="${WAYFIND_DIR:-$HOME/.claude/team-context}/context.json"
|
|
38
|
+
HAS_CONTAINER=false
|
|
39
|
+
if [ -f "$CONTEXT_JSON" ] && grep -q '"container_endpoint"' "$CONTEXT_JSON" 2>/dev/null; then
|
|
40
|
+
HAS_CONTAINER=true
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# Solo mode: index last session's conversations now
|
|
44
|
+
# Teams rely on the container's scheduled reindex instead.
|
|
45
|
+
if [ "$HAS_CONTAINER" = "false" ]; then
|
|
46
|
+
LAST_RUN_FILE="${WAYFIND_DIR:-$HOME/.claude/team-context}/.last-reindex"
|
|
47
|
+
SHOULD_REINDEX=true
|
|
48
|
+
|
|
49
|
+
if [ -f "$LAST_RUN_FILE" ]; then
|
|
50
|
+
CHANGED=$(find "$HOME/.claude/projects" -name "*.jsonl" -newer "$LAST_RUN_FILE" -print -quit 2>/dev/null)
|
|
51
|
+
if [ -z "$CHANGED" ]; then
|
|
52
|
+
SHOULD_REINDEX=false
|
|
53
|
+
fi
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
if [ "$SHOULD_REINDEX" = "true" ]; then
|
|
57
|
+
echo ""
|
|
58
|
+
echo " Indexing last session's conversations..."
|
|
59
|
+
echo ""
|
|
60
|
+
$WAYFIND reindex --conversations-only --export --write-stats 2>/dev/null || true
|
|
61
|
+
mkdir -p "${WAYFIND_DIR:-$HOME/.claude/team-context}"
|
|
62
|
+
touch "$LAST_RUN_FILE"
|
|
63
|
+
fi
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
# Rebuild Active Projects index (writes to global-state.md)
|
|
32
67
|
$WAYFIND status --write --quiet 2>/dev/null || true
|
|
33
68
|
|
|
34
|
-
#
|
|
69
|
+
# Version check — silent unless outdated
|
|
35
70
|
$WAYFIND check-version 2>/dev/null || true
|
|
71
|
+
|
|
72
|
+
echo ""
|
|
73
|
+
echo " What's the goal for this session?"
|
|
74
|
+
echo " ───────────────────────────────────────────────────"
|
|
75
|
+
echo ""
|
|
@@ -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 ""
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Wayfind session-end hook
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# and the container's journal indexer picks them up.
|
|
2
|
+
# Wayfind session-end hook (standalone / pre-plugin install)
|
|
3
|
+
# Persists the session: splits journal files by team suffix, then syncs to
|
|
4
|
+
# team-context repo. No LLM calls — fast, reliable, durability only.
|
|
6
5
|
#
|
|
7
|
-
#
|
|
6
|
+
# Heavy work (reindex, embeddings, context shift detection) is handled by
|
|
7
|
+
# the container on a schedule, or by the session-start hook for solo users.
|
|
8
8
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
11
|
-
# Skip
|
|
12
|
-
# Set TEAM_CONTEXT_SKIP_EXPORT=1 when spawning worker agents so only the
|
|
13
|
-
# orchestrator's decisions flow into the journal.
|
|
11
|
+
# Skip for worker agents in multi-agent swarms.
|
|
14
12
|
if [ "${TEAM_CONTEXT_SKIP_EXPORT:-}" = "1" ]; then
|
|
15
13
|
exit 0
|
|
16
14
|
fi
|
|
@@ -18,39 +16,23 @@ fi
|
|
|
18
16
|
# Find wayfind binary
|
|
19
17
|
WAYFIND="$(command -v wayfind 2>/dev/null || echo "")"
|
|
20
18
|
if [ -z "$WAYFIND" ]; then
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
for candidate in \
|
|
20
|
+
"$HOME/repos/wayfind/bin/team-context.js"; do
|
|
21
|
+
if [ -f "$candidate" ]; then
|
|
22
|
+
WAYFIND="node $candidate"
|
|
23
|
+
break
|
|
24
|
+
fi
|
|
25
|
+
done
|
|
27
26
|
fi
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
# short-circuits in <50ms for the common case.
|
|
33
|
-
LAST_RUN_FILE="$HOME/.claude/team-context/.last-reindex"
|
|
34
|
-
if [ -f "$LAST_RUN_FILE" ]; then
|
|
35
|
-
CHANGED=$(find "$HOME/.claude/projects" -name "*.jsonl" -newer "$LAST_RUN_FILE" 2>/dev/null | head -1)
|
|
36
|
-
if [ -z "$CHANGED" ]; then
|
|
37
|
-
# No conversation files changed — skip expensive reindex, just sync journals
|
|
38
|
-
$WAYFIND journal sync 2>/dev/null &
|
|
39
|
-
exit 0
|
|
40
|
-
fi
|
|
28
|
+
if [ -z "$WAYFIND" ]; then
|
|
29
|
+
echo "[wayfind] CLI not found — decision extraction skipped. Install: npm install -g wayfind" >&2
|
|
30
|
+
exit 0
|
|
41
31
|
fi
|
|
42
32
|
|
|
43
|
-
#
|
|
44
|
-
|
|
45
|
-
# --export: write extracted decisions as journal entries for git sync
|
|
46
|
-
# --detect-shifts: auto-update state files when significant context shifts are detected
|
|
47
|
-
# --write-stats: write session stats JSON for status line display
|
|
48
|
-
$WAYFIND reindex --conversations-only --export --detect-shifts --write-stats 2>/dev/null || true
|
|
49
|
-
|
|
50
|
-
# Update the marker so the next session's fast-path check works
|
|
51
|
-
mkdir -p "$HOME/.claude/team-context"
|
|
52
|
-
touch "$LAST_RUN_FILE"
|
|
33
|
+
# Split any unsuffixed journal files by team (fast, filesystem only)
|
|
34
|
+
$WAYFIND journal split >/dev/null 2>&1 || true
|
|
53
35
|
|
|
54
|
-
# Sync
|
|
55
|
-
# so the
|
|
56
|
-
$WAYFIND journal sync 2>/dev/null
|
|
36
|
+
# Sync journals to team-context repo — the durability guarantee.
|
|
37
|
+
# Runs synchronously so the push completes before the hook exits.
|
|
38
|
+
$WAYFIND journal sync 2>/dev/null || true
|