Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 116 additions & 1 deletion apps/sim/lib/copilot/generated/tool-catalog-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface ToolCatalogEntry {
| 'deploy'
| 'deploy_api'
| 'deploy_chat'
| 'deploy_custom_block'
| 'deploy_mcp'
| 'diff_workflows'
| 'download_to_workspace_file'
Expand Down Expand Up @@ -121,6 +122,7 @@ export interface ToolCatalogEntry {
| 'deploy'
| 'deploy_api'
| 'deploy_chat'
| 'deploy_custom_block'
| 'deploy_mcp'
| 'diff_workflows'
| 'download_to_workspace_file'
Expand Down Expand Up @@ -536,7 +538,7 @@ export const Deploy: ToolCatalogEntry = {
properties: {
request: {
description:
'Detailed deployment instructions. Include deployment type (api/chat/mcp) and ALL user-specified options: identifier, title, description, authType, password, allowedEmails, welcomeMessage, outputConfigs (block outputs to display).',
'Detailed deployment instructions. Include deployment type (api/chat/mcp/custom_block) and ALL user-specified options: identifier, title, description, authType, password, allowedEmails, welcomeMessage, outputConfigs (block outputs to display), and for custom blocks the block name, description, icon URL, and exposed outputs.',
type: 'string',
},
},
Expand Down Expand Up @@ -772,6 +774,118 @@ export const DeployChat: ToolCatalogEntry = {
requiredPermission: 'admin',
}

export const DeployCustomBlock: ToolCatalogEntry = {
id: 'deploy_custom_block',
name: 'deploy_custom_block',
route: 'sim',
mode: 'async',
parameters: {
type: 'object',
properties: {
action: {
type: 'string',
description: 'Whether to publish (deploy) or unpublish (undeploy) the custom block',
enum: ['deploy', 'undeploy'],
default: 'deploy',
},
description: {
type: 'string',
description: 'Short description shown in the block picker, max 280 characters',
},
exposedOutputs: {
type: 'array',
description:
"Outputs the block exposes, each mapping a child block output path to a friendly name (use get_block_outputs for valid paths). Omit to expose the terminal block's whole result",
items: {
type: 'object',
properties: {
blockId: { type: 'string', description: 'Block UUID inside the workflow' },
name: { type: 'string', description: 'Friendly output name shown on the block' },
path: {
type: 'string',
description:
"Dot-path into that block's output (from get_block_outputs relativeOutputs)",
},
},
required: ['blockId', 'path', 'name'],
},
},
iconUrl: {
type: 'string',
description:
'Optional icon image for the block: a workspace file VFS path (e.g. "files/icon.png", copied into public icon storage at publish) or an external image URL. Omit to use the organization\'s default icon',
},
inputs: {
type: 'array',
description:
"Optional per-input placeholder overrides. Input names and types are derived from the workflow's input trigger and cannot be changed here",
items: {
type: 'object',
properties: {
id: { type: 'string', description: 'Stable id of the input trigger field' },
placeholder: {
type: 'string',
description: "Placeholder text shown in the block's input field",
},
},
required: ['id'],
},
},
name: {
type: 'string',
description:
'Display name for the block, max 60 characters (required on first publish; defaults to the existing block name when republishing)',
},
workflowId: { type: 'string', description: 'Workflow ID (defaults to active workflow)' },
},
},
resultSchema: {
type: 'object',
properties: {
action: {
type: 'string',
description: 'Action performed by the tool, such as "deploy" or "undeploy".',
},
blockId: { type: 'string', description: 'Custom block record ID.' },
blockType: {
type: 'string',
description: 'Stable block type slug (custom_block_*) used in workflow state.',
},
deploymentConfig: {
type: 'object',
description:
"Structured deployment configuration keyed by surface name. Includes the block's type, name, description, icon, derived input fields, and exposed outputs.",
},
deploymentStatus: {
type: 'object',
description:
'Structured per-surface deployment status keyed by surface name, including customBlock and the underlying api surface when applicable.',
},
deploymentType: {
type: 'string',
description:
'Deployment surface this result describes. For deploy_custom_block this is always "custom_block".',
},
isDeployed: {
type: 'boolean',
description: 'Whether the custom block is published after this tool call.',
},
name: { type: 'string', description: 'Display name of the custom block.' },
removed: {
type: 'boolean',
description: 'Whether the custom block was unpublished during an undeploy action.',
},
updated: {
type: 'boolean',
description: 'Whether an existing custom block was updated instead of created.',
},
workflowId: { type: 'string', description: 'Workflow ID the custom block is bound to.' },
},
required: ['deploymentType', 'deploymentStatus'],
},
requiredPermission: 'admin',
}

export const DeployMcp: ToolCatalogEntry = {
id: 'deploy_mcp',
name: 'deploy_mcp',
Expand Down Expand Up @@ -4581,6 +4695,7 @@ export const TOOL_CATALOG: Record<string, ToolCatalogEntry> = {
[Deploy.id]: Deploy,
[DeployApi.id]: DeployApi,
[DeployChat.id]: DeployChat,
[DeployCustomBlock.id]: DeployCustomBlock,
[DeployMcp.id]: DeployMcp,
[DiffWorkflows.id]: DiffWorkflows,
[DownloadToWorkspaceFile.id]: DownloadToWorkspaceFile,
Expand Down
129 changes: 128 additions & 1 deletion apps/sim/lib/copilot/generated/tool-schemas-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
properties: {
request: {
description:
'Detailed deployment instructions. Include deployment type (api/chat/mcp) and ALL user-specified options: identifier, title, description, authType, password, allowedEmails, welcomeMessage, outputConfigs (block outputs to display).',
'Detailed deployment instructions. Include deployment type (api/chat/mcp/custom_block) and ALL user-specified options: identifier, title, description, authType, password, allowedEmails, welcomeMessage, outputConfigs (block outputs to display), and for custom blocks the block name, description, icon URL, and exposed outputs.',
type: 'string',
},
},
Expand Down Expand Up @@ -570,6 +570,133 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
],
},
},
deploy_custom_block: {
parameters: {
type: 'object',
properties: {
action: {
type: 'string',
description: 'Whether to publish (deploy) or unpublish (undeploy) the custom block',
enum: ['deploy', 'undeploy'],
default: 'deploy',
},
description: {
type: 'string',
description: 'Short description shown in the block picker, max 280 characters',
},
exposedOutputs: {
type: 'array',
description:
"Outputs the block exposes, each mapping a child block output path to a friendly name (use get_block_outputs for valid paths). Omit to expose the terminal block's whole result",
items: {
type: 'object',
properties: {
blockId: {
type: 'string',
description: 'Block UUID inside the workflow',
},
name: {
type: 'string',
description: 'Friendly output name shown on the block',
},
path: {
type: 'string',
description:
"Dot-path into that block's output (from get_block_outputs relativeOutputs)",
},
},
required: ['blockId', 'path', 'name'],
},
},
iconUrl: {
type: 'string',
description:
'Optional icon image for the block: a workspace file VFS path (e.g. "files/icon.png", copied into public icon storage at publish) or an external image URL. Omit to use the organization\'s default icon',
},
inputs: {
type: 'array',
description:
"Optional per-input placeholder overrides. Input names and types are derived from the workflow's input trigger and cannot be changed here",
items: {
type: 'object',
properties: {
id: {
type: 'string',
description: 'Stable id of the input trigger field',
},
placeholder: {
type: 'string',
description: "Placeholder text shown in the block's input field",
},
},
required: ['id'],
},
},
name: {
type: 'string',
description:
'Display name for the block, max 60 characters (required on first publish; defaults to the existing block name when republishing)',
},
workflowId: {
type: 'string',
description: 'Workflow ID (defaults to active workflow)',
},
},
},
resultSchema: {
type: 'object',
properties: {
action: {
type: 'string',
description: 'Action performed by the tool, such as "deploy" or "undeploy".',
},
blockId: {
type: 'string',
description: 'Custom block record ID.',
},
blockType: {
type: 'string',
description: 'Stable block type slug (custom_block_*) used in workflow state.',
},
deploymentConfig: {
type: 'object',
description:
"Structured deployment configuration keyed by surface name. Includes the block's type, name, description, icon, derived input fields, and exposed outputs.",
},
deploymentStatus: {
type: 'object',
description:
'Structured per-surface deployment status keyed by surface name, including customBlock and the underlying api surface when applicable.',
},
deploymentType: {
type: 'string',
description:
'Deployment surface this result describes. For deploy_custom_block this is always "custom_block".',
},
isDeployed: {
type: 'boolean',
description: 'Whether the custom block is published after this tool call.',
},
name: {
type: 'string',
description: 'Display name of the custom block.',
},
removed: {
type: 'boolean',
description: 'Whether the custom block was unpublished during an undeploy action.',
},
updated: {
type: 'boolean',
description: 'Whether an existing custom block was updated instead of created.',
},
workflowId: {
type: 'string',
description: 'Workflow ID the custom block is bound to.',
},
},
required: ['deploymentType', 'deploymentStatus'],
},
},
deploy_mcp: {
parameters: {
type: 'object',
Expand Down
3 changes: 3 additions & 0 deletions apps/sim/lib/copilot/tool-executor/register-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
DeleteWorkspaceMcpServer,
DeployApi,
DeployChat,
DeployCustomBlock,
DeployMcp,
DiffWorkflows,
FunctionExecute,
Expand Down Expand Up @@ -53,6 +54,7 @@ import {
} from '@/lib/copilot/generated/tool-catalog-v1'
import { createServerToolHandler } from '@/lib/copilot/tools/registry/server-tool-adapter'
import { getRegisteredServerToolNames } from '@/lib/copilot/tools/server/router'
import { executeDeployCustomBlock } from '../tools/handlers/deployment/custom-block'
import {
executeDeployApi,
executeDeployChat,
Expand Down Expand Up @@ -156,6 +158,7 @@ function buildHandlerMap(): Record<string, ToolHandler> {
[DeployApi.id]: h(executeDeployApi),
[DeployChat.id]: h(executeDeployChat),
[DeployMcp.id]: h(executeDeployMcp),
[DeployCustomBlock.id]: h(executeDeployCustomBlock),
[Redeploy.id]: h(executeRedeploy),
[CheckDeploymentStatus.id]: h(executeCheckDeploymentStatus),
[ListWorkspaceMcpServers.id]: h(executeListWorkspaceMcpServers),
Expand Down
Loading
Loading