MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / fetchLatestVersion

Function fetchLatestVersion

apps/cli/src/update-checker.ts:75–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73}
74
75async function fetchLatestVersion(): Promise<string | null> {
76 try {
77 const resp = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}/latest`, {
78 headers: { Accept: 'application/json' },
79 signal: AbortSignal.timeout(8_000),
80 })
81 if (!resp.ok) return null
82 const data = (await resp.json()) as { version?: string }
83 return data.version || null
84 } catch {
85 return null
86 }
87}
88
89function promptUser(question: string, choices: string[]): Promise<number> {
90 return new Promise((resolve) => {

Callers 1

refreshCacheInBackgroundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected