()
| 68 | * This approach keeps version comparison logic simple while maintaining traceability via the SHA. |
| 69 | */ |
| 70 | export async function assertMinVersion(): Promise<void> { |
| 71 | if (process.env.NODE_ENV === 'test') { |
| 72 | return |
| 73 | } |
| 74 | |
| 75 | try { |
| 76 | const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT<{ |
| 77 | minVersion: string |
| 78 | }>('tengu_version_config', { minVersion: '0.0.0' }) |
| 79 | |
| 80 | if ( |
| 81 | versionConfig.minVersion && |
| 82 | lt(MACRO.VERSION, versionConfig.minVersion) |
| 83 | ) { |
| 84 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 85 | console.error(` |
| 86 | It looks like your version of Claude Code (${MACRO.VERSION}) needs an update. |
| 87 | A newer version (${versionConfig.minVersion} or higher) is required to continue. |
| 88 | |
| 89 | To update, please run: |
| 90 | claude update |
| 91 | |
| 92 | This will ensure you have access to the latest features and improvements. |
| 93 | `) |
| 94 | gracefulShutdownSync(1) |
| 95 | } |
| 96 | } catch (error) { |
| 97 | logError(error as Error) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Returns the maximum allowed version for the current user type. |
no test coverage detected