MCPcopy
hub / github.com/codeaashu/claude-code / call

Function call

src/commands/release-notes/release-notes.ts:19–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17}
18
19export async function call(): Promise<LocalCommandResult> {
20 // Try to fetch the latest changelog with a 500ms timeout
21 let freshNotes: Array<[string, string[]]> = []
22
23 try {
24 const timeoutPromise = new Promise<void>((_, reject) => {
25 setTimeout(rej => rej(new Error('Timeout')), 500, reject)
26 })
27
28 await Promise.race([fetchAndStoreChangelog(), timeoutPromise])
29 freshNotes = getAllReleaseNotes(await getStoredChangelog())
30 } catch {
31 // Either fetch failed or timed out - just use cached notes
32 }
33
34 // If we have fresh notes from the quick fetch, use those
35 if (freshNotes.length > 0) {
36 return { type: 'text', value: formatReleaseNotes(freshNotes) }
37 }
38
39 // Otherwise check cached notes
40 const cachedNotes = getAllReleaseNotes(await getStoredChangelog())
41 if (cachedNotes.length > 0) {
42 return { type: 'text', value: formatReleaseNotes(cachedNotes) }
43 }
44
45 // Nothing available, show link
46 return {
47 type: 'text',
48 value: `See the full changelog at: ${CHANGELOG_URL}`,
49 }
50}
51
52

Callers

nothing calls this directly

Calls 4

fetchAndStoreChangelogFunction · 0.85
getAllReleaseNotesFunction · 0.85
getStoredChangelogFunction · 0.85
formatReleaseNotesFunction · 0.85

Tested by

no test coverage detected