- 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]>
17 lines
509 B
TypeScript
17 lines
509 B
TypeScript
import type { BotExtension } from "@/src/types";
|
|
|
|
/**
|
|
* An MCP server or tool as one select value (`mcp:3`), and back.
|
|
*/
|
|
export function extensionOptionValue({ kind, id }: { kind: BotExtension["kind"]; id: number }) {
|
|
return `${kind}:${id}`;
|
|
}
|
|
|
|
export function parseExtensionOptionValue({ value }: { value: string }) {
|
|
const [kind, id] = value.split(":");
|
|
|
|
if ((kind != "mcp" && kind != "tool") || !Number(id)) return null;
|
|
|
|
return { kind: kind as BotExtension["kind"], id: Number(id) };
|
|
}
|