- Bots and workspaces get tools and MCP servers from their settings pages; bots also from chips under the chat composer, removable there - "Every bot" now gives one to every bot now and every new bot; each can still drop it (attach-every-bot-extensions.ts moves old installs over) - Status lines: MCP servers record whether they connect, tools whether their last run worked - Test connection in the MCP form and a Test panel in the tool form check the form as it is, without saving - Hide Google sign-in on the login form Co-Authored-By: Claude Opus 5.5 <[email protected]>
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import type { BotExtensionsPayload } from "@/src/types";
|
|
import { extensionOptionValue, parseExtensionOptionValue } from "@/src/utils/extension-option-value";
|
|
import InlineAddSelect from "./inline-add-select";
|
|
|
|
type Props = {
|
|
id: string;
|
|
addable: BotExtensionsPayload["addable"];
|
|
loading?: boolean;
|
|
onAdd: (params: { kind: "mcp" | "tool"; id: number }) => void;
|
|
};
|
|
|
|
/**
|
|
* Picks an MCP server or tool to give a bot.
|
|
*/
|
|
export default function ExtensionAddSelect({ id, addable, loading, onAdd }: Props) {
|
|
return (
|
|
<InlineAddSelect
|
|
id={id}
|
|
noun="tool or MCP server"
|
|
options={addable.map((item) => ({
|
|
value: extensionOptionValue(item),
|
|
title: `${item.kind == "mcp" ? "MCP" : "Tool"} · ${item.name}`,
|
|
}))}
|
|
loading={loading}
|
|
onAdd={({ value }) => {
|
|
const picked = parseExtensionOptionValue({ value });
|
|
if (picked) onAdd(picked);
|
|
}}
|
|
/>
|
|
);
|
|
}
|