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

Function handlePromptSubmit

src/utils/handlePromptSubmit.ts:120–387  ·  view source on GitHub ↗
(
  params: HandlePromptSubmitParams,
)

Source from the content-addressed store, hash-verified

118}
119
120export async function handlePromptSubmit(
121 params: HandlePromptSubmitParams,
122): Promise<void> {
123 const {
124 helpers,
125 queryGuard,
126 isExternalLoading = false,
127 commands,
128 onInputChange,
129 setPastedContents,
130 setToolJSX,
131 getToolUseContext,
132 messages,
133 mainLoopModel,
134 ideSelection,
135 setUserInputOnProcessing,
136 setAbortController,
137 onQuery,
138 setAppState,
139 onBeforeQuery,
140 canUseTool,
141 queuedCommands,
142 uuid,
143 skipSlashCommands,
144 } = params
145
146 const { setCursorOffset, clearBuffer, resetHistory } = helpers
147
148 // Queue processor path: commands are pre-validated and ready to execute.
149 // Skip all input validation, reference parsing, and queuing logic.
150 if (queuedCommands?.length) {
151 startQueryProfile()
152 await executeUserInput({
153 queuedCommands,
154 messages,
155 mainLoopModel,
156 ideSelection,
157 querySource: params.querySource,
158 commands,
159 queryGuard,
160 setToolJSX,
161 getToolUseContext,
162 setUserInputOnProcessing,
163 setAbortController,
164 onQuery,
165 setAppState,
166 onBeforeQuery,
167 resetHistory,
168 canUseTool,
169 onInputChange,
170 })
171 return
172 }
173
174 const input = params.input ?? ''
175 const mode = params.mode ?? 'prompt'
176 const rawPastedContents = params.pastedContents ?? {}
177

Callers 1

REPLFunction · 0.85

Calls 15

startQueryProfileFunction · 0.85
executeUserInputFunction · 0.85
parseReferencesFunction · 0.85
expandPastedTextRefsFunction · 0.85
logEventFunction · 0.85
isCommandEnabledFunction · 0.85
createAbortControllerFunction · 0.85
logForDebuggingFunction · 0.85
enqueueFunction · 0.85
entriesMethod · 0.80
valuesMethod · 0.80
loadMethod · 0.80

Tested by

no test coverage detected