MCPcopy Index your code
hub / github.com/codeaashu/claude-code / checkGroveForNonInteractive

Function checkGroveForNonInteractive

src/services/api/grove.ts:323–357  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321}
322
323export async function checkGroveForNonInteractive(): Promise<void> {
324 const [settingsResult, configResult] = await Promise.all([
325 getGroveSettings(),
326 getGroveNoticeConfig(),
327 ])
328
329 // Check if user hasn't made a choice yet (returns false on API failure)
330 const shouldShowGrove = calculateShouldShowGrove(
331 settingsResult,
332 configResult,
333 false,
334 )
335
336 if (shouldShowGrove) {
337 // shouldShowGrove is only true if both API calls succeeded
338 const config = configResult.success ? configResult.data : null
339 logEvent('tengu_grove_print_viewed', {
340 dismissable:
341 config?.notice_is_grace_period as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
342 })
343 if (config === null || config.notice_is_grace_period) {
344 // Grace period is still active - show informational message and continue
345 writeToStderr(
346 '\nAn update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run `claude` to review the updated terms.\n\n',
347 )
348 await markGroveNoticeViewed()
349 } else {
350 // Grace period has ended - show error message and exit
351 writeToStderr(
352 '\n[ACTION REQUIRED] An update to our Consumer Terms and Privacy Policy has taken effect on October 8, 2025. You must run `claude` to review the updated terms.\n\n',
353 )
354 await gracefulShutdown(1)
355 }
356 }
357}
358

Callers 1

runHeadlessFunction · 0.85

Calls 5

calculateShouldShowGroveFunction · 0.85
logEventFunction · 0.85
writeToStderrFunction · 0.85
markGroveNoticeViewedFunction · 0.85
gracefulShutdownFunction · 0.85

Tested by

no test coverage detected