@curdx/flow 2.0.17 → 2.0.19

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.
@@ -8,6 +8,9 @@
8
8
 
9
9
  set -u
10
10
 
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ . "$SCRIPT_DIR/common.sh"
13
+
11
14
  # Read input (Claude sends JSON on stdin for PreToolUse)
12
15
  INPUT=$(cat 2>/dev/null || echo "{}")
13
16
 
@@ -58,8 +61,7 @@ except Exception:
58
61
  if [ "$QUICK_MODE" = "true" ]; then
59
62
  # Block and inject guidance
60
63
  MSG="[CurDX-Flow quick-mode-guard] Active spec '$ACTIVE' is in quick mode or autonomous mode — AskUserQuestion is forbidden. Decide autonomously based on user preferences in .flow/CONTEXT.md plus the most reasonable assumption, and record your assumption in .progress.md."
61
- ESCAPED=$(printf '%s' "$MSG" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')
62
- printf '{"decision":"block","reason":%s}\n' "$ESCAPED"
64
+ emit_pretooluse_deny "$MSG"
63
65
  exit 0
64
66
  fi
65
67
 
@@ -11,6 +11,9 @@
11
11
 
12
12
  set -u
13
13
 
14
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15
+ . "$SCRIPT_DIR/common.sh"
16
+
14
17
  DATA_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.claude/plugins/data/curdx-flow}"
15
18
  MARKER="$DATA_DIR/.deps-checked"
16
19
  TODAY="$(date +%Y-%m-%d)"
@@ -63,14 +66,7 @@ fi
63
66
 
64
67
  # ---------- 3. Emit hook output ----------
65
68
  if [ -n "$ADDITIONAL_CONTEXT" ]; then
66
- # Use python3 for safe JSON encoding (handles newlines, quotes)
67
- if command -v python3 >/dev/null 2>&1; then
68
- ESCAPED="$(printf '%s' "$ADDITIONAL_CONTEXT" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')"
69
- else
70
- # Fallback: naive escape (only newlines and quotes)
71
- ESCAPED="$(printf '%s' "$ADDITIONAL_CONTEXT" | sed 's/\\/\\\\/g; s/"/\\"/g' | awk 'BEGIN{printf "\""} {printf "%s\\n", $0} END{printf "\""}')"
72
- fi
73
- printf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":%s}}\n' "$ESCAPED"
69
+ emit_session_start_context "$ADDITIONAL_CONTEXT"
74
70
  fi
75
71
 
76
72
  exit 0
@@ -15,6 +15,9 @@
15
15
 
16
16
  set -u
17
17
 
18
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19
+ . "$SCRIPT_DIR/common.sh"
20
+
18
21
  DATA_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.claude/plugins/data/curdx-flow}"
19
22
 
20
23
  # ---------- helper: exit with "allow stop" ----------
@@ -26,15 +29,7 @@ allow_stop() {
26
29
  # ---------- helper: block and inject continuation ----------
27
30
  block_continue() {
28
31
  local reason="$1"
29
- # Safely JSON-encode via python3 if available
30
- if command -v python3 >/dev/null 2>&1; then
31
- printf '{"decision":"block","reason":%s}\n' \
32
- "$(printf '%s' "$reason" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')"
33
- else
34
- # Fallback: escape quotes and newlines naively
35
- local escaped=$(printf '%s' "$reason" | sed 's/\\/\\\\/g; s/"/\\"/g' | tr '\n' ' ')
36
- printf '{"decision":"block","reason":"%s"}\n' "$escaped"
37
- fi
32
+ emit_stop_block "$reason"
38
33
  exit 0
39
34
  }
40
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curdx/flow",
3
- "version": "2.0.17",
3
+ "version": "2.0.19",
4
4
  "description": "CLI installer for CurdX-Flow — AI engineering workflow meta-framework for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {