- Coordinator tools in its own chat (super admin only): list_extensions,
set_extension_access, delete_extension, and update_skill /
update_mcp_server / update_custom_tool for what can't change where
anything is sent (on/off, names, arguments, left-out tools)
- Adding a skill, MCP server or tool, or changing a skill's words, a
server's URL or headers or a tool's kind or config, goes through
propose_skill / propose_mcp_server / propose_custom_tool: stored in
extension_proposals with the bot's background check, shown as a
[proposal:ID] chip that opens a card with Confirm and Reject
- The card's facts are worked out by the app from what Confirm saves: the
host, every {{env.KEY}} and whether it's saved, the config; for a skill
its links, hosts, tool names, mentions of secrets and a diff against
the saved runbook
- Confirming decides once and checks again; a server or tool missing a key
is saved switched off, and the outcome is posted to the bot in chat
- Never from a bot: stdio servers, a URL whose host a template decides,
envs in a prompt tool, a key's value
Co-Authored-By: Claude Opus 5.5 <[email protected]>
93 lines
2.9 KiB
TypeScript
93 lines
2.9 KiB
TypeScript
/**
|
|
* What a custom tool does when a bot calls it. `http` calls an API from the
|
|
* app, `script` runs code on the run's computer, `prompt` runs one model
|
|
* turn with a filled-in prompt.
|
|
*/
|
|
export const CustomToolKinds = [
|
|
{
|
|
title: "HTTP request",
|
|
value: "http",
|
|
description: "Calls an API from the app and returns the response.",
|
|
},
|
|
{
|
|
title: "Script on a computer",
|
|
value: "script",
|
|
description: "Runs code on the bot's computer and returns what it prints.",
|
|
},
|
|
{
|
|
title: "Prompt",
|
|
value: "prompt",
|
|
description: "Runs one model turn with a filled-in prompt and returns the answer.",
|
|
},
|
|
] as const;
|
|
|
|
export type CustomToolKind = (typeof CustomToolKinds)[number]["value"];
|
|
|
|
/**
|
|
* How a tool's last run went (a bot's call or a try from its settings):
|
|
* `ok`, `error` (see its `last_error`), or `untested` before its first run
|
|
* and after it's edited. Bad arguments from a bot don't count.
|
|
*/
|
|
export const CustomToolStatuses = [
|
|
{ title: "Not run yet", value: "untested" },
|
|
{ title: "Worked", value: "ok" },
|
|
{ title: "Failed", value: "error" },
|
|
] as const;
|
|
|
|
export type CustomToolStatus = (typeof CustomToolStatuses)[number]["value"];
|
|
|
|
export const CustomToolHttpMethods = ["GET", "POST", "PUT", "PATCH", "DELETE"] as const;
|
|
|
|
export type CustomToolHttpMethod = (typeof CustomToolHttpMethods)[number];
|
|
|
|
/**
|
|
* Languages a script tool runs in, with the interpreter on the computer
|
|
* and the code editor's mode.
|
|
*/
|
|
export const CustomToolScriptLanguages = [
|
|
{ title: "Bash", value: "bash", interpreter: "bash", extension: "sh", editor_mode: "sh" },
|
|
{ title: "Python", value: "python", interpreter: "python3", extension: "py", editor_mode: "python" },
|
|
{ title: "JavaScript", value: "javascript", interpreter: "node", extension: "js", editor_mode: "javascript" },
|
|
] as const;
|
|
|
|
export type CustomToolScriptLanguage = (typeof CustomToolScriptLanguages)[number]["value"];
|
|
|
|
/**
|
|
* Names the built-in bot tools use. A custom tool can't take one, and
|
|
* names starting with a computer's tool prefixes are kept for them too.
|
|
*/
|
|
export const ReservedToolNames = [
|
|
"add_bot_to_workspace",
|
|
"ask_user_to_take_over",
|
|
"assign_computer",
|
|
"create_bot",
|
|
"create_schedule",
|
|
"create_workspace",
|
|
"delegate_task",
|
|
"delete_extension",
|
|
"delete_schedule",
|
|
"list_extensions",
|
|
"list_schedules",
|
|
"load_skill",
|
|
"propose_custom_tool",
|
|
"propose_mcp_server",
|
|
"propose_skill",
|
|
"report_run_failed",
|
|
"search_computers",
|
|
"send_message",
|
|
"set_bot_workspace_instructions",
|
|
"set_extension_access",
|
|
"set_picture",
|
|
"set_workspace_computer",
|
|
"start_task",
|
|
"update_custom_tool",
|
|
"update_instructions",
|
|
"update_mcp_server",
|
|
"update_memory",
|
|
"update_schedule",
|
|
"update_skill",
|
|
"update_workspace",
|
|
] as const;
|
|
|
|
export const ReservedToolPrefixes = ["sandbox_", "browser_"] as const;
|