@codyswann/lisa 2.171.0 → 2.171.1

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.
Files changed (71) hide show
  1. package/dist/codex/scripts/install-pkgs.sh +33 -11
  2. package/dist/utils/package-manager-detect.d.ts +66 -0
  3. package/dist/utils/package-manager-detect.d.ts.map +1 -0
  4. package/dist/utils/package-manager-detect.js +109 -0
  5. package/dist/utils/package-manager-detect.js.map +1 -0
  6. package/dist/utils/postinstall-trampoline.d.ts +3 -32
  7. package/dist/utils/postinstall-trampoline.d.ts.map +1 -1
  8. package/dist/utils/postinstall-trampoline.js +22 -65
  9. package/dist/utils/postinstall-trampoline.js.map +1 -1
  10. package/package.json +1 -1
  11. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  12. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  13. package/plugins/lisa/hooks/install-pkgs.sh +34 -12
  14. package/plugins/lisa/skills/generate-claude-remote-build-script/SKILL.md +25 -3
  15. package/plugins/lisa-agy/plugin.json +1 -1
  16. package/plugins/lisa-agy/skills/generate-claude-remote-build-script/SKILL.md +25 -3
  17. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  19. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  20. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  21. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-copilot/hooks/install-pkgs.sh +34 -12
  24. package/plugins/lisa-copilot/skills/generate-claude-remote-build-script/SKILL.md +25 -3
  25. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-cursor/hooks/install-pkgs.sh +34 -12
  27. package/plugins/lisa-cursor/skills/generate-claude-remote-build-script/SKILL.md +25 -3
  28. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  30. package/plugins/lisa-expo-agy/plugin.json +1 -1
  31. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  35. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  36. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  40. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  41. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  45. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  46. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  50. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  51. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  55. package/plugins/lisa-rails-agy/plugin.json +1 -1
  56. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  60. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  61. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  65. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  66. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  68. package/plugins/src/base/hooks/install-pkgs.sh +34 -12
  69. package/plugins/src/base/skills/generate-claude-remote-build-script/SKILL.md +25 -3
  70. package/scripts/claude-remote-setup.sh +31 -3
  71. package/typescript/copy-contents/.husky/pre-push +8 -1
@@ -8,18 +8,40 @@ if [ -d "node_modules" ]; then
8
8
  exit 0
9
9
  fi
10
10
 
11
- # Detect package manager based on lock file presence
12
- if [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
13
- bun install
14
- elif [ -f "pnpm-lock.yaml" ]; then
15
- pnpm install
16
- elif [ -f "yarn.lock" ]; then
17
- yarn install
18
- elif [ -f "package-lock.json" ]; then
19
- npm install
20
- else
21
- npm install
22
- fi
11
+ # Detect the package manager this project wants, honoring explicit opt-outs.
12
+ # Precedence: packageManager field > engines "please-use-<pm>" sentinel >
13
+ # lockfile presence (minus any PM the engines forbid) > npm default.
14
+ #
15
+ # This must NOT key on lockfile presence alone. An npm-only project
16
+ # (engines.bun = "please-use-npm", CI runs `npm ci`) that picks up a stray
17
+ # bun.lock would otherwise get `bun install`, re-create the bun.lock, and break
18
+ # the SE-5221 regression. The engines/packageManager signals are
19
+ # authoritative; lockfiles are only a fallback and never override an opt-out.
20
+ detect_package_manager() {
21
+ _field="" _forced="" _forbidden=""
22
+ if [ -f package.json ] && command -v jq >/dev/null 2>&1; then
23
+ _field=$(jq -r '(.packageManager // "") | sub("@.*$";"")' package.json 2>/dev/null)
24
+ _forced=$(jq -r 'first((.engines // {})[] | strings | capture("please-use-(?<pm>bun|npm|yarn|pnpm)")?.pm) // ""' package.json 2>/dev/null)
25
+ _forbidden=$(jq -r '[(.engines // {}) | to_entries[] | select(((.value|strings) // "") | test("please-use|do-not-use";"i")) | .key] | join(" ")' package.json 2>/dev/null)
26
+ fi
27
+ case "$_field" in bun | npm | yarn | pnpm) printf '%s\n' "$_field"; return 0 ;; esac
28
+ case "$_forced" in bun | npm | yarn | pnpm) printf '%s\n' "$_forced"; return 0 ;; esac
29
+ _pm_allowed() { case " $_forbidden " in *" $1 "*) return 1 ;; *) return 0 ;; esac; }
30
+ if { [ -f bun.lockb ] || [ -f bun.lock ]; } && _pm_allowed bun; then printf 'bun\n'; return 0; fi
31
+ if [ -f pnpm-lock.yaml ] && _pm_allowed pnpm; then printf 'pnpm\n'; return 0; fi
32
+ if [ -f yarn.lock ] && _pm_allowed yarn; then printf 'yarn\n'; return 0; fi
33
+ if [ -f package-lock.json ] && _pm_allowed npm; then printf 'npm\n'; return 0; fi
34
+ printf 'npm\n'
35
+ }
36
+
37
+ PACKAGE_MANAGER="$(detect_package_manager)"
38
+ echo "Detected package manager: ${PACKAGE_MANAGER}"
39
+ case "$PACKAGE_MANAGER" in
40
+ bun) bun install ;;
41
+ pnpm) pnpm install ;;
42
+ yarn) yarn install ;;
43
+ *) npm install ;;
44
+ esac
23
45
 
