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

Function createPermissionResponseMessage

src/utils/teammateMailbox.ts:512–536  ·  view source on GitHub ↗
(params: {
  request_id: string
  subtype: 'success' | 'error'
  error?: string
  updated_input?: Record<string, unknown>
  permission_updates?: unknown[]
})

Source from the content-addressed store, hash-verified

510 * Creates a permission response message to send back to a worker
511 */
512export function createPermissionResponseMessage(params: {
513 request_id: string
514 subtype: 'success' | 'error'
515 error?: string
516 updated_input?: Record<string, unknown>
517 permission_updates?: unknown[]
518}): PermissionResponseMessage {
519 if (params.subtype === 'error') {
520 return {
521 type: 'permission_response',
522 request_id: params.request_id,
523 subtype: 'error',
524 error: params.error || 'Permission denied',
525 }
526 }
527 return {
528 type: 'permission_response',
529 request_id: params.request_id,
530 subtype: 'success',
531 response: {
532 updated_input: params.updated_input,
533 permission_updates: params.permission_updates,
534 },
535 }
536}
537
538/**
539 * Checks if a message text contains a permission request

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected