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

Function processUserInput

src/utils/processUserInput/processUserInput.ts:85–270  ·  view source on GitHub ↗
({
  input,
  preExpansionInput,
  mode,
  setToolJSX,
  context,
  pastedContents,
  ideSelection,
  messages,
  setUserInputOnProcessing,
  uuid,
  isAlreadyProcessing,
  querySource,
  canUseTool,
  skipSlashCommands,
  bridgeOrigin,
  isMeta,
  skipAttachments,
}: {
  input: string | Array<ContentBlockParam>
  /**
   * Input before [Pasted text #N] expansion. Used for ultraplan keyword
   * detection so pasted content containing the word cannot trigger. Falls
   * back to the string `input` when unset.
   */
  preExpansionInput?: string
  mode: PromptInputMode
  setToolJSX: SetToolJSXFn
  context: ProcessUserInputContext
  pastedContents?: Record<number, PastedContent>
  ideSelection?: IDESelection
  messages?: Message[]
  setUserInputOnProcessing?: (prompt?: string) => void
  uuid?: string
  isAlreadyProcessing?: boolean
  querySource?: QuerySource
  canUseTool?: CanUseToolFn
  /**
   * When true, input starting with `/` is treated as plain text.
   * Used for remotely-received messages (bridge/CCR) that should not
   * trigger local slash commands or skills.
   */
  skipSlashCommands?: boolean
  /**
   * When true, slash commands matching isBridgeSafeCommand() execute even
   * though skipSlashCommands is set. See QueuedCommand.bridgeOrigin.
   */
  bridgeOrigin?: boolean
  /**
   * When true, the resulting UserMessage gets `isMeta: true` (user-hidden,
   * model-visible). Propagated from `QueuedCommand.isMeta` for queued
   * system-generated prompts.
   */
  isMeta?: boolean
  skipAttachments?: boolean
})

Source from the content-addressed store, hash-verified

83}
84
85export async function processUserInput({
86 input,
87 preExpansionInput,
88 mode,
89 setToolJSX,
90 context,
91 pastedContents,
92 ideSelection,
93 messages,
94 setUserInputOnProcessing,
95 uuid,
96 isAlreadyProcessing,
97 querySource,
98 canUseTool,
99 skipSlashCommands,
100 bridgeOrigin,
101 isMeta,
102 skipAttachments,
103}: {
104 input: string | Array<ContentBlockParam>
105 /**
106 * Input before [Pasted text #N] expansion. Used for ultraplan keyword
107 * detection so pasted content containing the word cannot trigger. Falls
108 * back to the string `input` when unset.
109 */
110 preExpansionInput?: string
111 mode: PromptInputMode
112 setToolJSX: SetToolJSXFn
113 context: ProcessUserInputContext
114 pastedContents?: Record<number, PastedContent>
115 ideSelection?: IDESelection
116 messages?: Message[]
117 setUserInputOnProcessing?: (prompt?: string) => void
118 uuid?: string
119 isAlreadyProcessing?: boolean
120 querySource?: QuerySource
121 canUseTool?: CanUseToolFn
122 /**
123 * When true, input starting with `/` is treated as plain text.
124 * Used for remotely-received messages (bridge/CCR) that should not
125 * trigger local slash commands or skills.
126 */
127 skipSlashCommands?: boolean
128 /**
129 * When true, slash commands matching isBridgeSafeCommand() execute even
130 * though skipSlashCommands is set. See QueuedCommand.bridgeOrigin.
131 */
132 bridgeOrigin?: boolean
133 /**
134 * When true, the resulting UserMessage gets `isMeta: true` (user-hidden,
135 * model-visible). Propagated from `QueuedCommand.isMeta` for queued
136 * system-generated prompts.
137 */
138 isMeta?: boolean
139 skipAttachments?: boolean
140}): Promise<ProcessUserInputBaseResult> {
141 const inputString = typeof input === 'string' ? input : null
142 // Immediately show the user input prompt while we are still processing the input.

Callers 2

submitMessageMethod · 0.85
executeUserInputFunction · 0.85

Calls 10

queryCheckpointFunction · 0.85
processUserInputBaseFunction · 0.85
getContentTextFunction · 0.85
createSystemMessageFunction · 0.85
createUserMessageFunction · 0.85
createAttachmentMessageFunction · 0.85
applyTruncationFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected