( params: HandlePromptSubmitParams, )
| 118 | } |
| 119 | |
| 120 | export 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 |
no test coverage detected