@devflow-tools/cli 0.16.14 → 0.16.16

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.
@@ -25,6 +25,8 @@ if [ -z "${CLAUDE_PLUGIN_ROOT:-}" ]; then
25
25
  else
26
26
  PLUGIN_ROOT="$CLAUDE_PLUGIN_ROOT"
27
27
  fi
28
+ source "${PLUGIN_ROOT}/hooks/runtime-node"
29
+ DEVFLOW_NODE="$(devflow_resolve_node "$PLUGIN_ROOT")"
28
30
 
29
31
  # Read DevFlow Constitution from file (avoids shell escaping issues)
30
32
  CONSTITUTION_FILE="${PLUGIN_ROOT}/skills/devflow/SKILL.md"
@@ -42,8 +44,8 @@ fi
42
44
  GATE_COUNT=4
43
45
  RULE_COUNT=""
44
46
  ENFORCER_SUMMARY_JS="${PLUGIN_ROOT}/dist/hooks/enforcer-summary.js"
45
- if [ -f "$ENFORCER_SUMMARY_JS" ] && command -v node >/dev/null 2>&1; then
46
- ENFORCER_SUMMARY=$(node "$ENFORCER_SUMMARY_JS" 2>/dev/null || echo "")
47
+ if [ -f "$ENFORCER_SUMMARY_JS" ] && [ -x "$DEVFLOW_NODE" ]; then
48
+ ENFORCER_SUMMARY=$("$DEVFLOW_NODE" "$ENFORCER_SUMMARY_JS" 2>/dev/null || echo "")
47
49
  if [ -n "$ENFORCER_SUMMARY" ] && command -v python3 >/dev/null 2>&1; then
48
50
  PARSED_COUNTS=$(printf '%s' "$ENFORCER_SUMMARY" | python3 -c "import json,sys; d=json.load(sys.stdin); g=d.get('gateCount'); r=d.get('ruleCount'); print(f'{g}|{r}' if isinstance(g,int) and isinstance(r,int) else '')" 2>/dev/null || echo "")
49
51
  if [[ "$PARSED_COUNTS" =~ ^[0-9]+\|[0-9]+$ ]]; then
@@ -136,7 +138,7 @@ run_lifecycle() {
136
138
  if response=$(DEVFLOW_HOOK_CLIENT_TIMEOUT_MS=250 \
137
139
  DEVFLOW_HOOK_CLIENT_RETRY_DELAY_MS=0 \
138
140
  DEVFLOW_HOOK_CLIENT_SUPPRESS_FALLBACK_LOG="$suppress_fallback" \
139
- node "$CLIENT_JS" session-start "$SESSION_START_INPUT" 2>> "$DAEMON_LOG"); then
141
+ "$DEVFLOW_NODE" "$CLIENT_JS" session-start "$SESSION_START_INPUT" 2>> "$DAEMON_LOG"); then
140
142
  DEVFLOW_DAEMON_REACHABLE=1
141
143
  DEVFLOW_SESSION_DURABLE=1
142
144
  DAEMON_SESSION_RESPONSE="$response"
