Skip to content

Commit 60fab03

Browse files
feat(copilot): list_enrichments + add_enrichment table tools
Let the copilot enumerate the code-defined enrichment registry and add an enrichment column to a table (validating required input mappings against the table's columns), backed by the same workflow-group machinery the UI uses.
1 parent 645ff02 commit 60fab03

5 files changed

Lines changed: 495 additions & 99 deletions

File tree

apps/sim/lib/copilot/generated/tool-catalog-v1.ts

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2944,7 +2944,7 @@ export const UserTable: ToolCatalogEntry = {
29442944
autoRun: {
29452945
type: 'boolean',
29462946
description:
2947-
"Optional flag for add_workflow_group and update_workflow_group. On add: when true, existing rows whose dependencies are already filled run immediately; default false stages the group silently — call run_column when ready to fire rows. On update: toggle a group's auto-fire behavior on an existing group — false stages it (no auto-runs on dep satisfaction; only manual run_column fires rows), true re-enables auto-fire (rows whose deps fill will be scheduled). Set true on add only if the user explicitly asked to start runs immediately.",
2947+
"Optional flag for add_workflow_group, add_enrichment, and update_workflow_group. On add (workflow group or enrichment): when true, existing rows whose dependencies are already filled run immediately; default false stages the group silently — call run_column when ready to fire rows. On update: toggle a group's auto-fire behavior on an existing group — false stages it (no auto-runs on dep satisfaction; only manual run_column fires rows), true re-enables auto-fire (rows whose deps fill will be scheduled). Set true on add only if the user explicitly asked to start runs immediately.",
29482948
},
29492949
blockId: {
29502950
type: 'string',
@@ -2971,7 +2971,7 @@ export const UserTable: ToolCatalogEntry = {
29712971
dependencies: {
29722972
type: 'object',
29732973
description:
2974-
"Dependencies the workflow group requires before running a row. { columns?: string[] } lists input column names that must be filled. Workflow output columns count too — depend on the column produced by an upstream group, not the group itself. The dep graph is column-induced. A group can't depend on its own output columns. Used by add_workflow_group and update_workflow_group.",
2974+
"Dependencies the group requires before running a row. { columns?: string[] } lists input column names that must be filled. Workflow output columns count too — depend on the column produced by an upstream group, not the group itself. The dep graph is column-induced. A group can't depend on its own output columns. Used by add_workflow_group and update_workflow_group, and optionally by add_enrichment (omit and the handler defaults deps to the mapped input columns).",
29752975
properties: {
29762976
columns: {
29772977
type: 'array',
@@ -2982,6 +2982,11 @@ export const UserTable: ToolCatalogEntry = {
29822982
},
29832983
},
29842984
description: { type: 'string', description: "Table description (optional for 'create')" },
2985+
enrichmentId: {
2986+
type: 'string',
2987+
description:
2988+
"Enrichment registry ID for add_enrichment. Discover the available IDs (and each one's inputs/outputs) via list_enrichments first — don't hardcode. Examples: work-email, phone-number, company-domain, company-info.",
2989+
},
29852990
fileId: {
29862991
type: 'string',
29872992
description:
@@ -3008,6 +3013,25 @@ export const UserTable: ToolCatalogEntry = {
30083013
'Array of workflow group IDs. Required for run_column — non-empty list of columns to run.',
30093014
items: { type: 'string' },
30103015
},
3016+
inputMappings: {
3017+
type: 'array',
3018+
description:
3019+
'For add_enrichment: maps each enrichment input to an existing table column. Each item is { inputName, columnName } where inputName is the enrichment input id (from list_enrichments) and columnName is an existing column on the table. Provide a mapping for every required input. (The field is named inputName for consistency with workflow-group input mappings; for enrichments it holds the enrichment input id.)',
3020+
items: {
3021+
type: 'object',
3022+
properties: {
3023+
columnName: {
3024+
type: 'string',
3025+
description: 'Existing table column name that supplies this input.',
3026+
},
3027+
inputName: {
3028+
type: 'string',
3029+
description: 'Enrichment input id to bind (from list_enrichments).',
3030+
},
3031+
},
3032+
required: ['inputName', 'columnName'],
3033+
},
3034+
},
30113035
limit: {
30123036
type: 'number',
30133037
description: 'Maximum rows to return or affect (optional, default 100)',
@@ -3046,7 +3070,11 @@ export const UserTable: ToolCatalogEntry = {
30463070
"Import mode for import_file. 'append' (default) adds rows; 'replace' truncates existing rows in a transaction before inserting the new rows.",
30473071
enum: ['append', 'replace'],
30483072
},
3049-
name: { type: 'string', description: "Table name (required for 'create')" },
3073+
name: {
3074+
type: 'string',
3075+
description:
3076+
"Table name (required for 'create'). Also the optional display name for add_enrichment — defaults to the enrichment's registry name when omitted.",
3077+
},
30503078
newName: { type: 'string', description: 'New column name (required for rename_column)' },
30513079
newType: {
30523080
type: 'string',
@@ -3057,6 +3085,15 @@ export const UserTable: ToolCatalogEntry = {
30573085
type: 'number',
30583086
description: 'Number of rows to skip (optional for query_rows, default 0)',
30593087
},
3088+
outputColumnNames: {
3089+
type: 'object',
3090+
description:
3091+
'Optional output column name overrides for add_enrichment, as { "<outputId>": "<columnName>" }. Omit to use each enrichment output\'s default name.',
3092+
additionalProperties: {
3093+
type: 'string',
3094+
description: 'Target column name for this enrichment output id.',
3095+
},
3096+
},
30603097
outputFormat: {
30613098
type: 'string',
30623099
description:
@@ -3206,6 +3243,8 @@ export const UserTable: ToolCatalogEntry = {
32063243
'run_column',
32073244
'cancel_table_runs',
32083245
'list_workflow_outputs',
3246+
'list_enrichments',
3247+
'add_enrichment',
32093248
],
32103249
},
32113250
},
@@ -3552,6 +3591,8 @@ export const UserTableOperation = {
35523591
runColumn: 'run_column',
35533592
cancelTableRuns: 'cancel_table_runs',
35543593
listWorkflowOutputs: 'list_workflow_outputs',
3594+
listEnrichments: 'list_enrichments',
3595+
addEnrichment: 'add_enrichment',
35553596
} as const
35563597

35573598
export type UserTableOperation = (typeof UserTableOperation)[keyof typeof UserTableOperation]
@@ -3585,6 +3626,8 @@ export const UserTableOperationValues = [
35853626
UserTableOperation.runColumn,
35863627
UserTableOperation.cancelTableRuns,
35873628
UserTableOperation.listWorkflowOutputs,
3629+
UserTableOperation.listEnrichments,
3630+
UserTableOperation.addEnrichment,
35883631
] as const
35893632

35903633
export const WorkspaceFileOperation = {

0 commit comments

Comments
 (0)