Give bots tools and MCP servers per bot and workspace, with status and tests
- 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]>
This commit is contained in:
@@ -27,16 +27,17 @@ const Tables = {
|
||||
|
||||
/**
|
||||
* The enabled MCP servers or custom tools a bot gets on one run: those
|
||||
* for every bot, those attached to the bot, and in a workspace those
|
||||
* attached to the workspace.
|
||||
* attached to the bot, and in a workspace those attached to the
|
||||
* workspace. "Every bot" only decides what a bot is given (now and when
|
||||
* it's created, `attachToAllBots`, `attachDefaultExtensions`); one it
|
||||
* dropped stays dropped.
|
||||
*/
|
||||
export default function botExtensionsSql({ kind, bot_id, workspace_id }: Params) {
|
||||
const { table, bot_link, workspace_link, column } = Tables[kind];
|
||||
|
||||
return {
|
||||
sql: `SELECT x.* FROM ${table} x WHERE x.enabled = 1 AND (
|
||||
x.all_bots = 1
|
||||
OR x.id IN (SELECT ${column} FROM ${bot_link} WHERE bot_id = ?)
|
||||
x.id IN (SELECT ${column} FROM ${bot_link} WHERE bot_id = ?)
|
||||
${workspace_id ? `OR x.id IN (SELECT ${column} FROM ${workspace_link} WHERE workspace_id = ?)` : ""}
|
||||
) ORDER BY x.id ASC`,
|
||||
values: workspace_id ? [Number(bot_id), Number(workspace_id)] : [Number(bot_id)],
|
||||
|
||||
Reference in New Issue
Block a user