@@ -165,13 +167,13 @@ run_lifecycle() {
165
167
 
166
168
  if [ -n "$SESSION_START_INPUT" ] && register_session 1; then
167
169
  :
168
- elif [ -f "$DAEMON_JS" ] && command -v nohup >/dev/null 2>&1 && command -v node >/dev/null 2>&1; then
170
+ elif [ -f "$DAEMON_JS" ] && command -v nohup >/dev/null 2>&1 && [ -x "$DEVFLOW_NODE" ]; then
169
171
  if [ -n "$SESSION_START_INPUT" ] && queue_session_start; then
170
- nohup node "$DAEMON_JS" "$PROJECT_ROOT" </dev/null >> "$DAEMON_LOG" 2>&1 &
172
+ nohup "$DEVFLOW_NODE" "$DAEMON_JS" "$PROJECT_ROOT" </dev/null >> "$DAEMON_LOG" 2>&1 &
171
173
  elif [ -n "$SESSION_START_INPUT" ]; then
172
- nohup node "$DAEMON_JS" "$PROJECT_ROOT" "$SESSION_START_INPUT" </dev/null >> "$DAEMON_LOG" 2>&1 &
174
+ nohup "$DEVFLOW_NODE" "$DAEMON_JS" "$PROJECT_ROOT" "$SESSION_START_INPUT" </dev/null >> "$DAEMON_LOG" 2>&1 &
173
175
  else
174
- nohup node "$DAEMON_JS" "$PROJECT_ROOT" </dev/null >> "$DAEMON_LOG" 2>&1 &
176
+ nohup "$DEVFLOW_NODE" "$DAEMON_JS" "$PROJECT_ROOT" </dev/null >> "$DAEMON_LOG" 2>&1 &
175
177
  fi
176
178
  DAEMON_PID=$!
177
179
  DEVFLOW_DAEMON_LAUNCHING=1
@@ -185,8 +187,8 @@ run_lifecycle() {
185
187
  fi
186
188
 
187
189
  SERVER_BOOTSTRAP_JS="${PLUGIN_ROOT}/dist/hooks/server-bootstrap.js"
188
- if [ -f "$SERVER_BOOTSTRAP_JS" ] && command -v nohup >/dev/null 2>&1 && command -v node >/dev/null 2>&1; then
189
- nohup node "$SERVER_BOOTSTRAP_JS" </dev/null >> "$SERVER_LOG" 2>&1 &
190
+ if [ -f "$SERVER_BOOTSTRAP_JS" ] && command -v nohup >/dev/null 2>&1 && [ -x "$DEVFLOW_NODE" ]; then
191
+ nohup "$DEVFLOW_NODE" "$SERVER_BOOTSTRAP_JS" </dev/null >> "$SERVER_LOG" 2>&1 &
190
192
  fi
191
193
  }
192
194
 
@@ -214,16 +216,16 @@ CONFIG_FILE="${PROJECT_ROOT}/.devflow/config.json"
214
216
  MEMORY_RESPONSE=""
215
217
  if { [ "$DEVFLOW_DAEMON_REACHABLE" = "1" ] || [ -z "$SESSION_START_INPUT" ]; } \
216
218
  && [ -f "${CLIENT_JS:-}" ] \
217
- && command -v node >/dev/null 2>&1; then
219
+ && [ -x "$DEVFLOW_NODE" ]; then
218
220
  MEMORY_RESPONSE=$(DEVFLOW_HOOK_CLIENT_TIMEOUT_MS=75 \
219
221
  DEVFLOW_HOOK_CLIENT_RETRY_DELAY_MS=0 \
220
- node "$CLIENT_JS" memory-snapshot </dev/null 2>/dev/null || echo "")
222
+ "$DEVFLOW_NODE" "$CLIENT_JS" memory-snapshot </dev/null 2>/dev/null || echo "")
221
223
  fi
222
224
  MEMORY_CACHE_JS="${PLUGIN_ROOT}/dist/hooks/memory-snapshot-cache.js"
223
- if [ -f "$MEMORY_CACHE_JS" ] && command -v node >/dev/null 2>&1; then
225
+ if [ -f "$MEMORY_CACHE_JS" ] && [ -x "$DEVFLOW_NODE" ]; then
224
226
  MEMORY_SNAPSHOT=$(DEVFLOW_MEMORY_SNAPSHOT_CLI=1 \
225
227
  DEVFLOW_MEMORY_RESPONSE="$MEMORY_RESPONSE" \
226
- node "$MEMORY_CACHE_JS" session-start "$PROJECT_ROOT" "$CONFIG_FILE" 2>/dev/null) \
228
+ "$DEVFLOW_NODE" "$MEMORY_CACHE_JS" session-start "$PROJECT_ROOT" "$CONFIG_FILE" 2>/dev/null) \
227
229
  || MEMORY_SNAPSHOT=$'## Project memory\nDevFlow memory snapshot=degraded; source=none; reason=cache_reader_failed. Memory availability is not yet known; do not conclude that the project has no memories.'
228
230
  fi
229
231
 
@@ -253,8 +255,8 @@ fi
253
255
 
254
256
  SUMMARY="${SUMMARY}${DEGRADED_CONTEXT}${DAEMON_CONTEXT}"$'\n\n'"${ONBOARDING_SNAPSHOT}"$'\n\n'"${MEMORY_SNAPSHOT}${MCP_PROTOCOL}"$'\n\n'"${GLOBAL_CONSTRAINT}${GATEWAY_STATUS}"
255
257
 
256
- if command -v node >/dev/null 2>&1 \
257
- && ESCAPED=$(printf '%s\n' "$SUMMARY" | node -e "let s=''; process.stdin.setEncoding('utf8'); process.stdin.on('data',c=>s+=c); process.stdin.on('end',()=>process.stdout.write(JSON.stringify(s)))" 2>/dev/null); then
258
+ if [ -x "$DEVFLOW_NODE" ] \
259
+ && ESCAPED=$(printf '%s\n' "$SUMMARY" | "$DEVFLOW_NODE" -e "let s=''; process.stdin.setEncoding('utf8'); process.stdin.on('data',c=>s+=c); process.stdin.on('end',()=>process.stdout.write(JSON.stringify(s)))" 2>/dev/null); then
258
260
  :
