MCPcopy Index your code
hub / github.com/ChinaSiro/claude-code-sourcemap / cN6

Function cN6

package/cli.js:2038–2038  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2036Resume this session with:
2037claude --resume ${_}
2038`)),xx4=!0}catch{}}function xF1(q){if(qs6!==void 0)clearTimeout(qs6),qs6=void 0;try{VA.get(process.stdout)?.drainStdin()}catch{}try{process.exit(q)}catch(K){process.kill(process.pid,"SIGKILL")}throw Error("unreachable")}function eK(q=0,K="other",_){process.exitCode=q,RMz=xK(q,K,_).catch((z)=>{N(`Graceful shutdown failed: ${z}`,{level:"error"}),CF1(),bF1(),xF1(q)}).catch(()=>{})}function gL8(){return IF1}async function xK(q=0,K="other",_){if(IF1)return;IF1=!0;let{executeSessionEndHooks:z,getSessionEndHookTimeoutMs:Y}=await Promise.resolve().then(() => (y$(),FL8)),$=Y();qs6=setTimeout((w)=>{CF1(),bF1(),xF1(w)},Math.max(5000,$+3500),q),qs6.unref(),process.exitCode=q,CF1(),bF1();let A;try{let w=(async()=>{try{await xj7()}catch{}})();await Promise.race([w,new Promise((j,H)=>{A=setTimeout((J)=>J(new ux4),2000,H)})]),clearTimeout(A)}catch{clearTimeout(A)}try{await z(K,{..._,signal:AbortSignal.timeout($),timeoutMs:$})}catch{}try{zI6()}catch{}let O=ub6();if(O)d("tengu_cache_eviction_hint",{scope:"session_end",last_request_id:O});try{await Promise.race([Promise.all([ji(),T16()]),R7(500)])}catch{}if(_?.finalMessage)try{eC(2,_.finalMessage+`
2039`)}catch{}xF1(q)}var xx4=!1,Ix4,IF1=!1,qs6,SF1,RMz,ux4;var RA=y(()=>{x3();F4();dm6();v8();QV();dS();p16();YM();sG6();Hi();k8();c9();_8();oY();m8();_K();Cx();Ix4=_1(()=>{if(Le(()=>{}),process.on("SIGINT",()=>{if(process.argv.includes("-p")||process.argv.includes("--print"))return;c8("info","shutdown_signal",{signal:"SIGINT"}),xK(0)}),process.on("SIGTERM",()=>{c8("info","shutdown_signal",{signal:"SIGTERM"}),xK(143)}),process.platform!=="win32"){if(process.on("SIGHUP",()=>{c8("info","shutdown_signal",{signal:"SIGHUP"}),xK(129)}),process.stdin.isTTY)SF1=setInterval(()=>{if(r36())return;if(!process.stdout.writable||!process.stdin.readable)clearInterval(SF1),c8("info","shutdown_signal",{signal:"orphan_detected"}),xK(129)},30000),SF1.unref()}process.on("uncaughtException",(q)=>{c8("error","uncaught_exception",{error_name:q.name,error_message:q.message.slice(0,2000)}),d("tengu_uncaught_exception",{error_name:q.name})}),process.on("unhandledRejection",(q)=>{let K=q instanceof Error?q.name:typeof q==="string"?"string":"unknown",_=q instanceof Error?{error_name:q.name,error_message:q.message.slice(0,2000),error_stack:q.stack?.slice(0,4000)}:{error_message:String(q).slice(0,2000)};c8("error","unhandled_rejection",_),d("tengu_unhandled_rejection",{error_name:K})})});ux4=class ux4 extends Error{constructor(){super("Cleanup timeout")}}});async function uF1(){try{await Ki(()=>{let q=DJ();if(q.error)throw Error(`Failed to get auth headers: ${q.error}`);return $1.post(`${u7().BASE_API_URL}/api/oauth/account/grove_notice_viewed`,{},{headers:{...q.headers,"User-Agent":n$()}})}),Hm.cache.clear?.()}catch(q){H6(q)}}async function UL8(q){try{await Ki(()=>{let K=DJ();if(K.error)throw Error(`Failed to get auth headers: ${K.error}`);return $1.patch(`${u7().BASE_API_URL}/api/oauth/account/settings`,{grove_enabled:q},{headers:{...K.headers,"User-Agent":n$()}})}),Hm.cache.clear?.()}catch(K){H6(K)}}async function cN6(){if(!sd6())return!1;let q=B_()?.accountUuid;if(!q)return!1;let _=j8().groveConfigCache?.[q],z=Date.now();if(!_)return N("Grove: No cache, fetching config in background (dialog skipped this session)"),mx4(q),!1;if(z-_.timestamp>px4)return N("Grove: Cache stale, returning cached data and refreshing in background"),mx4(q),_.grove_enabled;return N("Grove: Using fresh cached config"),_.grove_enabled}async function mx4(q){try{let K=await K46();if(!K.success)return;let _=K.data.grove_enabled,z=j8().groveConfigCache?.[q];if(z?.grove_enabled===_&&Date.now()-z.timestamp<=px4)return;b8((Y)=>({...Y,groveConfigCache:{...Y.groveConfigCache,[q]:{grove_enabled:_,timestamp:Date.now()}}}))}catch(K){N(`Grove: Failed to fetch and store config: ${K}`)}}function mF1(q,K,_){if(!q.success||!K.success)return!1;let z=q.data,Y=K.data;if(z.grove_enabled!==null)return!1;if(_)return!0;if(!Y.notice_is_grace_period)return!0;let A=Y.notice_reminder_frequency;if(A!==null&&z.grove_notice_viewed_at)return Math.floor((Date.now()-new Date(z.grove_notice_viewed_at).getTime())/86400000)>=A;else{let O=z.grove_notice_viewed_at;return O===null||O===void 0}}async function Bx4(){let[q,K]=await Promise.all([Hm(),K46()]);if(mF1(q,K,!1)){let z=K.success?K.data:null;if(d("tengu_grove_print_viewed",{dismissable:z?.notice_is_grace_period}),z===null||z.notice_is_grace_period)bc(`
2040An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run \`claude\` to review the updated terms.
2041

Callers 3

IvYFunction · 0.85
reKFunction · 0.85
_aYFunction · 0.85

Calls 6

sd6Function · 0.85
B_Function · 0.85
j8Function · 0.85
NFunction · 0.85
mx4Function · 0.85
nowMethod · 0.80

Tested by

no test coverage detected