()
| 342 | } |
| 343 | |
| 344 | export async function checkGroveForNonInteractive(): Promise<void> { |
| 345 | const [settingsResult, configResult] = await Promise.all([ |
| 346 | getGroveSettings(), |
| 347 | getGroveNoticeConfig(), |
| 348 | ]) |
| 349 | |
| 350 | // Check if user hasn't made a choice yet (returns false on API failure) |
| 351 | const shouldShowGrove = calculateShouldShowGrove( |
| 352 | settingsResult, |
| 353 | configResult, |
| 354 | false, |
| 355 | ) |
| 356 | |
| 357 | if (shouldShowGrove) { |
| 358 | // shouldShowGrove is only true if both API calls succeeded |
| 359 | const config = configResult.success ? configResult.data : null |
| 360 | logEvent('ncode_grove_print_viewed', { |
| 361 | dismissable: |
| 362 | config?.notice_is_grace_period as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 363 | }) |
| 364 | if (config === null || config.notice_is_grace_period) { |
| 365 | // Grace period is still active - show informational message and continue |
| 366 | writeToStderr( |
| 367 | '\nAn update to our Terms of Service and Privacy Policy will take effect on October 8, 2025. Run `ncode` to review the updated terms.\n\n', |
| 368 | ) |
| 369 | await markGroveNoticeViewed() |
| 370 | } else { |
| 371 | // Grace period has ended - show error message and exit |
| 372 | writeToStderr( |
| 373 | '\n[ACTION REQUIRED] An update to our Terms of Service and Privacy Policy has taken effect on October 8, 2025. You must run `ncode` to review the updated terms.\n\n', |
| 374 | ) |
| 375 | await gracefulShutdown(1) |
| 376 | } |
| 377 | } |
| 378 | } |
no test coverage detected