From 780b4fe22d2cda44df3465d1dae637c483a241ef Mon Sep 17 00:00:00 2001 From: aadamgough Date: Thu, 8 Jan 2026 18:26:16 -0800 Subject: [PATCH 1/2] added missing params --- apps/sim/blocks/blocks/linear.ts | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/apps/sim/blocks/blocks/linear.ts b/apps/sim/blocks/blocks/linear.ts index 6b88caac6b..faacf4a62e 100644 --- a/apps/sim/blocks/blocks/linear.ts +++ b/apps/sim/blocks/blocks/linear.ts @@ -227,7 +227,11 @@ export const LinearBlock: BlockConfig = { 'linear_update_project', 'linear_archive_project', 'linear_delete_project', + 'linear_create_project_update', 'linear_list_project_updates', + 'linear_create_project_link', + 'linear_create_project_status', + 'linear_create_project_label', ], }, condition: { @@ -239,7 +243,11 @@ export const LinearBlock: BlockConfig = { 'linear_update_project', 'linear_archive_project', 'linear_delete_project', + 'linear_create_project_update', 'linear_list_project_updates', + 'linear_create_project_link', + 'linear_create_project_status', + 'linear_create_project_label', 'linear_list_project_labels', ], }, @@ -262,6 +270,8 @@ export const LinearBlock: BlockConfig = { 'linear_create_project_update', 'linear_list_project_updates', 'linear_create_project_link', + 'linear_create_project_status', + 'linear_create_project_label', ], }, condition: { @@ -276,6 +286,8 @@ export const LinearBlock: BlockConfig = { 'linear_create_project_update', 'linear_list_project_updates', 'linear_create_project_link', + 'linear_create_project_status', + 'linear_create_project_label', 'linear_list_project_labels', ], }, @@ -1993,11 +2005,15 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n // Project Label Operations case 'linear_create_project_label': + if (!effectiveProjectId) { + throw new Error('Project ID is required.') + } if (!params.projectLabelName?.trim()) { throw new Error('Project label name is required.') } return { ...baseParams, + projectId: effectiveProjectId, name: params.projectLabelName.trim(), description: params.projectLabelDescription?.trim() || undefined, color: params.statusColor?.trim() || undefined, @@ -2033,22 +2049,22 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n } case 'linear_add_label_to_project': - if (!effectiveProjectId || !params.projectLabelId?.trim()) { + if (!params.projectIdForMilestone?.trim() || !params.projectLabelId?.trim()) { throw new Error('Project ID and label ID are required.') } return { ...baseParams, - projectId: effectiveProjectId, + projectId: params.projectIdForMilestone.trim(), labelId: params.projectLabelId.trim(), } case 'linear_remove_label_from_project': - if (!effectiveProjectId || !params.projectLabelId?.trim()) { + if (!params.projectIdForMilestone?.trim() || !params.projectLabelId?.trim()) { throw new Error('Project ID and label ID are required.') } return { ...baseParams, - projectId: effectiveProjectId, + projectId: params.projectIdForMilestone.trim(), labelId: params.projectLabelId.trim(), } @@ -2097,11 +2113,15 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n // Project Status Operations case 'linear_create_project_status': + if (!effectiveProjectId) { + throw new Error('Project ID is required.') + } if (!params.projectStatusName?.trim() || !params.statusColor?.trim()) { throw new Error('Project status name and color are required.') } return { ...baseParams, + projectId: effectiveProjectId, name: params.projectStatusName.trim(), color: params.statusColor.trim(), description: params.projectStatusDescription?.trim() || undefined, From 1e75f44b65e344b61ca584041b2ee643287af708 Mon Sep 17 00:00:00 2001 From: aadamgough Date: Thu, 8 Jan 2026 18:58:33 -0800 Subject: [PATCH 2/2] fixed linear bugs --- apps/sim/blocks/blocks/linear.ts | 77 +++++------ apps/sim/tools/linear/create_project_label.ts | 7 - apps/sim/tools/linear/create_project_link.ts | 123 ------------------ .../sim/tools/linear/create_project_status.ts | 29 ++--- apps/sim/tools/linear/index.ts | 2 - apps/sim/tools/linear/types.ts | 26 +--- apps/sim/tools/registry.ts | 2 - 7 files changed, 56 insertions(+), 210 deletions(-) delete mode 100644 apps/sim/tools/linear/create_project_link.ts diff --git a/apps/sim/blocks/blocks/linear.ts b/apps/sim/blocks/blocks/linear.ts index faacf4a62e..3eedb35c5e 100644 --- a/apps/sim/blocks/blocks/linear.ts +++ b/apps/sim/blocks/blocks/linear.ts @@ -77,7 +77,6 @@ export const LinearBlock: BlockConfig = { // Project Update Operations { label: 'Create Project Update', id: 'linear_create_project_update' }, { label: 'List Project Updates', id: 'linear_list_project_updates' }, - { label: 'Create Project Link', id: 'linear_create_project_link' }, // Notification Operations { label: 'List Notifications', id: 'linear_list_notifications' }, { label: 'Update Notification', id: 'linear_update_notification' }, @@ -229,9 +228,6 @@ export const LinearBlock: BlockConfig = { 'linear_delete_project', 'linear_create_project_update', 'linear_list_project_updates', - 'linear_create_project_link', - 'linear_create_project_status', - 'linear_create_project_label', ], }, condition: { @@ -245,9 +241,6 @@ export const LinearBlock: BlockConfig = { 'linear_delete_project', 'linear_create_project_update', 'linear_list_project_updates', - 'linear_create_project_link', - 'linear_create_project_status', - 'linear_create_project_label', 'linear_list_project_labels', ], }, @@ -269,9 +262,6 @@ export const LinearBlock: BlockConfig = { 'linear_delete_project', 'linear_create_project_update', 'linear_list_project_updates', - 'linear_create_project_link', - 'linear_create_project_status', - 'linear_create_project_label', ], }, condition: { @@ -285,9 +275,6 @@ export const LinearBlock: BlockConfig = { 'linear_delete_project', 'linear_create_project_update', 'linear_list_project_updates', - 'linear_create_project_link', - 'linear_create_project_status', - 'linear_create_project_label', 'linear_list_project_labels', ], }, @@ -637,7 +624,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n required: true, condition: { field: 'operation', - value: ['linear_create_attachment', 'linear_create_project_link'], + value: ['linear_create_attachment'], }, }, // Attachment title @@ -1233,6 +1220,36 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_project_status'], }, }, + { + id: 'projectStatusType', + title: 'Status Type', + type: 'dropdown', + options: [ + { label: 'Backlog', id: 'backlog' }, + { label: 'Planned', id: 'planned' }, + { label: 'Started', id: 'started' }, + { label: 'Paused', id: 'paused' }, + { label: 'Completed', id: 'completed' }, + { label: 'Canceled', id: 'canceled' }, + ], + value: () => 'started', + required: true, + condition: { + field: 'operation', + value: ['linear_create_project_status'], + }, + }, + { + id: 'projectStatusPosition', + title: 'Position', + type: 'short-input', + placeholder: 'Enter position (e.g. 0, 1, 2...)', + required: true, + condition: { + field: 'operation', + value: ['linear_create_project_status'], + }, + }, { id: 'projectStatusId', title: 'Status ID', @@ -1338,7 +1355,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n 'linear_list_favorites', 'linear_create_project_update', 'linear_list_project_updates', - 'linear_create_project_link', 'linear_list_notifications', 'linear_update_notification', 'linear_create_customer', @@ -1784,17 +1800,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n projectId: effectiveProjectId, } - case 'linear_create_project_link': - if (!effectiveProjectId || !params.url?.trim()) { - throw new Error('Project ID and URL are required.') - } - return { - ...baseParams, - projectId: effectiveProjectId, - url: params.url.trim(), - label: params.name, - } - case 'linear_list_notifications': return baseParams @@ -2005,15 +2010,11 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n // Project Label Operations case 'linear_create_project_label': - if (!effectiveProjectId) { - throw new Error('Project ID is required.') - } if (!params.projectLabelName?.trim()) { throw new Error('Project label name is required.') } return { ...baseParams, - projectId: effectiveProjectId, name: params.projectLabelName.trim(), description: params.projectLabelDescription?.trim() || undefined, color: params.statusColor?.trim() || undefined, @@ -2113,17 +2114,20 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n // Project Status Operations case 'linear_create_project_status': - if (!effectiveProjectId) { - throw new Error('Project ID is required.') - } - if (!params.projectStatusName?.trim() || !params.statusColor?.trim()) { - throw new Error('Project status name and color are required.') + if ( + !params.projectStatusName?.trim() || + !params.projectStatusType?.trim() || + !params.statusColor?.trim() || + !params.projectStatusPosition?.trim() + ) { + throw new Error('Project status name, type, color, and position are required.') } return { ...baseParams, - projectId: effectiveProjectId, name: params.projectStatusName.trim(), + type: params.projectStatusType.trim(), color: params.statusColor.trim(), + position: Number.parseFloat(params.projectStatusPosition.trim()), description: params.projectStatusDescription?.trim() || undefined, indefinite: params.projectStatusIndefinite === 'true', } @@ -2290,7 +2294,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n // Project update outputs update: { type: 'json', description: 'Project update data' }, updates: { type: 'json', description: 'Project updates list' }, - link: { type: 'json', description: 'Project link data' }, // Notification outputs notification: { type: 'json', description: 'Notification data' }, notifications: { type: 'json', description: 'Notifications list' }, diff --git a/apps/sim/tools/linear/create_project_label.ts b/apps/sim/tools/linear/create_project_label.ts index b074b3133d..35cb27a52e 100644 --- a/apps/sim/tools/linear/create_project_label.ts +++ b/apps/sim/tools/linear/create_project_label.ts @@ -19,12 +19,6 @@ export const linearCreateProjectLabelTool: ToolConfig< }, params: { - projectId: { - type: 'string', - required: true, - visibility: 'user-only', - description: 'The project for this label', - }, name: { type: 'string', required: true, @@ -71,7 +65,6 @@ export const linearCreateProjectLabelTool: ToolConfig< }, body: (params) => { const input: Record = { - projectId: params.projectId, name: params.name, } diff --git a/apps/sim/tools/linear/create_project_link.ts b/apps/sim/tools/linear/create_project_link.ts deleted file mode 100644 index 00032b4283..0000000000 --- a/apps/sim/tools/linear/create_project_link.ts +++ /dev/null @@ -1,123 +0,0 @@ -import type { - LinearCreateProjectLinkParams, - LinearCreateProjectLinkResponse, -} from '@/tools/linear/types' -import type { ToolConfig } from '@/tools/types' - -export const linearCreateProjectLinkTool: ToolConfig< - LinearCreateProjectLinkParams, - LinearCreateProjectLinkResponse -> = { - id: 'linear_create_project_link', - name: 'Linear Create Project Link', - description: 'Add an external link to a project in Linear', - version: '1.0.0', - - oauth: { - required: true, - provider: 'linear', - }, - - params: { - projectId: { - type: 'string', - required: true, - visibility: 'user-or-llm', - description: 'Project ID to add link to', - }, - url: { - type: 'string', - required: true, - visibility: 'user-or-llm', - description: 'URL of the external link', - }, - label: { - type: 'string', - required: false, - visibility: 'user-or-llm', - description: 'Link label/title', - }, - }, - - request: { - url: 'https://api.linear.app/graphql', - method: 'POST', - headers: (params) => { - if (!params.accessToken) { - throw new Error('Missing access token for Linear API request') - } - return { - 'Content-Type': 'application/json', - Authorization: `Bearer ${params.accessToken}`, - } - }, - body: (params) => { - const input: Record = { - projectId: params.projectId, - url: params.url, - } - - if (params.label != null && params.label !== '') input.label = params.label - - return { - query: ` - mutation CreateProjectLink($input: ProjectLinkCreateInput!) { - projectLinkCreate(input: $input) { - success - projectLink { - id - url - label - createdAt - } - } - } - `, - variables: { - input, - }, - } - }, - }, - - transformResponse: async (response) => { - const data = await response.json() - - if (data.errors) { - return { - success: false, - error: data.errors[0]?.message || 'Failed to create project link', - output: {}, - } - } - - const result = data.data.projectLinkCreate - if (!result.success) { - return { - success: false, - error: 'Project link creation was not successful', - output: {}, - } - } - - return { - success: true, - output: { - link: result.projectLink, - }, - } - }, - - outputs: { - link: { - type: 'object', - description: 'The created project link', - properties: { - id: { type: 'string', description: 'Link ID' }, - url: { type: 'string', description: 'Link URL' }, - label: { type: 'string', description: 'Link label' }, - createdAt: { type: 'string', description: 'Creation timestamp' }, - }, - }, - }, -} diff --git a/apps/sim/tools/linear/create_project_status.ts b/apps/sim/tools/linear/create_project_status.ts index 709f16cf7d..0e782422a1 100644 --- a/apps/sim/tools/linear/create_project_status.ts +++ b/apps/sim/tools/linear/create_project_status.ts @@ -19,17 +19,18 @@ export const linearCreateProjectStatusTool: ToolConfig< }, params: { - projectId: { + name: { type: 'string', required: true, - visibility: 'user-only', - description: 'The project to create the status for', + visibility: 'user-or-llm', + description: 'Project status name', }, - name: { + type: { type: 'string', required: true, visibility: 'user-or-llm', - description: 'Project status name', + description: + 'Status type: "backlog", "planned", "started", "paused", "completed", or "canceled"', }, color: { type: 'string', @@ -37,6 +38,12 @@ export const linearCreateProjectStatusTool: ToolConfig< visibility: 'user-or-llm', description: 'Status color (hex code)', }, + position: { + type: 'number', + required: true, + visibility: 'user-or-llm', + description: 'Position in status list (e.g. 0, 1, 2...)', + }, description: { type: 'string', required: false, @@ -49,12 +56,6 @@ export const linearCreateProjectStatusTool: ToolConfig< visibility: 'user-or-llm', description: 'Whether the status is indefinite', }, - position: { - type: 'number', - required: false, - visibility: 'user-or-llm', - description: 'Position in status list', - }, }, request: { @@ -71,9 +72,10 @@ export const linearCreateProjectStatusTool: ToolConfig< }, body: (params) => { const input: Record = { - projectId: params.projectId, name: params.name, + type: params.type, color: params.color, + position: params.position, } if (params.description != null && params.description !== '') { @@ -82,9 +84,6 @@ export const linearCreateProjectStatusTool: ToolConfig< if (params.indefinite != null) { input.indefinite = params.indefinite } - if (params.position != null) { - input.position = params.position - } return { query: ` diff --git a/apps/sim/tools/linear/index.ts b/apps/sim/tools/linear/index.ts index ed0adfdf80..ab7cfaaac3 100644 --- a/apps/sim/tools/linear/index.ts +++ b/apps/sim/tools/linear/index.ts @@ -16,7 +16,6 @@ import { linearCreateIssueRelationTool } from '@/tools/linear/create_issue_relat import { linearCreateLabelTool } from '@/tools/linear/create_label' import { linearCreateProjectTool } from '@/tools/linear/create_project' import { linearCreateProjectLabelTool } from '@/tools/linear/create_project_label' -import { linearCreateProjectLinkTool } from '@/tools/linear/create_project_link' import { linearCreateProjectMilestoneTool } from '@/tools/linear/create_project_milestone' import { linearCreateProjectStatusTool } from '@/tools/linear/create_project_status' import { linearCreateProjectUpdateTool } from '@/tools/linear/create_project_update' @@ -138,7 +137,6 @@ export { linearListFavoritesTool, linearCreateProjectUpdateTool, linearListProjectUpdatesTool, - linearCreateProjectLinkTool, linearListNotificationsTool, linearUpdateNotificationTool, linearCreateCustomerTool, diff --git a/apps/sim/tools/linear/types.ts b/apps/sim/tools/linear/types.ts index de57c0ffff..b29e3187d4 100644 --- a/apps/sim/tools/linear/types.ts +++ b/apps/sim/tools/linear/types.ts @@ -454,13 +454,6 @@ export interface LinearListProjectUpdatesParams { accessToken?: string } -export interface LinearCreateProjectLinkParams { - projectId: string - url: string - label?: string - accessToken?: string -} - export interface LinearListNotificationsParams { first?: number after?: string @@ -843,19 +836,6 @@ export interface LinearListProjectUpdatesResponse extends ToolResponse { } } -export interface LinearProjectLink { - id: string - url: string - label: string - createdAt: string -} - -export interface LinearCreateProjectLinkResponse extends ToolResponse { - output: { - link?: LinearProjectLink - } -} - export interface LinearNotification { id: string type: string @@ -1205,7 +1185,6 @@ export interface LinearProjectLabel { } export interface LinearCreateProjectLabelParams { - projectId: string name: string color?: string description?: string @@ -1358,12 +1337,12 @@ export interface LinearProjectStatus { } export interface LinearCreateProjectStatusParams { - projectId: string name: string + type: 'backlog' | 'planned' | 'started' | 'paused' | 'completed' | 'canceled' color: string + position: number description?: string indefinite?: boolean - position?: number accessToken?: string } @@ -1468,7 +1447,6 @@ export type LinearResponse = | LinearListFavoritesResponse | LinearCreateProjectUpdateResponse | LinearListProjectUpdatesResponse - | LinearCreateProjectLinkResponse | LinearListNotificationsResponse | LinearUpdateNotificationResponse | LinearCreateCustomerResponse diff --git a/apps/sim/tools/registry.ts b/apps/sim/tools/registry.ts index 157325374b..6d8cb9ec2a 100644 --- a/apps/sim/tools/registry.ts +++ b/apps/sim/tools/registry.ts @@ -567,7 +567,6 @@ import { linearCreateIssueTool, linearCreateLabelTool, linearCreateProjectLabelTool, - linearCreateProjectLinkTool, linearCreateProjectMilestoneTool, linearCreateProjectStatusTool, linearCreateProjectTool, @@ -2187,7 +2186,6 @@ export const tools: Record = { linear_list_favorites: linearListFavoritesTool, linear_create_project_update: linearCreateProjectUpdateTool, linear_list_project_updates: linearListProjectUpdatesTool, - linear_create_project_link: linearCreateProjectLinkTool, linear_list_notifications: linearListNotificationsTool, linear_update_notification: linearUpdateNotificationTool, linear_create_customer: linearCreateCustomerTool,