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.
37 lines
895 B
TypeScript
37 lines
895 B
TypeScript
import type { BotExtension } from "@/src/types";
|
|
|
|
type Params = {
|
|
kind: BotExtension["kind"];
|
|
/**
|
|
* With the article, for a sentence: "the tool", "the MCP server".
|
|
*/
|
|
article?: boolean;
|
|
};
|
|
|
|
/**
|
|
* What an extension kind is called in copy: a tool, an MCP server or a
|
|
* skill.
|
|
*/
|
|
export default function extensionNoun({ kind, article }: Params) {
|
|
const noun = kind == "mcp" ? "MCP server" : kind == "skill" ? "skill" : "tool";
|
|
|
|
return article ? `the ${noun}` : noun;
|
|
}
|
|
|
|
type TitleParams = {
|
|
kind: BotExtension["kind"];
|
|
/**
|
|
* What happened, in one word: "added", "removed".
|
|
*/
|
|
verb: string;
|
|
};
|
|
|
|
/**
|
|
* A log entry's title: "MCP server added", "Skill removed".
|
|
*/
|
|
export function extensionLogTitle({ kind, verb }: TitleParams) {
|
|
const noun = extensionNoun({ kind });
|
|
|
|
return `${noun.charAt(0).toUpperCase()}${noun.slice(1)} ${verb}`;
|
|
}
|