Skip to content

Commit 9a6b0ce

Browse files
committed
refactor(copilot): drop the direct view tools, pin views through table_views
Views stay with the table subagent's multiplexed table_views; the orchestrator delegates as before. Its create/update/set-default results now name the table and view they wrote, and resource extraction turns that into the pinned table resource, so the panel opens (or switches) the table on that view. Unknown column names are classified as validation errors, and create_view's isDefault lands in the same locked transaction as the insert. The stream/persistence plumbing for viewId, the pin store, and the lock on default promotion are unchanged.
1 parent ec72d49 commit 9a6b0ce

20 files changed

Lines changed: 201 additions & 1099 deletions

File tree

apps/sim/app/workspace/[workspaceId]/home/components/message-content/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ const TOOL_ICONS: Record<string, IconComponent> = {
5858
search_knowledge_base: Database,
5959
table: TableIcon,
6060
query_user_table: TableIcon,
61-
create_table_view: TableIcon,
62-
edit_table_view: TableIcon,
6361
job: Calendar,
6462
agent: AgentIcon,
6563
custom_tool: Wrench,

apps/sim/app/workspace/[workspaceId]/home/hooks/stream/stream-helpers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ export function resolveIntegrationToolDisplayTitle(tool: {
221221
* client resolves the id against the workflow registry.
222222
*/
223223
const TABLE_SCOPED_TOOL_IDS = new Set<string>([
224-
'create_table_view',
225224
'table_automations',
226225
'table_columns',
227226
'table_enrichments',

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

Lines changed: 2 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export interface ToolCatalogEntry {
3737
| 'connect_slack_bot'
3838
| 'cp'
3939
| 'create_empty_file'
40-
| 'create_table_view'
4140
| 'create_workflow'
4241
| 'create_workspace_mcp_server'
4342
| 'delete_workspace_mcp_server'
@@ -47,7 +46,6 @@ export interface ToolCatalogEntry {
4746
| 'deploy_as_mcp'
4847
| 'diff_workflows'
4948
| 'download_file'
50-
| 'edit_table_view'
5149
| 'edit_workflow'
5250
| 'extensions'
5351
| 'extract_doc_assets'
@@ -168,7 +166,6 @@ export interface ToolCatalogEntry {
168166
| 'connect_slack_bot'
169167
| 'cp'
170168
| 'create_empty_file'
171-
| 'create_table_view'
172169
| 'create_workflow'
173170
| 'create_workspace_mcp_server'
174171
| 'delete_workspace_mcp_server'
@@ -178,7 +175,6 @@ export interface ToolCatalogEntry {
178175
| 'deploy_as_mcp'
179176
| 'diff_workflows'
180177
| 'download_file'
181-
| 'edit_table_view'
182178
| 'edit_workflow'
183179
| 'extensions'
184180
| 'extract_doc_assets'
@@ -1745,82 +1741,6 @@ export const CreateEmptyFile: ToolCatalogEntry = {
17451741
capabilities: ['file_output'],
17461742
}
17471743

1748-
export const CreateTableView: ToolCatalogEntry = {
1749-
id: 'create_table_view',
1750-
name: 'create_table_view',
1751-
route: 'sim',
1752-
mode: 'async',
1753-
parameters: {
1754-
type: 'object',
1755-
properties: {
1756-
config: {
1757-
type: 'object',
1758-
description:
1759-
"Saved configuration, in the same shape as an entry of the table's views.json. Omit for an unfiltered view that shows every row and column.",
1760-
properties: {
1761-
filter: {
1762-
type: ['object', 'null'],
1763-
description:
1764-
'Row predicate, same grammar as query_rows filters: {"all":[...]} / {"any":[...]} of {field, op, value} leaves with exact column NAMES. Omit or null to show every row.',
1765-
},
1766-
hiddenColumns: {
1767-
type: 'array',
1768-
description:
1769-
'Column names hidden in the UI while this view is active. Display-only — queries through the view still return every column.',
1770-
items: { type: 'string' },
1771-
},
1772-
sort: {
1773-
type: ['array', 'null'],
1774-
description:
1775-
'Ordered sort spec, e.g. [{"field":"due","direction":"asc"}], with column NAMES. Omit or null for the table\'s natural order.',
1776-
items: {
1777-
type: 'object',
1778-
properties: {
1779-
direction: {
1780-
type: 'string',
1781-
description: 'Sort direction for this column.',
1782-
enum: ['asc', 'desc'],
1783-
},
1784-
field: { type: 'string', description: 'Exact column name to sort by.' },
1785-
},
1786-
required: ['field', 'direction'],
1787-
},
1788-
},
1789-
},
1790-
},
1791-
isDefault: {
1792-
type: 'boolean',
1793-
description:
1794-
"Make this view the table's default: the view the table opens on when nobody has picked one. At most one per table; setting it clears the previous default.",
1795-
},
1796-
name: {
1797-
type: 'string',
1798-
description:
1799-
'Display name for the view, e.g. "Overdue". Defaults to "View N" when omitted. References always use the view id, so the name is purely display.',
1800-
},
1801-
tableId: { type: 'string', description: "Table ID (tbl_...) from the table's meta.json." },
1802-
},
1803-
required: ['tableId'],
1804-
},
1805-
resultSchema: {
1806-
type: 'object',
1807-
properties: {
1808-
data: {
1809-
type: 'object',
1810-
description:
1811-
'{ viewId, tableId, tableName, view } — view is the created view in the same shape as a views.json entry.',
1812-
},
1813-
message: {
1814-
type: 'string',
1815-
description: 'Human-readable outcome summary, including the new view id.',
1816-
},
1817-
success: { type: 'boolean', description: 'Whether the view was created.' },
1818-
},
1819-
required: ['success', 'message'],
1820-
},
1821-
requiredPermission: 'write',
1822-
}
1823-
18241744
export const CreateWorkflow: ToolCatalogEntry = {
18251745
id: 'create_workflow',
18261746
name: 'create_workflow',
@@ -2316,78 +2236,6 @@ export const DownloadFile: ToolCatalogEntry = {
23162236
capabilities: ['file_output'],
23172237
}
23182238

2319-
export const EditTableView: ToolCatalogEntry = {
2320-
id: 'edit_table_view',
2321-
name: 'edit_table_view',
2322-
route: 'sim',
2323-
mode: 'async',
2324-
parameters: {
2325-
type: 'object',
2326-
properties: {
2327-
config: {
2328-
type: 'object',
2329-
description:
2330-
"Configuration parts to replace, in the same shape as an entry of the table's views.json. Each part you include replaces the saved one; omitted parts are kept.",
2331-
properties: {
2332-
filter: {
2333-
type: ['object', 'null'],
2334-
description:
2335-
'Row predicate, same grammar as query_rows filters: {"all":[...]} / {"any":[...]} of {field, op, value} leaves with exact column NAMES. Omit to keep the saved filter; null to clear it.',
2336-
},
2337-
hiddenColumns: {
2338-
type: 'array',
2339-
description:
2340-
'Column names hidden in the UI while this view is active; replaces the saved list (pass [] to unhide everything). Display-only — queries through the view still return every column.',
2341-
items: { type: 'string' },
2342-
},
2343-
sort: {
2344-
type: ['array', 'null'],
2345-
description:
2346-
'Ordered sort spec, e.g. [{"field":"due","direction":"asc"}], with column NAMES. Omit to keep the saved sort; null to clear it.',
2347-
items: {
2348-
type: 'object',
2349-
properties: {
2350-
direction: {
2351-
type: 'string',
2352-
description: 'Sort direction for this column.',
2353-
enum: ['asc', 'desc'],
2354-
},
2355-
field: { type: 'string', description: 'Exact column name to sort by.' },
2356-
},
2357-
required: ['field', 'direction'],
2358-
},
2359-
},
2360-
},
2361-
},
2362-
isDefault: {
2363-
type: 'boolean',
2364-
description:
2365-
"true makes this view the table's default (clearing the previous default); false demotes it. Omit to leave the flag as it is.",
2366-
},
2367-
name: {
2368-
type: 'string',
2369-
description: 'New display name for the view. Omit to keep the current name.',
2370-
},
2371-
viewId: { type: 'string', description: "View ID from the table's views.json." },
2372-
},
2373-
required: ['viewId'],
2374-
},
2375-
resultSchema: {
2376-
type: 'object',
2377-
properties: {
2378-
data: {
2379-
type: 'object',
2380-
description:
2381-
'{ viewId, tableId, tableName, view } — view is the updated view in the same shape as a views.json entry.',
2382-
},
2383-
message: { type: 'string', description: 'Human-readable outcome summary.' },
2384-
success: { type: 'boolean', description: 'Whether the view was updated.' },
2385-
},
2386-
required: ['success', 'message'],
2387-
},
2388-
requiredPermission: 'write',
2389-
}
2390-
23912239
export const EditWorkflow: ToolCatalogEntry = {
23922240
id: 'edit_workflow',
23932241
name: 'edit_workflow',
@@ -5938,7 +5786,7 @@ export const TableViews: ToolCatalogEntry = {
59385786
description: 'Arguments for the operation',
59395787
properties: {
59405788
filter: {
5941-
type: 'object',
5789+
type: ['object', 'null'],
59425790
description:
59435791
'Saved row predicate, same grammar as query_rows filters: {"all":[...]} / {"any":[...]} of {field, op, value} leaves with exact column NAMES. Omit or null for an unfiltered view.',
59445792
},
@@ -5959,7 +5807,7 @@ export const TableViews: ToolCatalogEntry = {
59595807
'View display name (required for create_view; optional rename on update_view). Free-form label; references always use the view ID, so names are purely display.',
59605808
},
59615809
sort: {
5962-
type: 'array',
5810+
type: ['array', 'null'],
59635811
description:
59645812
'Saved ordered sort spec, e.g. [{"field":"due","direction":"asc"}], column NAMES. Omit or null for default ordering.',
59655813
},
@@ -7179,7 +7027,6 @@ export const TOOL_CATALOG: Record<string, ToolCatalogEntry> = {
71797027
[ConnectSlackBot.id]: ConnectSlackBot,
71807028
[Cp.id]: Cp,
71817029
[CreateEmptyFile.id]: CreateEmptyFile,
7182-
[CreateTableView.id]: CreateTableView,
71837030
[CreateWorkflow.id]: CreateWorkflow,
71847031
[CreateWorkspaceMcpServer.id]: CreateWorkspaceMcpServer,
71857032
[DeleteWorkspaceMcpServer.id]: DeleteWorkspaceMcpServer,
@@ -7189,7 +7036,6 @@ export const TOOL_CATALOG: Record<string, ToolCatalogEntry> = {
71897036
[DeployAsMcp.id]: DeployAsMcp,
71907037
[DiffWorkflows.id]: DiffWorkflows,
71917038
[DownloadFile.id]: DownloadFile,
7192-
[EditTableView.id]: EditTableView,
71937039
[EditWorkflow.id]: EditWorkflow,
71947040
[Extensions.id]: Extensions,
71957041
[ExtractDocAssets.id]: ExtractDocAssets,

0 commit comments

Comments
 (0)