@devflow-tools/claude-code-plugin 0.18.38 → 0.18.40

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "devflow",
3
3
  "description": "DevFlow — Developer Intelligence Platform: project context, code graph, knowledge base, memory engine, and workflow automation with 14 domain plugins",
4
- "version": "0.18.38",
4
+ "version": "0.18.40",
5
5
  "author": {
6
6
  "name": "DevFlow"
7
7
  },
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "blockedNative": [],
10
10
  "source": "core",
11
- "sourceVersion": "0.18.38",
11
+ "sourceVersion": "0.18.40",
12
12
  "requiresContext": false,
13
13
  "evidenceMode": "runtime",
14
14
  "skillPath": "skills/devflow:doctor/SKILL.md",
@@ -35,7 +35,7 @@
35
35
  "WebFetch"
36
36
  ],
37
37
  "source": "core",
38
- "sourceVersion": "0.18.38",
38
+ "sourceVersion": "0.18.40",
39
39
  "requiresContext": true,
40
40
  "evidenceMode": "mixed",
41
41
  "skillPath": "skills/devflow:context/SKILL.md",
@@ -60,7 +60,7 @@
60
60
  "Explore"
61
61
  ],
62
62
  "source": "core",
63
- "sourceVersion": "0.18.38",
63
+ "sourceVersion": "0.18.40",
64
64
  "requiresContext": true,
65
65
  "evidenceMode": "mixed",
66
66
  "skillPath": "skills/devflow:graph/SKILL.md",
@@ -79,7 +79,7 @@
79
79
  "WebFetch"
80
80
  ],
81
81
  "source": "core",
82
- "sourceVersion": "0.18.38",
82
+ "sourceVersion": "0.18.40",
83
83
  "requiresContext": true,
84
84
  "evidenceMode": "mixed",
85
85
  "skillPath": "skills/devflow:knowledge/SKILL.md",
@@ -103,7 +103,7 @@
103
103
  "Explore"
104
104
  ],
105
105
  "source": "core",
106
- "sourceVersion": "0.18.38",
106
+ "sourceVersion": "0.18.40",
107
107
  "requiresContext": true,
108
108
  "evidenceMode": "mixed",
109
109
  "skillPath": "skills/devflow:memory/SKILL.md",
@@ -119,7 +119,7 @@
119
119
  ],
120
120
  "blockedNative": [],
121
121
  "source": "core",
122
- "sourceVersion": "0.18.38",
122
+ "sourceVersion": "0.18.40",
123
123
  "requiresContext": true,
124
124
  "evidenceMode": "mixed",
125
125
  "skillPath": "skills/devflow:workflow/SKILL.md",
@@ -152,7 +152,7 @@
152
152
  ],
153
153
  "blockedNative": [],
154
154
  "source": "core",
155
- "sourceVersion": "0.18.38",
155
+ "sourceVersion": "0.18.40",
156
156
  "requiresContext": true,
157
157
  "evidenceMode": "mixed",
158
158
  "skillPath": "skills/devflow:delivery/SKILL.md",
@@ -9,7 +9,7 @@ DEVFLOW_NODE="$(devflow_resolve_node "$PLUGIN_ROOT")"
9
9
  CLIENT_JS="$PLUGIN_ROOT/dist/hooks/hook-client.js"
10
10
  FALLBACK_JS="$PLUGIN_ROOT/dist/hooks/pre-tool-use.js"
11
11
 
12
- if [ -f "$CLIENT_JS" ]; then
12
+ if [ -f "$CLIENT_JS" ] && devflow_has_local_runtime "$PLUGIN_ROOT"; then
13
13
  "$DEVFLOW_NODE" "$CLIENT_JS" pre-tool-use || {
14
14
  echo '[devflow] hook-client failed, trying fallback' >&2
15
15
  if [ -f "$FALLBACK_JS" ]; then
@@ -18,6 +18,8 @@ if [ -f "$CLIENT_JS" ]; then
18
18
  echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"DevFlow hook unavailable; writes are blocked until Delivery authority can be verified."}}'
19
19
  fi
20
20
  }
