MCPcopy
hub / github.com/CodebuffAI/codebuff / PublishContainer

Function PublishContainer

cli/src/components/publish-container.tsx:29–687  ·  view source on GitHub ↗
({
  inputRef,
  onExitPublish,
  onPublish,
  width,
})

Source from the content-addressed store, hash-verified

27}
28
29export const PublishContainer: React.FC<PublishContainerProps> = ({
30 inputRef,
31 onExitPublish,
32 onPublish,
33 width,
34}) => {
35 const theme = useTheme()
36 const { width: widthLayout, height: heightLayout } = useTerminalLayout()
37 const isTooSmall = widthLayout.atMost('xs') || heightLayout.atMost('xs')
38 const [closeButtonHovered, setCloseButtonHovered] = useState(false)
39 const [nextButtonHovered, setNextButtonHovered] = useState(false)
40 const [backButtonHovered, setBackButtonHovered] = useState(false)
41 const [publishButtonHovered, setPublishButtonHovered] = useState(false)
42
43 const {
44 publishMode,
45 selectedAgentIds,
46 searchQuery,
47 currentStep,
48 focusedIndex,
49 isPublishing,
50 successResult,
51 errorResult,
52 includeDependents,
53 toggleAgentSelection,
54 setSearchQuery,
55 goToConfirmation,
56 goBackToSelection,
57 setFocusedIndex,
58 closePublish,
59 setIncludeDependents,
60 } = usePublishStore(
61 useShallow((state) => ({
62 publishMode: state.publishMode,
63 selectedAgentIds: state.selectedAgentIds,
64 searchQuery: state.searchQuery,
65 currentStep: state.currentStep,
66 focusedIndex: state.focusedIndex,
67 isPublishing: state.isPublishing,
68 successResult: state.successResult,
69 errorResult: state.errorResult,
70 includeDependents: state.includeDependents,
71 toggleAgentSelection: state.toggleAgentSelection,
72 setSearchQuery: state.setSearchQuery,
73 goToConfirmation: state.goToConfirmation,
74 goBackToSelection: state.goBackToSelection,
75 setFocusedIndex: state.setFocusedIndex,
76 closePublish: state.closePublish,
77 setIncludeDependents: state.setIncludeDependents,
78 })),
79 )
80
81 const inputFocused = useChatStore((state) => state.inputFocused)
82
83 // Load agents data - filter out bundled agents (they shouldn't be publishable by users)
84 const agents = useMemo(() => loadLocalAgents().filter(a => !a.isBundled), [])
85 const agentDefinitions = useMemo(() => {
86 const defs = loadAgentDefinitions()

Callers

nothing calls this directly

Calls 9

useThemeFunction · 0.90
useTerminalLayoutFunction · 0.90
loadLocalAgentsFunction · 0.90
loadAgentDefinitionsFunction · 0.90
isPlainEnterKeyFunction · 0.90
getAllPublishAgentIdsFunction · 0.90
pluralizeFunction · 0.90
setMethod · 0.80
onMethod · 0.65

Tested by

no test coverage detected