24
46
  # The tools below use Linux-specific binaries and paths — skip on other platforms.
25
47
  if [ "$(uname -s)" != "Linux" ]; then
@@ -101,12 +101,34 @@ need() { command -v "$1" >/dev/null 2>&1; }
101
101
  require() { need "$1" || { echo "FATAL: required tool '$1' missing and install failed" >&2; exit 1; }; }
102
102
 
103
103
  # --- package manager (REQUIRED) ---
104
- if ! need bun; then
104
+ # Resolve the PM from packageManager/engines/lockfiles — emit the manager the
105
+ # `packageManager` inventory field reported, NEVER a hardcoded bun. An npm-only
106
+ # project (engines.bun = "please-use-npm") must install with npm; emitting
107
+ # `bun install` would create a stray bun.lock and break it (the SE-5221
108
+ # regression). Only install/PATH-export the manager actually selected below.
109
+ detect_package_manager() {
110
+ _field="" _forced="" _forbidden=""
111
+ if [ -f package.json ] && command -v jq >/dev/null 2>&1; then
112
+ _field=$(jq -r '(.packageManager // "") | sub("@.*$";"")' package.json 2>/dev/null)
113
+ _forced=$(jq -r 'first((.engines // {})[] | strings | capture("please-use-(?<pm>bun|npm|yarn|pnpm)")?.pm) // ""' package.json 2>/dev/null)
114
+ _forbidden=$(jq -r '[(.engines // {}) | to_entries[] | select(((.value|strings) // "") | test("please-use|do-not-use";"i")) | .key] | join(" ")' package.json 2>/dev/null)
115
+ fi
116
+ case "$_field" in bun | npm | yarn | pnpm) printf '%s\n' "$_field"; return 0 ;; esac
117
+ case "$_forced" in bun | npm | yarn | pnpm) printf '%s\n' "$_forced"; return 0 ;; esac
118
+ _pm_allowed() { case " $_forbidden " in *" $1 "*) return 1 ;; *) return 0 ;; esac; }
119
+ { [ -f bun.lockb ] || [ -f bun.lock ]; } && _pm_allowed bun && { printf 'bun\n'; return 0; }
120
+ [ -f pnpm-lock.yaml ] && _pm_allowed pnpm && { printf 'pnpm\n'; return 0; }
121
+ [ -f yarn.lock ] && _pm_allowed yarn && { printf 'yarn\n'; return 0; }
122
+ [ -f package-lock.json ] && _pm_allowed npm && { printf 'npm\n'; return 0; }
123
+ printf 'npm\n'
124
+ }
125
+ PM="$(detect_package_manager)"
126
+ if [ "$PM" = "bun" ] && ! need bun; then
105
127
  curl -fsSL https://bun.sh/install | bash
128
+ export PATH="$HOME/.bun/bin:$PATH"
106
129
  fi
107
- export PATH="$HOME/.bun/bin:$PATH"
108
130
  # NOTE: bun has known proxy package-fetch issues in cloud sessions; retry to survive transient proxy errors.
109
- for i in 1 2 3; do bun install && break || sleep 5; done
131
+ for i in 1 2 3; do "$PM" install && break || sleep 5; done
110
132
 
111
133
  # --- required CLIs ---
112
134
  need gh || (sudo apt-get update -y && sudo apt-get install -y gh)
@@ -80,12 +80,40 @@ fi
80
80
  require gitleaks
81
81
 
82
82
  # --- project dependencies ---
