MCPcopy
hub / github.com/MiniMax-AI/cli / checkForUpdate

Function checkForUpdate

src/update/checker.ts:53–76  ·  view source on GitHub ↗
(currentVersion: string)

Source from the content-addressed store, hash-verified

51}
52
53export async function checkForUpdate(currentVersion: string): Promise<void> {
54 // Skip in CI / non-TTY environments
55 if (process.env.CI || !process.stderr.isTTY) return;
56
57 const state = readState();
58 const now = Date.now();
59
60 // Throttle: skip if checked within the last 24h
61 if (state && now - state.lastChecked < CHECK_INTERVAL_MS) {
62 if (state.latestVersion && state.latestVersion !== `v${currentVersion}`) {
63 pendingNotification = state.latestVersion;
64 }
65 return;
66 }
67
68 const latest = await fetchLatestVersion();
69 if (!latest) return;
70
71 writeState({ lastChecked: now, latestVersion: latest });
72
73 if (latest !== `v${currentVersion}`) {
74 pendingNotification = latest;
75 }
76}

Callers 1

mainFunction · 0.90

Calls 3

readStateFunction · 0.85
fetchLatestVersionFunction · 0.85
writeStateFunction · 0.85

Tested by

no test coverage detected