Skip to content

feat(cli): update notifier (v2.1.0 minor)#89

Merged
samuelds merged 5 commits into
developfrom
feat/update-notifier
Apr 29, 2026
Merged

feat(cli): update notifier (v2.1.0 minor)#89
samuelds merged 5 commits into
developfrom
feat/update-notifier

Conversation

@samuelds
Copy link
Copy Markdown
Contributor

Summary

  • Adds src/commands/check-updates.ts — new module with:
    • shouldSkipUpdateCheck() — skip logic (TTY, env var, flag, update commands)
    • formatUpdateWarning() — formats the ⚠ Update available message
    • runUpdateCheck() — fire-and-forget, called before each CLI command
    • checkUpdatesCommand() — pure output for the focus_check_updates MCP tool
  • Modifies src/bin/focus.ts — calls runUpdateCheck() before command dispatch, adds --no-update-check global flag
  • Modifies src/commands/start.ts — adds focus_check_updates MCP tool + runUpdateCheck() on server start
  • Bumps @focus-mcp/core devDep to ^1.4.0 (depends on feat(core): add update-checker module (v1.4.0 minor) core#58)

Skip conditions

  • FOCUS_NO_UPDATE_NOTIFY=1 env var
  • --no-update-check CLI flag
  • stdout is not a TTY (piped output)
  • Command is update, upgrade, or self-update (avoids recursion)

MCP tool

focus_check_updates { include_cli?, include_bricks? } — agents can call this explicitly.

Test plan

  • 22 unit tests — 100% pass
  • Coverage: 100% on check-updates.ts
  • All 289 CLI tests pass
  • TypeScript: 3 expected errors for @focus-mcp/core ^1.4.0 missing exports (will resolve when core PR merges)

Dependencies

Requires focus-mcp/core#58 (feat/update-checker) to be released as core 1.4.0 before merging.

Release order:

  1. Merge and release focus-mcp/core#58 → core 1.4.0
  2. Merge this PR → cli 2.1.0

🤖 Generated with Claude Code

claude and others added 5 commits April 28, 2026 21:52
…thin wrapper

Required for focus_update + focus_upgrade MCP tools (thin wrapper depends on
executeUpgrade exported from @focus-mcp/core 1.2.0).
…vailable

- New `src/commands/check-updates.ts`: shouldSkipUpdateCheck, formatUpdateWarning,
  runUpdateCheck (fire-and-forget), checkUpdatesCommand (MCP tool)
- `src/bin/focus.ts`: import runUpdateCheck, call before dispatch, add --no-update-check
  global flag and FOCUS_NO_UPDATE_NOTIFY env var doc
- `src/commands/start.ts`: focus_check_updates MCP tool + runUpdateCheck on server start
- Skip conditions: TTY off, FOCUS_NO_UPDATE_NOTIFY=1, --no-update-check, update/upgrade cmds
- Bump @focus-mcp/core devDep to ^1.4.0 (requires feat/update-checker PR)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…or update-checker

- Merge origin/develop (2.0.0) into feat/update-notifier
- Resolve conflicts: CHANGELOG.md, package.json, src/bin/focus.ts, src/commands/start.ts
- Keep version 2.0.0 from develop, core dep ^1.4.0 from update-notifier branch
- Add src/commands/check-updates-io.ts: makeNodeIO() Node.js adapter for UpdateCheckIO
- Inject io: makeNodeIO() in all checkForUpdates() calls (core 1.4.0 API requires io)
- Add src/commands/check-updates-io.test.ts: 21 tests, 100% coverage, no v8 ignore
- Update start.test.ts: expect 20 meta tools (add focus_check_updates)
- Update check-updates.test.ts: mock check-updates-io.ts makeNodeIO
- Use core 1.4.0-dev tag until stable release

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@samuelds samuelds merged commit 422cb46 into develop Apr 29, 2026
8 checks passed
@samuelds samuelds deleted the feat/update-notifier branch April 30, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant