MCPcopy Create free account
hub / github.com/codeaashu/claude-code / resolveSystemPromptSections

Function resolveSystemPromptSections

src/constants/systemPromptSections.ts:43–58  ·  view source on GitHub ↗
(
  sections: SystemPromptSection[],
)

Source from the content-addressed store, hash-verified

41 * Resolve all system prompt sections, returning prompt strings.
42 */
43export async function resolveSystemPromptSections(
44 sections: SystemPromptSection[],
45): Promise<(string | null)[]> {
46 const cache = getSystemPromptSectionCache()
47
48 return Promise.all(
49 sections.map(async s => {
50 if (!s.cacheBreak && cache.has(s.name)) {
51 return cache.get(s.name) ?? null
52 }
53 const value = await s.compute()
54 setSystemPromptSectionCacheEntry(s.name, value)
55 return value
56 }),
57 )
58}
59
60/**
61 * Clear all system prompt section state. Called on /clear and /compact.

Callers 1

getSystemPromptFunction · 0.85

Calls 4

getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected