@sassywares/skills 0.11.8 → 0.11.10

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sassywares/skills",
3
- "version": "0.11.8",
3
+ "version": "0.11.10",
4
4
  "description": "Lean, explicit-invocation Agent Skills for shipping fast: plan, work, review, validate, ship.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -10,11 +10,11 @@
10
10
  # 3. Everything resolves against the MAIN checkout, so running any of these
11
11
  # from inside a worktree behaves identically.
12
12
  #
13
- # worktree-version: 2
13
+ # worktree-version: 5
14
14
 
15
15
  set -euo pipefail
16
16
 
17
- WT_VERSION="2"
17
+ WT_VERSION="5"
18
18
  WT_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19
19
 
20
20
  log() { printf '%s\n' "$*"; }
@@ -179,7 +179,24 @@ wt_range() {
179
179
  # trace to go stale. The probe runs in a subshell so a successful connect cannot
180
180
  # leave a descriptor (or a fatal `exec`) behind in the caller.
181
181
  tcp_up() {
182
- (exec 3<>"/dev/tcp/127.0.0.1/$1") >/dev/null 2>&1
182
+ local port="$1"
183
+ # IPv4, then IPv6: a dev server that binds `[::1]` only is up, and an IPv4-only
184
+ # probe reads it as down — which would make `LIVE` lie and `remove`'s
185
+ # live-preview refusal unreachable.
186
+ if (exec 3<>"/dev/tcp/127.0.0.1/$port") >/dev/null 2>&1; then return 0; fi
187
+ if (exec 3<>"/dev/tcp/::1/$port") >/dev/null 2>&1; then return 0; fi
188
+ # Last resort for a listener /dev/tcp cannot reach.
189
+ if command -v lsof >/dev/null 2>&1 && lsof -nP -iTCP:"$port" -sTCP:LISTEN >/dev/null 2>&1; then
190
+ return 0
191
+ fi
192
+ return 1
193
+ }
194
+
195
+ # short_path PATH WIDTH — keep the tail of a long path, because the tail holds the
196
+ # slug and the start is always the same worktree home.
197
+ short_path() {
198
+ local s="$1" w="$2"
199
+ if [ "${#s}" -gt "$w" ]; then printf '…%s' "${s: -$(( w - 1 ))}"; else printf '%s' "$s"; fi
183
200
  }
184
201
 
185
202
  wt_claim_dir() { printf '%s/ports/%s' "$(wt_home)" "$1"; }
@@ -41,7 +41,7 @@ one() { # $1 path, $2 branch
41
41
  local p="$1" b="$2" slug port line
42
42
  slug="$(wt_slug "$b")"
43
43
  if wt_is_main "$p"; then
44
- die "the main checkout has no derived port — it uses whatever the app defaults to"
44
+ die "the main checkout is not a worktree — read the recipe's preview line for its address"
45
45
  fi
46
46
  case "$kind" in
47
47
  path) printf '%s\n' "$p" ;;
@@ -74,7 +74,7 @@ while IFS=$'\t' read -r p b; do
74
74
  slug="$(wt_slug "$b")"
75
75
  shown="${p/#$HOME/~}"
76
76
  if wt_is_main "$p"; then
77
- printf ' %-34s %-50s %-40s %-5s %s\n' "$b (main checkout)" "$shown" "—" "—" "—"
77
+ printf ' %-34s %-50s %-40.40s %-5s %s\n' "$(short_path "$b (main checkout)" 34)" "$(short_path "$shown" 50)" "—" "—" "—"
78
78
  continue
79
79
  fi
80
80
  if ! wt_managed "$p"; then
@@ -92,7 +92,7 @@ while IFS=$'\t' read -r p b; do
92
92
  live="—"
93
93
  fi
94
94
  last="$(wt_verdict "$p")"
95
- printf ' %-34s %-50s %-40s %-5s %s\n' "$b" "$shown" "${line:-—}" "$live" "${last:-—}"
95
+ printf ' %-34s %-50s %-40.40s %-5s %s\n' "$(short_path "$b" 34)" "$(short_path "$shown" 50)" "${line:-—}" "$live" "${last:-—}"
96
96
  done < <(wt_all)
97
97
 
98
98
  [ "$count" -gt 0 ] || log " no checkouts found — is this a git repository?"
@@ -75,10 +75,11 @@ if [ "$force" -eq 0 ]; then
75
75
  esac
76
76
  fi
77
77
 
78
- if [ "$force" -eq 1 ]; then
79
- git worktree remove --force "$path"
80
- else
81
- git worktree remove "$path"
78
+ if ! { [ "$force" -eq 1 ] && git worktree remove --force "$path" || [ "$force" -eq 0 ] && git worktree remove "$path"; }; then
79
+ printf ' → %s\n' "git removed the registration but not the folder, so nothing here can reach it now:" >&2
80
+ printf ' %s\n' "stop whatever is still running there, then delete that folder yourself" >&2
81
+ printf ' %s\n' "(\`git worktree prune\` only matters if \`git worktree list\` still names it)" >&2
82
+ exit 1
82
83
  fi
83
84
  if [ -n "$port" ] && [ "$(wt_owner "$port")" = "$slug" ]; then
84
85
  wt_release "$port" "$slug"
@@ -758,6 +758,12 @@ if (( CHECK )); then
758
758
  else
759
759
  note " worktree tooling v${installed_wt}"
760
760
  fi
761
+ # The version is hand-maintained, so a shipped change that forgot to bump
762
+ # it would look current. Say so when the bytes differ but the numbers do not.
763
+ if [[ -n "$installed_wt" && "$installed_wt" == "$asset_wt" ]] \
764
+ && ! cmp -s "$wt_lib" "$ASSET_WORKTREE/_lib.sh"; then
765
+ note " .sassywares/worktree/_lib.sh matches v${installed_wt} but differs from the shipped copy — extended here, or the assets changed without a bump"
766
+ fi
761
767
  for helper in create list stop remove prune; do
762
768
  [[ -x "$ROOT/.sassywares/worktree/$helper" ]] \
763
769
  || bad "missing or not executable: .sassywares/worktree/$helper"