session-start-next.sh bash
55 lines 1.5 KB
Raw
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 13 hours ago
1 #!/bin/sh
2 # sessionStart / stop hook — print CURRENT NEXT from disk (§LT.4.5, fail-open).
3
4 find_ok() {
5 if [ -n "$OVERSEER_OK" ] && [ -x "$OVERSEER_OK" ]; then
6 printf '%s\n' "$OVERSEER_OK"
7 return 0
8 fi
9 if [ -x "./cli/ok" ]; then
10 printf '%s\n' "./cli/ok"
11 return 0
12 fi
13 if command -v ok >/dev/null 2>&1; then
14 printf '%s\n' "ok"
15 return 0
16 fi
17 return 1
18 }
19
20 OK=$(find_ok) || {
21 printf '%s\n' '{"additional_context":"ok CLI not found","followup_message":"ok CLI not found"}'
22 exit 0
23 }
24
25 NEXT=$("$OK" next 2>&1) || true
26
27 WORKSPACE='Open the repository root (the folder that contains `.overseer/`) as the IDE workspace. If you open a parent folder, project rules and skills under `.cursor/` often do not load. The CLI still works. The open editor tab is not the source of truth — run `ok next`.'
28
29 STALE='If an editor tab of the handover looks old, close it and reopen it. The kit cannot reload the tab. Trust `ok next`, not the tab.'
30
31 export LT_HOOK_NEXT="$NEXT"
32 export LT_HOOK_WORKSPACE="$WORKSPACE"
33 export LT_HOOK_STALE="$STALE"
34
35 if command -v python3 >/dev/null 2>&1; then
36 python3 - <<'PY' || true
37 import json
38 import os
39
40 body = "\n\n".join(
41 part
42 for part in (
43 os.environ.get("LT_HOOK_NEXT", ""),
44 os.environ.get("LT_HOOK_WORKSPACE", ""),
45 os.environ.get("LT_HOOK_STALE", ""),
46 )
47 if part
48 )
49 print(json.dumps({"additional_context": body, "followup_message": body}))
50 PY
51 else
52 printf '%s\n' '{"additional_context":"ok next (python3 unavailable)","followup_message":"ok next (python3 unavailable)"}'
53 fi
54
55 exit 0
File History 1 commit
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1 docs: MuseHub-first before ISR #74 — staging solidify NEXT Human 13 hours ago