feat: install.sh + auto-update checker for CLI

- tools/install.sh: standalone installer/upgrader, curl-pipe safe
  (main() wrapper, process.argv instead of stdin, mkdir -p prefix)
- packages/mosaic/src/runtime/update-checker.ts: version check module
  with 1h cache at ~/.cache/mosaic/update-check.json
- CLI startup: non-blocking background update check on every invocation
- 'mosaic update' command: explicit check + install (--check for CI)
- session-start.sh: warns agents when CLI is outdated
- Proper semver comparison including pre-release precedence
- eslint: allow __tests__ in packages/mosaic for projectService
This commit is contained in:
Jarvis
2026-04-01 21:03:23 -05:00
parent 147f5f1bec
commit 45f5b9062e
7 changed files with 584 additions and 0 deletions

View File

@@ -8,6 +8,18 @@ source "$SCRIPT_DIR/common.sh"
ensure_repo_root
load_repo_hooks
# ─── Update check (non-blocking) ────────────────────────────────────────────
if command -v mosaic &>/dev/null; then
if mosaic update --check 2>/dev/null; then
: # up to date
elif [[ $? -eq 2 ]]; then
echo ""
echo "[agent-framework] ⚠ A newer version of Mosaic CLI is available."
echo "[agent-framework] Run: mosaic update or bash tools/install.sh"
echo ""
fi
fi
if git rev-parse --is-inside-work-tree >/dev/null 2>&1 && has_remote; then
if git diff --quiet && git diff --cached --quiet; then
run_step "Pull latest changes" git pull --rebase