83
+ # Resolve the package manager from packageManager/engines/lockfiles rather than
84
+ # hardcoding bun: an npm-only project (engines.bun = "please-use-npm", CI runs
85
+ # `npm ci`) must install with npm, never `bun install` — which would create a
86
+ # stray bun.lock and break the project (the SE-5221 regression). jq is required
87
+ # above, so the package.json signals are always available here.
83
88
  # bun has known proxy package-fetch issues in cloud sessions; retry transient failures.
89
+ detect_package_manager() {
90
+ _field="" _forced="" _forbidden=""
91
+ if [ -f package.json ]; then
92
+ _field=$(jq -r '(.packageManager // "") | sub("@.*$";"")' package.json 2>/dev/null)
93
+ _forced=$(jq -r 'first((.engines // {})[] | strings | capture("please-use-(?<pm>bun|npm|yarn|pnpm)")?.pm) // ""' package.json 2>/dev/null)
94
+ _forbidden=$(jq -r '[(.engines // {}) | to_entries[] | select(((.value|strings) // "") | test("please-use|do-not-use";"i")) | .key] | join(" ")' package.json 2>/dev/null)
95
+ fi
96
+ case "$_field" in bun | npm | yarn | pnpm) printf '%s\n' "$_field"; return 0 ;; esac
97
+ case "$_forced" in bun | npm | yarn | pnpm) printf '%s\n' "$_forced"; return 0 ;; esac
98
+ _pm_allowed() { case " $_forbidden " in *" $1 "*) return 1 ;; *) return 0 ;; esac; }
99
+ if { [ -f bun.lockb ] || [ -f bun.lock ]; } && _pm_allowed bun; then printf 'bun\n'; return 0; fi
100
+ if [ -f pnpm-lock.yaml ] && _pm_allowed pnpm; then printf 'pnpm\n'; return 0; fi
101
+ if [ -f yarn.lock ] && _pm_allowed yarn; then printf 'yarn\n'; return 0; fi
102
+ if [ -f package-lock.json ] && _pm_allowed npm; then printf 'npm\n'; return 0; fi
103
+ printf 'npm\n'
104
+ }
105
+ PM="$(detect_package_manager)"
106
+ case "$PM" in
107
+ bun) PM_INSTALL="bun install" ;;
108
+ pnpm) PM_INSTALL="pnpm install" ;;
109
+ yarn) PM_INSTALL="yarn install" ;;
110
+ *) PM_INSTALL="npm install" ;;
111
+ esac
84
112
  if [ ! -d node_modules ]; then
85
- echo "Installing project dependencies (bun install)..."
86
- for i in 1 2 3; do bun install && break || { echo "bun install attempt $i failed; retrying..."; sleep 5; }; done
113
+ echo "Installing project dependencies (${PM_INSTALL})..."
114
+ for i in 1 2 3; do $PM_INSTALL && break || { echo "${PM_INSTALL} attempt $i failed; retrying..."; sleep 5; }; done
87
115
  fi
88
- [ -d node_modules ] || { echo "FATAL: bun install failed after retries" >&2; exit 1; }
116
+ [ -d node_modules ] || { echo "FATAL: ${PM_INSTALL} failed after retries" >&2; exit 1; }
89
117
 
90
118
  # --- OPTIONAL (only with --include-optional; dormant stacks/integrations) ---
91
119
  if [ "$INCLUDE_OPTIONAL" = "1" ]; then
@@ -150,7 +150,14 @@ else
150
150
  # `bun audit --audit-level=high --ignore ...`, parse `bun audit --json` and
151
151
  # apply the exclusion list ourselves with jq — same approach as the npm/yarn
152
152
  # paths above.
153
- AUDIT_JSON=$(bun audit --json 2>/dev/null || true)
153
+ #
154
+ # `--production` scopes the audit to production dependencies, matching the
155
+ # npm branch (`npm audit --production`) and the yarn branch
156
+ # (`yarn audit --groups dependencies`). Without it, bun audits
157
+ # devDependencies too and the gate fails on dev-only CVEs that never ship —
158
+ # the SE-5221 false positive. bun honours `--production` even though
159
+ # `bun audit --help` omits it from the flag list.
160
+ AUDIT_JSON=$(bun audit --production --json 2>/dev/null || true)
154
161
  UNFIXED_HIGH=$(echo "$AUDIT_JSON" | jq -r --arg ids "$AUDIT_EXCLUSIONS" '
155
162
  ($ids | split(" ") | map(select(length > 0))) as $ex
156
163
  | [ .[]? | .[]?