MCPcopy Index your code
hub / github.com/codeaashu/claude-code / handleShutdownRequest

Function handleShutdownRequest

src/tools/SendMessageTool/SendMessageTool.ts:268–303  ·  view source on GitHub ↗
(
  targetName: string,
  reason: string | undefined,
  context: ToolUseContext,
)

Source from the content-addressed store, hash-verified

266}
267
268async function handleShutdownRequest(
269 targetName: string,
270 reason: string | undefined,
271 context: ToolUseContext,
272): Promise<{ data: RequestOutput }> {
273 const appState = context.getAppState()
274 const teamName = getTeamName(appState.teamContext)
275 const senderName = getAgentName() || TEAM_LEAD_NAME
276 const requestId = generateRequestId('shutdown', targetName)
277
278 const shutdownMessage = createShutdownRequestMessage({
279 requestId,
280 from: senderName,
281 reason,
282 })
283
284 await writeToMailbox(
285 targetName,
286 {
287 from: senderName,
288 text: jsonStringify(shutdownMessage),
289 timestamp: new Date().toISOString(),
290 color: getTeammateColor(),
291 },
292 teamName,
293 )
294
295 return {
296 data: {
297 success: true,
298 message: `Shutdown request sent to ${targetName}. Request ID: ${requestId}`,
299 request_id: requestId,
300 target: targetName,
301 },
302 }
303}
304
305async function handleShutdownApproval(
306 requestId: string,

Callers 1

callFunction · 0.85

Calls 7

getTeamNameFunction · 0.85
getAgentNameFunction · 0.85
writeToMailboxFunction · 0.85
jsonStringifyFunction · 0.85
generateRequestIdFunction · 0.50
getTeammateColorFunction · 0.50

Tested by

no test coverage detected