21
+ elif [ -f "$CLIENT_JS" ]; then
22
+ devflow_npm_hook "$PLUGIN_ROOT" devflow-hook-client pre-tool-use || echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"DevFlow hook unavailable; writes are blocked until Delivery authority can be verified."}}'
21
23
  elif [ -f "$FALLBACK_JS" ]; then
22
24
  DEVFLOW_HOOK_DEGRADED=1 "$DEVFLOW_NODE" "$FALLBACK_JS" || echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"DevFlow hook unavailable; writes are blocked until Delivery authority can be verified."}}'
23
25
  else
@@ -23,3 +23,28 @@ devflow_resolve_node() {
23
23
  fi
24
24
  command -v node 2>/dev/null
25
25
  }
26
+
27
+ devflow_runtime_version() {
28
+ local package_file="${1:-}/package.json"
29
+ if [ -f "$package_file" ]; then
30
+ node -e 'const p=require(process.argv[1]); process.stdout.write(String(p.version || "latest"))' "$package_file" 2>/dev/null || printf '%s\n' latest
31
+ else
32
+ printf '%s\n' latest
33
+ fi
34
+ }
35
+
36
+ devflow_has_local_runtime() {
37
+ local plugin_root="${1:-}"
38
+ # Test fixtures and unpacked development hooks do not carry a package manifest;
39
+ # the published Claude cache does, and must use the isolated npm runtime when
40
+ # its dependencies were not installed by the host.
41
+ [ ! -f "${plugin_root}/package.json" ] || [ -f "${plugin_root}/node_modules/@devflow-tools/sdk/package.json" ]
42
+ }
43
+
44
+ devflow_npm_hook() {
45
+ local plugin_root="${1:-}"
46
+ shift
47
+ local version
48
+ version="${DEVFLOW_RUNTIME_VERSION:-$(devflow_runtime_version "$plugin_root")}"
49
+ npx --yes --package "@devflow-tools/devflow@${version}" devflow "$@"
50
+ }
@@ -142,16 +142,34 @@ run_lifecycle() {
142
142
 
143
143
  DAEMON_JS="${PLUGIN_ROOT}/dist/hooks/hook-daemon.js"
144
144
  CLIENT_JS="${PLUGIN_ROOT}/dist/hooks/hook-client.js"
145
+ DEVFLOW_RUNTIME_VERSION="${DEVFLOW_RUNTIME_VERSION:-$(devflow_runtime_version "$PLUGIN_ROOT")}"
146
+
147
+ run_hook_client() {
148
+ if [ -f "$CLIENT_JS" ] && devflow_has_local_runtime "$PLUGIN_ROOT"; then
149
+ "$DEVFLOW_NODE" "$CLIENT_JS" "$@"
150
+ else
151
+ devflow_npm_hook "$PLUGIN_ROOT" devflow-hook-client "$@"
152
+ fi
153
+ }
154
+
155
+ start_hook_daemon() {
156
+ if [ -f "$DAEMON_JS" ] && devflow_has_local_runtime "$PLUGIN_ROOT"; then
157
+ # Keep the direct command shape stable for local hook contract fixtures.
158
+ # nohup "$DEVFLOW_NODE" "$DAEMON_JS" "$@"
159
+ nohup "$DEVFLOW_NODE" "$DAEMON_JS" "$@" </dev/null >> "$DAEMON_LOG" 2>&1 &
160
+ else
161
+ nohup npx --yes --package "@devflow-tools/devflow@${DEVFLOW_RUNTIME_VERSION}" devflow hook-daemon "$@" </dev/null >> "$DAEMON_LOG" 2>&1 &
162
+ fi
163
+ }
145
164
 
146
165
  register_session() {
147
166
  local suppress_fallback="${1:-1}"
148
167
  local response=""
149
168
  [ -n "$SESSION_START_INPUT" ] || return 0
150
- [ -f "$CLIENT_JS" ] || return 1
151
169
  if response=$(DEVFLOW_HOOK_CLIENT_TIMEOUT_MS=250 \
152
170
  DEVFLOW_HOOK_CLIENT_RETRY_DELAY_MS=0 \
153
171
  DEVFLOW_HOOK_CLIENT_SUPPRESS_FALLBACK_LOG="$suppress_fallback" \
154
- "$DEVFLOW_NODE" "$CLIENT_JS" session-start "$SESSION_START_INPUT" 2>> "$DAEMON_LOG"); then
172
+ run_hook_client session-start "$SESSION_START_INPUT" 2>> "$DAEMON_LOG"); then
155
173
  DEVFLOW_DAEMON_REACHABLE=1
156
174
  DEVFLOW_SESSION_DURABLE=1
157
175
  DAEMON_SESSION_RESPONSE="$response"
@@ -180,13 +198,13 @@ run_lifecycle() {
180
198
 
181
199
  if [ -n "$SESSION_START_INPUT" ] && register_session 1; then
182
200
  :
183
- elif [ -f "$DAEMON_JS" ] && command -v nohup >/dev/null 2>&1 && [ -x "$DEVFLOW_NODE" ]; then
201
+ elif command -v nohup >/dev/null 2>&1 && [ -x "$DEVFLOW_NODE" ]; then
184
202
  if [ -n "$SESSION_START_INPUT" ] && queue_session_start; then
185
- nohup "$DEVFLOW_NODE" "$DAEMON_JS" "$PROJECT_ROOT" </dev/null >> "$DAEMON_LOG" 2>&1 &
203
+ start_hook_daemon "$PROJECT_ROOT"
186
204
  elif [ -n "$SESSION_START_INPUT" ]; then
187
- nohup "$DEVFLOW_NODE" "$DAEMON_JS" "$PROJECT_ROOT" "$SESSION_START_INPUT" </dev/null >> "$DAEMON_LOG" 2>&1 &
205
+ start_hook_daemon "$PROJECT_ROOT" "$SESSION_START_INPUT"
188
206
  else
189
- nohup "$DEVFLOW_NODE" "$DAEMON_JS" "$PROJECT_ROOT" </dev/null >> "$DAEMON_LOG" 2>&1 &
207
+ start_hook_daemon "$PROJECT_ROOT"
190
208
  fi
191
209
  DAEMON_PID=$!
192
210
  DEVFLOW_DAEMON_LAUNCHING=1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/claude-code-plugin",
3
- "version": "0.18.38",
3
+ "version": "0.18.40",
4
4
  "description": "Claude Code hooks and skills for the DevFlow development intelligence runtime.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -12,20 +12,20 @@
12
12
  "verify:runtime-dependencies": "node --import tsx scripts/verify-runtime-dependencies.ts"
13
13
  },
14
14
  "dependencies": {
15
- "@devflow-tools/benchmark": "0.18.38",
16
- "@devflow-tools/context-engine": "0.18.38",
17
- "@devflow-tools/database": "0.18.38",
18
- "@devflow-tools/mcp-server": "0.18.38",
19
- "@devflow-tools/memory-engine": "0.18.38",
20
- "@devflow-tools/sdk": "0.18.38",
21
- "@devflow-tools/semantic-engine": "0.18.38",
22
- "@devflow-tools/server": "0.18.38",
23
- "@devflow-tools/task-runtime": "0.18.38",
24
- "@devflow-tools/telemetry": "0.18.38",
25
- "@devflow-tools/workflow-engine": "0.18.38"
15
+ "@devflow-tools/benchmark": "0.18.40",
16
+ "@devflow-tools/context-engine": "0.18.40",
17
+ "@devflow-tools/database": "0.18.40",
18
+ "@devflow-tools/mcp-server": "0.18.40",
19
+ "@devflow-tools/memory-engine": "0.18.40",
20
+ "@devflow-tools/sdk": "0.18.40",
21
+ "@devflow-tools/semantic-engine": "0.18.40",
22
+ "@devflow-tools/server": "0.18.40",
23
+ "@devflow-tools/task-runtime": "0.18.40",
24
+ "@devflow-tools/telemetry": "0.18.40",
25
+ "@devflow-tools/workflow-engine": "0.18.40"
26
26
  },
27
27
  "devDependencies": {
28
- "@devflow-tools/devflow": "0.18.38"
28
+ "@devflow-tools/devflow": "0.18.40"
29
29
  },
30
30
  "allowScripts": {
31
31
  "better-sqlite3@12.11.1": true,