MCPcopy Create free account
hub / github.com/Noumena-Network/code / PromptInput

Function PromptInput

src/components/PromptInput/PromptInput.tsx:226–1733  ·  view source on GitHub ↗
({
  debug,
  ideSelection,
  toolPermissionContext,
  setToolPermissionContext,
  apiKeyStatus,
  commands,
  agents,
  isLoading,
  verbose,
  messagesRef,
  hasMessages,
  hasAssistantMessages,
  lastAssistantMessageId,
  lastApiUsageKey,
  onAutoUpdaterResult,
  autoUpdaterResult,
  input,
  onInputChange,
  mode,
  onModeChange,
  stashedPrompt,
  setStashedPrompt,
  submitCount,
  onShowMessageSelector,
  onMessageActionsEnter,
  mcpClients,
  pastedContents,
  setPastedContents,
  vimMode,
  setVimMode,
  showBashesDialog,
  setShowBashesDialog,
  onExit,
  getToolUseContext,
  onSubmit: onSubmitProp,
  onAgentSubmit,
  isSearchingHistory,
  setIsSearchingHistory,
  onDismissSideQuestion,
  isSideQuestionVisible,
  helpOpen,
  setHelpOpen,
  hasSuppressedDialogs,
  isLocalJSXCommandActive = false,
  insertTextRef,
  voiceInterimRange
}: Props)

Source from the content-addressed store, hash-verified

224const PROMPT_FOOTER_LINES = 5;
225const MIN_INPUT_VIEWPORT_LINES = 3;
226function PromptInput({
227 debug,
228 ideSelection,
229 toolPermissionContext,
230 setToolPermissionContext,
231 apiKeyStatus,
232 commands,
233 agents,
234 isLoading,
235 verbose,
236 messagesRef,
237 hasMessages,
238 hasAssistantMessages,
239 lastAssistantMessageId,
240 lastApiUsageKey,
241 onAutoUpdaterResult,
242 autoUpdaterResult,
243 input,
244 onInputChange,
245 mode,
246 onModeChange,
247 stashedPrompt,
248 setStashedPrompt,
249 submitCount,
250 onShowMessageSelector,
251 onMessageActionsEnter,
252 mcpClients,
253 pastedContents,
254 setPastedContents,
255 vimMode,
256 setVimMode,
257 showBashesDialog,
258 setShowBashesDialog,
259 onExit,
260 getToolUseContext,
261 onSubmit: onSubmitProp,
262 onAgentSubmit,
263 isSearchingHistory,
264 setIsSearchingHistory,
265 onDismissSideQuestion,
266 isSideQuestionVisible,
267 helpOpen,
268 setHelpOpen,
269 hasSuppressedDialogs,
270 isLocalJSXCommandActive = false,
271 insertTextRef,
272 voiceInterimRange
273}: Props): React.ReactNode {
274 recordRenderTrace('PromptInput');
275 // Synchronous mode ref prevents race between onChange mode switch
276 // and onSubmit reading a stale closure-captured mode variable. React
277 // may not have committed the setMode state update before Enter fires.
278 const modeRef = useRef(mode)
279 modeRef.current = mode
280 const mainLoopModel = useMainLoopModel();
281 // A local-jsx command (e.g., /mcp while agent is running) renders a full-
282 // screen dialog on top of PromptInput via the immediate-command path with
283 // shouldHidePromptInput: false. Those dialogs don't register in the overlay

Callers

nothing calls this directly

Calls 15

recordRenderTraceFunction · 0.85
useIsModalOverlayActiveFunction · 0.85
useAppStateStoreFunction · 0.85
useSetAppStateFunction · 0.85
useAppStateFunction · 0.85
useCommandQueueFunction · 0.85
isFastModeEnabledFunction · 0.85
getViewedTeammateTaskFunction · 0.85
useHistorySearchFunction · 0.85
onSubmitFunction · 0.85
getInitialPasteIdFunction · 0.85

Tested by

no test coverage detected