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

Function getCacheSharingParams

src/commands/compact/compact.ts:250–287  ·  view source on GitHub ↗
(
  context: ToolUseContext,
  forkContextMessages: Message[],
)

Source from the content-addressed store, hash-verified

248}
249
250async function getCacheSharingParams(
251 context: ToolUseContext,
252 forkContextMessages: Message[],
253): Promise<{
254 systemPrompt: SystemPrompt
255 userContext: { [k: string]: string }
256 systemContext: { [k: string]: string }
257 toolUseContext: ToolUseContext
258 forkContextMessages: Message[]
259}> {
260 const appState = context.getAppState()
261 const defaultSysPrompt = await getSystemPrompt(
262 context.options.tools,
263 context.options.mainLoopModel,
264 Array.from(
265 appState.toolPermissionContext.additionalWorkingDirectories.keys(),
266 ),
267 context.options.mcpClients,
268 )
269 const systemPrompt = buildEffectiveSystemPrompt({
270 mainThreadAgentDefinition: undefined,
271 toolUseContext: context,
272 customSystemPrompt: context.options.customSystemPrompt,
273 defaultSystemPrompt: defaultSysPrompt,
274 appendSystemPrompt: context.options.appendSystemPrompt,
275 })
276 const [userContext, systemContext] = await Promise.all([
277 getUserContext(),
278 getSystemContext(),
279 ])
280 return {
281 systemPrompt,
282 userContext,
283 systemContext,
284 toolUseContext: context,
285 forkContextMessages,
286 }
287}
288
289

Callers 2

callFunction · 0.85
compactViaReactiveFunction · 0.85

Calls 3

keysMethod · 0.80
getSystemPromptFunction · 0.50

Tested by

no test coverage detected