259
261
  elif command -v python3 >/dev/null 2>&1 \
260
262
  && ESCAPED=$(printf '%s\n' "$SUMMARY" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))" 2>/dev/null); then
@@ -4,12 +4,14 @@ set -euo pipefail
4
4
  # DevFlow Stop Hook — graceful daemon shutdown + cleanup
5
5
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
6
  PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$SCRIPT_DIR/..}"
7
+ source "$SCRIPT_DIR/runtime-node"
8
+ DEVFLOW_NODE="$(devflow_resolve_node "$PLUGIN_ROOT")"
7
9
 
8
10
  # 1. Use the daemon as the authoritative Stop handler.
9
11
  CLIENT_JS="$PLUGIN_ROOT/dist/hooks/hook-client.js"
10
12
  INPUT="$(cat)"
11
13
  if [ -f "$CLIENT_JS" ]; then
12
- if node "$CLIENT_JS" stop "$INPUT" </dev/null 2>/dev/null; then
14
+ if "$DEVFLOW_NODE" "$CLIENT_JS" stop "$INPUT" </dev/null 2>/dev/null; then
13
15
  exit 0
14
16
  fi
15
17
  fi
@@ -17,7 +19,7 @@ fi
17
19
  # 2. Run standalone fallback only when daemon delivery failed.
18
20
  STOP_JS="$PLUGIN_ROOT/dist/hooks/stop.js"
19
21
  if [ -f "$STOP_JS" ]; then
20
- printf '%s' "$INPUT" | DEVFLOW_HOOK_DEGRADED=1 node "$STOP_JS" 2>/dev/null || true
22
+ printf '%s' "$INPUT" | DEVFLOW_HOOK_DEGRADED=1 "$DEVFLOW_NODE" "$STOP_JS" 2>/dev/null || true
21
23
  fi
22
24
 
23
25
  # 3. Clean up stale receipt files for this project
@@ -3,17 +3,19 @@ set -euo pipefail
3
3
 
4
4
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
  PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$SCRIPT_DIR/..}"
6
+ source "$SCRIPT_DIR/runtime-node"
7
+ DEVFLOW_NODE="$(devflow_resolve_node "$PLUGIN_ROOT")"
6
8
  CLIENT_JS="$PLUGIN_ROOT/dist/hooks/hook-client.js"
7
9
  FALLBACK_JS="$PLUGIN_ROOT/dist/hooks/user-prompt-submit.js"
8
10
 
9
11
  INPUT="$(cat)"
10
12
 
11
13
  if [ -f "$CLIENT_JS" ]; then
12
- node "$CLIENT_JS" user-prompt-submit "$INPUT" 2>/dev/null || {
13
- echo "$INPUT" | DEVFLOW_HOOK_DEGRADED=1 node "$FALLBACK_JS" 2>/dev/null || true
14
+ "$DEVFLOW_NODE" "$CLIENT_JS" user-prompt-submit "$INPUT" 2>/dev/null || {
15
+ echo "$INPUT" | DEVFLOW_HOOK_DEGRADED=1 "$DEVFLOW_NODE" "$FALLBACK_JS" 2>/dev/null || true
14
16
  }
15
17
  elif [ -f "$FALLBACK_JS" ]; then
16
- echo "$INPUT" | DEVFLOW_HOOK_DEGRADED=1 node "$FALLBACK_JS" 2>/dev/null || true
18
+ echo "$INPUT" | DEVFLOW_HOOK_DEGRADED=1 "$DEVFLOW_NODE" "$FALLBACK_JS" 2>/dev/null || true
17
19
  fi
18
20
 
19
21
  exit 0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/claude-code-plugin",
3
- "version": "0.16.14",
3
+ "version": "0.16.16",
4
4
  "description": "DevFlow — Developer Intelligence Platform for Claude Code",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -11,18 +11,18 @@
11
11
  "prepack": "npm run verify:manifest"
12
12
  },
13
13
  "dependencies": {
14
- "@devflow-tools/database": "0.16.14",
15
- "@devflow-tools/memory-engine": "0.16.14",
16
- "@devflow-tools/sdk": "0.16.14",
17
- "@devflow-tools/telemetry": "0.16.14",
18
- "@devflow-tools/workflow-engine": "0.16.14"
14
+ "@devflow-tools/database": "0.16.16",
15
+ "@devflow-tools/memory-engine": "0.16.16",
16
+ "@devflow-tools/sdk": "0.16.16",
17
+ "@devflow-tools/telemetry": "0.16.16",
18
+ "@devflow-tools/workflow-engine": "0.16.16"
19
19
  },
20
20
  "allowScripts": {
21
21
  "better-sqlite3@12.11.1": true,
22
22
  "sharp@0.32.6": true
23
23
  },
24
24
  "devDependencies": {
25
- "@devflow-tools/mcp-server": "0.16.14"
25
+ "@devflow-tools/mcp-server": "0.16.16"
26
26
  },
27
27
  "keywords": [
28
28
  "pi-package",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/cli",
3
- "version": "0.16.14",
3
+ "version": "0.16.16",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -12,31 +12,31 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@colbymchenry/codegraph": "^1.1.1",
15
- "@devflow-tools/adapters": "0.16.14",
16
- "@devflow-tools/benchmark": "0.16.14",
17
- "@devflow-tools/context-engine": "0.16.14",
18
- "@devflow-tools/database": "0.16.14",
19
- "@devflow-tools/knowledge-engine": "0.16.14",
20
- "@devflow-tools/mcp-server": "0.16.14",
21
- "@devflow-tools/memory-engine": "0.16.14",
22
- "@devflow-tools/plugin-animation": "0.16.14",
23
- "@devflow-tools/plugin-css": "0.16.14",
24
- "@devflow-tools/plugin-docker": "0.16.14",
25
- "@devflow-tools/plugin-electron": "0.16.14",
26
- "@devflow-tools/plugin-git": "0.16.14",
27
- "@devflow-tools/plugin-graphql": "0.16.14",
28
- "@devflow-tools/plugin-nest": "0.16.14",
29
- "@devflow-tools/plugin-nextjs": "0.16.14",
30
- "@devflow-tools/plugin-performance": "0.16.14",
31
- "@devflow-tools/plugin-react": "0.16.14",
32
- "@devflow-tools/plugin-tailwind": "0.16.14",
33
- "@devflow-tools/plugin-taro": "0.16.14",
34
- "@devflow-tools/plugin-ui-layout": "0.16.14",
35
- "@devflow-tools/plugin-vue": "0.16.14",
36
- "@devflow-tools/sdk": "0.16.14",
37
- "@devflow-tools/server": "0.16.14",
38
- "@devflow-tools/telemetry": "0.16.14",
39
- "@devflow-tools/workflow-engine": "0.16.14",
15
+ "@devflow-tools/adapters": "0.16.16",
16
+ "@devflow-tools/benchmark": "0.16.16",
17
+ "@devflow-tools/context-engine": "0.16.16",
18
+ "@devflow-tools/database": "0.16.16",
19
+ "@devflow-tools/knowledge-engine": "0.16.16",
20
+ "@devflow-tools/mcp-server": "0.16.16",
21
+ "@devflow-tools/memory-engine": "0.16.16",
22
+ "@devflow-tools/plugin-animation": "0.16.16",
23
+ "@devflow-tools/plugin-css": "0.16.16",
24
+ "@devflow-tools/plugin-docker": "0.16.16",
25
+ "@devflow-tools/plugin-electron": "0.16.16",
26
+ "@devflow-tools/plugin-git": "0.16.16",
27
+ "@devflow-tools/plugin-graphql": "0.16.16",
28
+ "@devflow-tools/plugin-nest": "0.16.16",
29
+ "@devflow-tools/plugin-nextjs": "0.16.16",
30
+ "@devflow-tools/plugin-performance": "0.16.16",
31
+ "@devflow-tools/plugin-react": "0.16.16",
32
+ "@devflow-tools/plugin-tailwind": "0.16.16",
33
+ "@devflow-tools/plugin-taro": "0.16.16",
34
+ "@devflow-tools/plugin-ui-layout": "0.16.16",
35
+ "@devflow-tools/plugin-vue": "0.16.16",
36
+ "@devflow-tools/sdk": "0.16.16",
37
+ "@devflow-tools/server": "0.16.16",
38
+ "@devflow-tools/telemetry": "0.16.16",
39
+ "@devflow-tools/workflow-engine": "0.16.16",
40
40
  "@inquirer/prompts": "^7.10.1",
41
41
  "chalk": "^5.3.0",
42
42
  "commander": "^12.0.0"