* Display the update plan showing which tools need updating.
(
toolsToUpdate: string[],
statusByTool: Map<string, ToolVersionStatus>,
upToDate: ToolVersionStatus[]
)
| 311 | * Display the update plan showing which tools need updating. |
| 312 | */ |
| 313 | private displayUpdatePlan( |
| 314 | toolsToUpdate: string[], |
| 315 | statusByTool: Map<string, ToolVersionStatus>, |
| 316 | upToDate: ToolVersionStatus[] |
| 317 | ): void { |
| 318 | const updates = toolsToUpdate.map((toolId) => { |
| 319 | const status = statusByTool.get(toolId); |
| 320 | if (status?.needsUpdate) { |
| 321 | const fromVersion = status.generatedByVersion ?? 'unknown'; |
| 322 | return `${status.toolId} (${fromVersion} → ${OPENSPEC_VERSION})`; |
| 323 | } |
| 324 | return `${toolId} (config sync)`; |
| 325 | }); |
| 326 | |
| 327 | console.log(`Updating ${toolsToUpdate.length} tool(s): ${updates.join(', ')}`); |
| 328 | |
| 329 | if (upToDate.length > 0) { |
| 330 | const upToDateNames = upToDate.map((s) => s.toolId); |
| 331 | console.log(chalk.dim(`Already up to date: ${upToDateNames.join(', ')}`)); |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | /** |
| 336 | * Detects new tool directories that aren't currently configured and displays a hint. |