Просмотр исходного кода

fix(skills): fleetflow PATH self-heal — _env.sh sourced by every entry script

GUI-launched hosts (Claude Desktop) snapshot their env at app start, so
User-PATH entries added later by winget/npm/scoop/pipx installers are
invisible to child shells until the app restarts - sessions fail with
'claude/jq/keyring not found' despite correct installs (hit 3 sessions on
2026-07-05/06, incl. svg-studio). _env.sh re-adds the canonical per-user
tool dirs when present; FLEETFLOW_PATH_PREPEND extends for exotic paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0xDarkMatter 2 недель назад
Родитель
Сommit
8d3a5a4769

+ 20 - 0
skills/fleetflow/scripts/_env.sh

@@ -0,0 +1,20 @@
+# _env.sh - PATH self-heal sourced by every fleetflow entry script.
+#
+# WHY: GUI-launched hosts (Claude Desktop et al.) snapshot their environment
+# at app start, so User-PATH entries added later by installers (winget, npm,
+# scoop, pipx, uv) are invisible to child shells until the host restarts.
+# Sessions then fail with "claude/jq/keyring not found" despite correct
+# installs. This block re-adds the canonical per-user tool dirs when present.
+# Extend via FLEETFLOW_PATH_PREPEND (colon-separated) for exotic locations.
+for _ffd in ${FLEETFLOW_PATH_PREPEND:+$(echo "$FLEETFLOW_PATH_PREPEND" | tr ':' ' ')} \
+            "$HOME/.local/bin" \
+            "$HOME/AppData/Local/Microsoft/WinGet/Links" \
+            "$HOME/AppData/Roaming/npm" \
+            "$HOME/scoop/shims" \
+            "$HOME/AppData/Local/Programs/Python/Python313/Scripts" \
+            "$HOME/AppData/Roaming/Python/Python313/Scripts" \
+            "$HOME/.local/share/uv/tools" ; do
+  [ -d "$_ffd" ] && case ":$PATH:" in *":$_ffd:"*) ;; *) PATH="$_ffd:$PATH" ;; esac
+done
+unset _ffd
+export PATH

+ 1 - 0
skills/fleetflow/scripts/ff-clean.sh

@@ -13,6 +13,7 @@
 #
 # Exit codes: 0 done (incl. some locked lanes) | 2 usage / no such run
 set -u
+. "$(dirname "${BASH_SOURCE[0]}")/_env.sh"
 
 FF_VERSION="1.1.0"
 

+ 1 - 0
skills/fleetflow/scripts/ff-collect.sh

@@ -11,6 +11,7 @@
 # Exit codes: 0 pass | 2 usage | 3 artifact missing | 10 gate failed
 #             12 escape detected
 set -u
+. "$(dirname "${BASH_SOURCE[0]}")/_env.sh"
 
 FF_VERSION="1.1.0"
 

+ 1 - 0
skills/fleetflow/scripts/ff-doctor.sh

@@ -11,6 +11,7 @@
 # Exit codes: 0 all required checks ok | 2 usage | 7 live probe unreachable
 #             10 structural failure
 set -u
+. "$(dirname "${BASH_SOURCE[0]}")/_env.sh"
 
 FF_VERSION="1.1.0"
 

+ 1 - 0
skills/fleetflow/scripts/ff-import.sh

@@ -21,6 +21,7 @@
 # stdout: one TSV line per agent: id<TAB>imported|incomplete<TAB>prompt_chars.
 # stderr: chatter. Exit: 0 ok | 2 usage/bad dir | 3 nothing to import.
 set -u
+. "$(dirname "${BASH_SOURCE[0]}")/_env.sh"
 
 FF_VERSION="1.1.0"
 

+ 1 - 0
skills/fleetflow/scripts/ff-run.sh

@@ -11,6 +11,7 @@
 #
 # Exit codes: 0 all ok/cached | 2 usage | 10 a lane failed
 set -u
+. "$(dirname "${BASH_SOURCE[0]}")/_env.sh"
 
 FF_VERSION="1.1.0"
 

+ 1 - 0
skills/fleetflow/scripts/ff-spawn.sh

@@ -9,6 +9,7 @@
 # Exit codes: 0 ok | 2 usage | 3 cache hit (cached artifact path on stdout)
 #             5 missing dependency | 10 worker failed
 set -u
+. "$(dirname "${BASH_SOURCE[0]}")/_env.sh"
 
 FF_VERSION="1.1.0"
 

+ 1 - 0
skills/fleetflow/scripts/ff-status.sh

@@ -10,6 +10,7 @@
 #
 # Exit codes: 0 ok | 2 usage
 set -u
+. "$(dirname "${BASH_SOURCE[0]}")/_env.sh"
 
 FF_VERSION="1.1.0"