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

Function resolveUpdateTarget

src/update/self-update.ts:132–147  ·  view source on GitHub ↗
(channel: Channel)

Source from the content-addressed store, hash-verified

130}
131
132export async function resolveUpdateTarget(channel: Channel): Promise<UpdateTarget> {
133 const platform = await detectPlatform();
134 const version = await resolveVersion(channel);
135 const manifest = await fetchManifest(version);
136
137 const entry = manifest.platforms[platform];
138 if (!entry) {
139 throw new CLIError(
140 `Platform "${platform}" not found in manifest for ${version}.`,
141 ExitCode.GENERAL,
142 );
143 }
144
145 const downloadUrl = `https://github.com/${REPO}/releases/download/${version}/mmx-${platform}`;
146 return { version, downloadUrl, checksum: entry.checksum };
147}
148
149export async function applySelfUpdate(target: UpdateTarget, currentBin: string): Promise<void> {
150 const tmp = join(tmpdir(), `mmx-update-${Date.now()}`);

Callers

nothing calls this directly

Calls 3

detectPlatformFunction · 0.85
resolveVersionFunction · 0.85
fetchManifestFunction · 0.85

Tested by

no test coverage detected