diff --git a/apps/web/components/settings/company-brain-connections.tsx b/apps/web/components/settings/company-brain-connections.tsx index 24819c73..07a5e817 100644 --- a/apps/web/components/settings/company-brain-connections.tsx +++ b/apps/web/components/settings/company-brain-connections.tsx @@ -67,7 +67,7 @@ function slugifyMcpName(value: string) { } function customConnectionName(slug: string) { - return titleCase(slug.replace(/-dir-[a-z0-9]{6}$/, "").replace(/-/g, " ")) + return titleCase(slug.replace(/-sm-dir-[a-z0-9]{6}$/, "").replace(/-/g, " ")) } function stableDirectorySuffix(value: string) { @@ -530,7 +530,7 @@ export default function CompanyBrainConnections() { const connectCustom = async (event: React.FormEvent) => { event.preventDefault() const slug = directoryEntry - ? `${slugifyMcpName(directoryEntry.name).slice(0, 52)}-dir-${stableDirectorySuffix( + ? `${slugifyMcpName(directoryEntry.name).slice(0, 49)}-sm-dir-${stableDirectorySuffix( directoryEntry.url ?? directoryEntry.note ?? directoryEntry.id, )}` : slugifyMcpName(customName) @@ -539,6 +539,12 @@ export default function CompanyBrainConnections() { toast.error("Enter a custom MCP name.") return } + if (!directoryEntry && /-sm-dir-[a-z0-9]{6}$/.test(slug)) { + toast.error( + "Choose a name that doesn't use the reserved directory suffix.", + ) + return + } if (!serverUrl) { toast.error("Enter an MCP URL.") return @@ -881,6 +887,17 @@ export default function CompanyBrainConnections() { ))} + {customAuthMethod === "api-key" && ( + setCustomToken(event.target.value)} + type="password" + placeholder="API key" + required + className={customInputClass} + /> + )} + {customAuthMethod === "api-key" && ( )} {customAuthMethod === "api-key" && customAdvancedOpen && (
- setCustomToken(event.target.value)} - type="password" - placeholder="API key (optional)" - className={customInputClass} - /> setCustomHeaderName(event.target.value)}