({
inputRef,
onExitPublish,
onPublish,
width,
})
| 27 | } |
| 28 | |
| 29 | export 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() |
nothing calls this directly
no test coverage detected