auxilo-mcp 0.7.0 → 0.8.2

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.
@@ -0,0 +1,49 @@
1
+ #!/bin/bash
2
+ # Auxilo SessionEnd hook — packaged template (LW-12).
3
+ #
4
+ # Preferred install path: `npx auxilo setup` GENERATES a copy of this hook at
5
+ # ~/.auxilo/bin/auxilo-extract.sh with absolute paths embedded (lib/installer.js
6
+ # renderHookScript). This template is the $HOME-relative fallback used by the
7
+ # legacy `scripts/runner.js --install-hooks` copy step.
8
+ #
9
+ # Reads the Claude Code SessionEnd JSON from stdin, extracts the transcript
10
+ # path, and spawns the extraction runner detached so shutdown is not blocked.
11
+ # Runner location per P1-13: executable surface lives in ~/.auxilo/bin —
12
+ # NEVER under ~/Documents (macOS TCC blocks launchd/hook execution there).
13
+
14
+ set -u
15
+
16
+ # Kill-switch: runner fires only if the consent sentinel exists.
17
+ # enable: npx auxilo setup (consent step) disable: npx auxilo disable
18
+ if [ ! -f "$HOME/.auxilo/autonomous-enabled" ]; then
19
+ exit 0
20
+ fi
21
+
22
+ # Recursion guard: bail if we're already inside an extraction chain.
23
+ if [ "${AUXILO_EXTRACTING:-0}" = "1" ]; then
24
+ exit 0
25
+ fi
26
+
27
+ input_json=$(cat)
28
+
29
+ transcript_path=$(printf '%s' "$input_json" | /usr/bin/env node -e 'let d="";process.stdin.on("data",c=>d+=c).on("end",()=>{try{process.stdout.write(JSON.parse(d).transcript_path||"")}catch{}})' 2>/dev/null)
30
+
31
+ if [ -z "$transcript_path" ] || [ ! -f "$transcript_path" ]; then
32
+ exit 0
33
+ fi
34
+
35
+ RUNNER="$HOME/.auxilo/bin/scripts/runner.js"
36
+ if [ ! -f "$RUNNER" ]; then
37
+ exit 0
38
+ fi
39
+
40
+ mkdir -p "$HOME/.auxilo"
41
+ LOG="$HOME/.auxilo/extract.log"
42
+
43
+ # Spawn detached — do not block session teardown.
44
+ # P1-13 lesson: do NOT set AUXILO_EXTRACTING here — runner.js's own recursion
45
+ # guard would trip and silently no-op every run. The runner sets it itself
46
+ # for child processes.
47
+ nohup /usr/bin/env node "$RUNNER" --transcript "$transcript_path" >> "$LOG" 2>&1 &
48
+
49
+ exit 0