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

Function handlePromptSubmit

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

Source from the content-addressed store, hash-verified

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

Callers 2

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
entriesMethod · 0.80
loadMethod · 0.80
callMethod · 0.80
exitFunction · 0.70
logForDebuggingFunction · 0.70

Tested by

no test coverage detected