MCPcopy Index your code
hub / github.com/xintaofei/codeg / MessageInput

Function MessageInput

src/components/chat/message-input.tsx:472–3397  ·  view source on GitHub ↗
({
  onSend,
  placeholder,
  defaultPath,
  disabled = false,
  autoFocus = false,
  onFocus,
  className,
  isPrompting = false,
  onCancel,
  modes,
  configOptions,
  modeLoading = false,
  configOptionsLoading = false,
  selectedModeId,
  onModeChange,
  onConfigOptionChange,
  agentType,
  availableCommands,
  promptCapabilities,
  attachmentTabId,
  draftStorageKey,
  isActive = false,
  showActiveFlow = false,
  onEnqueue,
  editingItemId,
  editingDraftText,
  editingDraftBlocks,
  isEditingQueueItem = false,
  onSaveQueueEdit,
  onCancelQueueEdit,
  onForkSend,
  onAddFeedback,
  feedbackAddDisabled,
  injectContent,
  onInjectConsumed,
}: MessageInputProps)

Source from the content-addressed store, hash-verified

470}
471
472export function MessageInput({
473 onSend,
474 placeholder,
475 defaultPath,
476 disabled = false,
477 autoFocus = false,
478 onFocus,
479 className,
480 isPrompting = false,
481 onCancel,
482 modes,
483 configOptions,
484 modeLoading = false,
485 configOptionsLoading = false,
486 selectedModeId,
487 onModeChange,
488 onConfigOptionChange,
489 agentType,
490 availableCommands,
491 promptCapabilities,
492 attachmentTabId,
493 draftStorageKey,
494 isActive = false,
495 showActiveFlow = false,
496 onEnqueue,
497 editingItemId,
498 editingDraftText,
499 editingDraftBlocks,
500 isEditingQueueItem = false,
501 onSaveQueueEdit,
502 onCancelQueueEdit,
503 onForkSend,
504 onAddFeedback,
505 feedbackAddDisabled,
506 injectContent,
507 onInjectConsumed,
508}: MessageInputProps) {
509 const t = useTranslations("Folder.chat.messageInput")
510 const tQueue = useTranslations("Folder.chat.messageQueue")
511 // Kept as a separate binding from `t` so its call sites — exclusively
512 // upload / attachment toasts — read as a single coherent group when
513 // scanning the file. Same namespace, no extra runtime cost.
514 const tAttach = useTranslations("Folder.chat.messageInput")
515 const desktopMode = isDesktop()
516 // Cached for the window's lifetime: `getActiveRemoteConnectionId()` is
517 // configured once when a remote-workspace window is created and never
518 // mutates afterwards. A desktop window bound to a remote codeg-server
519 // has to behave like the web client for attachments — local OS paths
520 // would be ENOENT on the remote agent. Only the truly local desktop
521 // shows the native Paperclip picker.
522 const showNativePaperclip = useMemo(
523 () => desktopMode && getActiveRemoteConnectionId() === null,
524 [desktopMode]
525 )
526 // The `$` prefix autocomplete is Codex-only: Codex advertises very few
527 // native slash commands, so we augment the dropdown with the agent's
528 // skills read from disk. Other agents already surface their full command
529 // set through ACP `availableCommands`, so injecting skills there would

Callers

nothing calls this directly

Calls 15

useAgentSkillsFunction · 0.90
useShortcutSettingsFunction · 0.90
useBuiltInExpertsFunction · 0.90
useEnabledSkillIdsFunction · 0.90
useReferenceSearchFunction · 0.90
clearMessageInputDraftV2Function · 0.90
saveMessageInputDraftV2Function · 0.90
restoreBlocksIntoEditorFunction · 0.90
loadMessageInputDraftV2Function · 0.90
isComposerEmptyFunction · 0.90

Tested by

no test coverage detected