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.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import type { BotExtensionsPayload } from "@/src/types";
|
|
import { extensionOptionValue, parseExtensionOptionValue } from "@/src/utils/extension-option-value";
|
|
import extensionNoun from "@/src/utils/extension-noun";
|
|
import InlineAddSelect from "./inline-add-select";
|
|
|
|
type Props = {
|
|
id: string;
|
|
addable: BotExtensionsPayload["addable"];
|
|
loading?: boolean;
|
|
onAdd: (params: { kind: "mcp" | "tool" | "skill"; id: number }) => void;
|
|
};
|
|
|
|
/**
|
|
* Picks an MCP server, tool or skill to give a bot.
|
|
*/
|
|
export default function ExtensionAddSelect({ id, addable, loading, onAdd }: Props) {
|
|
return (
|
|
<InlineAddSelect
|
|
id={id}
|
|
noun="tool, MCP server or skill"
|
|
options={addable.map((item) => ({
|
|
value: extensionOptionValue(item),
|
|
title: `${extensionNoun({ kind: item.kind })}: ${item.name}`,
|
|
}))}
|
|
loading={loading}
|
|
onAdd={({ value }) => {
|
|
const picked = parseExtensionOptionValue({ value });
|
|
if (picked) onAdd(picked);
|
|
}}
|
|
/>
|
|
);
|
|
}
|