squadrant 0.11.2 → 0.12.0

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,7 +1,7 @@
1
1
  {
2
2
  "name": "squadrant",
3
3
  "packageManager": "pnpm@10.30.3",
4
- "version": "0.11.2",
4
+ "version": "0.12.0",
5
5
  "description": "Multi-project orchestration for your coding agents (Claude, Codex, opencode, Gemini)",
6
6
  "type": "module",
7
7
  "bin": {
@@ -1,18 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
  # Regenerate the codex app-server protocol bindings.
3
3
  # Requires codex-cli ≥0.130.0 on PATH.
4
+ # Output goes to vendor/ (outside src/) so tsc/tsup and GitNexus skip it.
4
5
  set -euo pipefail
5
- OUT="src/control/codex/protocol"
6
+ OUT="packages/agents/vendor/codex-protocol"
6
7
  rm -rf "$OUT"
7
8
  mkdir -p "$OUT"
8
9
  codex app-server generate-ts --experimental --out "$OUT"
9
- cat > "$OUT/README.md" <<'MD'
10
- # codex app-server protocol bindings (auto-generated)
11
-
12
- Generated by `npm run codex:gen-types` (`scripts/gen-codex-types.sh`).
13
- **DO NOT EDIT BY HAND.** Re-run the generator to update.
14
-
15
- Source: `codex app-server generate-ts --experimental --out <here>` against
16
- `codex-cli ≥0.130.0`. See `docs/specs/2026-05-20-squadrant-interactive-codex-design.md` §3.3.
17
- MD
18
10
  echo "Generated $OUT"
@@ -223,30 +223,56 @@ else
223
223
  note "no $CLAUDE_PROJECTS dir — skipping session/memory preservation"
224
224
  fi
225
225
 
226
- step "4.6 Rewrite stale 'cockpit crew _hook' commands in Claude Code settings files"
227
- # The hook-generation source already emits `squadrant crew _hook`, but settings
228
- # files written on disk BEFORE the rebrand still invoke the removed `cockpit`
229
- # binary, so every Stop/PostToolUse hook in the captain (and any pre-rebrand crew)
230
- # fails with "cockpit: command not found". Rewrite the command token in place.
231
- # Scoped to the leading "cockpit crew _hook" so permission patterns like
226
+ step "4.6 Rewrite stale 'cockpit' tokens in Claude Code settings files (this repo, global ~/.claude, AND every registered project)"
227
+ # Settings files written on disk BEFORE the rebrand still invoke the removed
228
+ # `cockpit` binary every Stop/PostToolUse hook fails "cockpit: command not
229
+ # found" and reference old ~/.config/cockpit script paths and the cockpit-hub
230
+ # vault in permission allowlists. Rewrite three exact tokens in place:
231
+ # cockpit crew _hook -> squadrant crew _hook (the failing hook command)
232
+ # .config/cockpit -> .config/squadrant (write-status/read-handoff paths)
233
+ # cockpit-hub -> squadrant-hub (spoke-vault Read allowlist)
234
+ # Token-scoped (NOT a blanket cockpit->squadrant) so unrelated patterns like
232
235
  # Bash(cockpit:*) are left untouched. Idempotent (a second run matches nothing).
233
- HOOK_SETTINGS=(
234
- "$NEW_REPO/.claude/settings.json"
235
- "$NEW_REPO/.claude/settings.local.json"
236
- "$HOME/.claude/settings.json"
237
- "$HOME/.claude/settings.local.json"
238
- )
239
- hooks_fixed=0
240
- for sf in "${HOOK_SETTINGS[@]}"; do
241
- [ -f "$sf" ] || continue
242
- if grep -q 'cockpit crew _hook' "$sf" 2>/dev/null; then
243
- run "sed -i '' 's/cockpit crew _hook/squadrant crew _hook/g' '$sf'"
244
- hooks_fixed=$((hooks_fixed + 1))
245
- else
246
- note "ok (no stale hook): $sf"
247
- fi
248
- done
249
- note "$([ "$DRY_RUN" -eq 1 ] && echo 'would rewrite' || echo 'rewrote') hook command in $hooks_fixed settings file(s)"
236
+ # Earlier versions swept only this repo + global ~/.claude and ORPHANED every
237
+ # registered project, so the per-project files are read from config.json here.
238
+ CFG_FOR_HOOKS="$NEW_CONFIG/config.json"; [ -f "$CFG_FOR_HOOKS" ] || CFG_FOR_HOOKS="$OLD_CONFIG/config.json"
239
+ DRY_RUN="$DRY_RUN" NEW_REPO="$NEW_REPO" HOME_DIR="$HOME" CFG="$CFG_FOR_HOOKS" python3 - <<'PY'
240
+ import json, os
241
+ dry = os.environ["DRY_RUN"] == "1"
242
+ repo, home, cfg = os.environ["NEW_REPO"], os.environ["HOME_DIR"], os.environ["CFG"]
243
+ SUBS = [("cockpit crew _hook", "squadrant crew _hook"),
244
+ (".config/cockpit", ".config/squadrant"),
245
+ ("cockpit-hub", "squadrant-hub")]
246
+ files = [f"{repo}/.claude/settings.json", f"{repo}/.claude/settings.local.json",
247
+ f"{home}/.claude/settings.json", f"{home}/.claude/settings.local.json"]
248
+ if os.path.isfile(cfg):
249
+ try:
250
+ for p in json.load(open(cfg)).get("projects", {}).values():
251
+ path = p.get("path") if isinstance(p, dict) else None
252
+ if path:
253
+ files.append(os.path.join(path, ".claude", "settings.json"))
254
+ files.append(os.path.join(path, ".claude", "settings.local.json"))
255
+ except (ValueError, OSError) as e:
256
+ print(f" · could not read registered projects from {cfg}: {e}")
257
+ fixed = 0
258
+ for f in files:
259
+ if not os.path.isfile(f):
260
+ continue
261
+ text = open(f, encoding="utf-8").read()
262
+ if "cockpit" not in text:
263
+ continue
264
+ new = text
265
+ for a, b in SUBS:
266
+ new = new.replace(a, b)
267
+ if new == text:
268
+ continue
269
+ print(f" $ {'would rewrite' if dry else 'rewrite'} {f}")
270
+ if not dry:
271
+ json.loads(new) # guard: only write back valid JSON
272
+ open(f, "w", encoding="utf-8").write(new)
273
+ fixed += 1
274
+ print(f" · {'would rewrite' if dry else 'rewrote'} cockpit tokens in {fixed} settings file(s)")
275
+ PY
250
276
 
251
277
  step "5. Remove old launchd plist (the rebuilt daemon installs com.squadrant.daemon.plist on first run)"
252
278
  [ -f "$OLD_PLIST" ] && run "rm -f '$OLD_PLIST'" || note "old plist absent"