Give bots skills: runbooks they load when a job matches
A skill is a runbook: a name, a unique slug, a one-line description of when it applies, and the markdown body. A run only ever sees the slug and description (one load_skill tool carries them), and reads the whole body only when it calls the tool, so a long runbook costs nothing until needed. Skills are the third extension kind beside MCP servers and custom tools, on the same botExtensionsSql path, so per-bot, per-workspace and all-bots grants work the same way, and attachDefaultExtensions hands an every-bot skill to new bots. load_skill is a reserved tool name, so a custom tool cannot shadow it, and a built-in wins a clash. Managed on Settings > Skills; ExtensionRow links each kind to its own page and a skill never reports a failure, since nothing connects or runs.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { BotExtension } from "@/src/types";
|
||||
|
||||
/**
|
||||
* An MCP server or tool as one select value (`mcp:3`), and back.
|
||||
* An MCP server, tool or skill as one select value (`mcp:3`), and back.
|
||||
*/
|
||||
export function extensionOptionValue({ kind, id }: { kind: BotExtension["kind"]; id: number }) {
|
||||
return `${kind}:${id}`;
|
||||
@@ -10,7 +10,7 @@ export function extensionOptionValue({ kind, id }: { kind: BotExtension["kind"];
|
||||
export function parseExtensionOptionValue({ value }: { value: string }) {
|
||||
const [kind, id] = value.split(":");
|
||||
|
||||
if ((kind != "mcp" && kind != "tool") || !Number(id)) return null;
|
||||
if ((kind != "mcp" && kind != "tool" && kind != "skill") || !Number(id)) return null;
|
||||
|
||||
return { kind: kind as BotExtension["kind"], id: Number(id) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user