Skip to content
Merged
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
69 changes: 46 additions & 23 deletions apps/sim/blocks/blocks/linear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
// 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' },
Expand Down Expand Up @@ -227,6 +226,7 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
'linear_update_project',
'linear_archive_project',
'linear_delete_project',
'linear_create_project_update',
'linear_list_project_updates',
],
},
Expand All @@ -239,6 +239,7 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
'linear_update_project',
'linear_archive_project',
'linear_delete_project',
'linear_create_project_update',
'linear_list_project_updates',
'linear_list_project_labels',
],
Expand All @@ -261,7 +262,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
'linear_delete_project',
'linear_create_project_update',
'linear_list_project_updates',
'linear_create_project_link',
],
},
condition: {
Expand All @@ -275,7 +275,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
'linear_delete_project',
'linear_create_project_update',
'linear_list_project_updates',
'linear_create_project_link',
'linear_list_project_labels',
],
},
Expand Down Expand Up @@ -625,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
Expand Down Expand Up @@ -1221,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',
Expand Down Expand Up @@ -1326,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',
Expand Down Expand Up @@ -1772,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

Expand Down Expand Up @@ -2033,22 +2050,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(),
}

Expand Down Expand Up @@ -2097,13 +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 (!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,
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',
}
Expand Down Expand Up @@ -2270,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' },
Expand Down
7 changes: 0 additions & 7 deletions apps/sim/tools/linear/create_project_label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -71,7 +65,6 @@ export const linearCreateProjectLabelTool: ToolConfig<
},
body: (params) => {
const input: Record<string, any> = {
projectId: params.projectId,
name: params.name,
}

Expand Down
123 changes: 0 additions & 123 deletions apps/sim/tools/linear/create_project_link.ts

This file was deleted.

29 changes: 14 additions & 15 deletions apps/sim/tools/linear/create_project_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,31 @@ 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',
required: true,
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,
Expand All @@ -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: {
Expand All @@ -71,9 +72,10 @@ export const linearCreateProjectStatusTool: ToolConfig<
},
body: (params) => {
const input: Record<string, any> = {
projectId: params.projectId,
name: params.name,
type: params.type,
color: params.color,
position: params.position,
}

if (params.description != null && params.description !== '') {
Expand All @@ -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: `
Expand Down
Loading