Skip to content

Commit 1e75f44

Browse files
author
aadamgough
committed
fixed linear bugs
1 parent 780b4fe commit 1e75f44

File tree

7 files changed

+56
-210
lines changed

7 files changed

+56
-210
lines changed

apps/sim/blocks/blocks/linear.ts

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
7777
// Project Update Operations
7878
{ label: 'Create Project Update', id: 'linear_create_project_update' },
7979
{ label: 'List Project Updates', id: 'linear_list_project_updates' },
80-
{ label: 'Create Project Link', id: 'linear_create_project_link' },
8180
// Notification Operations
8281
{ label: 'List Notifications', id: 'linear_list_notifications' },
8382
{ label: 'Update Notification', id: 'linear_update_notification' },
@@ -229,9 +228,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
229228
'linear_delete_project',
230229
'linear_create_project_update',
231230
'linear_list_project_updates',
232-
'linear_create_project_link',
233-
'linear_create_project_status',
234-
'linear_create_project_label',
235231
],
236232
},
237233
condition: {
@@ -245,9 +241,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
245241
'linear_delete_project',
246242
'linear_create_project_update',
247243
'linear_list_project_updates',
248-
'linear_create_project_link',
249-
'linear_create_project_status',
250-
'linear_create_project_label',
251244
'linear_list_project_labels',
252245
],
253246
},
@@ -269,9 +262,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
269262
'linear_delete_project',
270263
'linear_create_project_update',
271264
'linear_list_project_updates',
272-
'linear_create_project_link',
273-
'linear_create_project_status',
274-
'linear_create_project_label',
275265
],
276266
},
277267
condition: {
@@ -285,9 +275,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
285275
'linear_delete_project',
286276
'linear_create_project_update',
287277
'linear_list_project_updates',
288-
'linear_create_project_link',
289-
'linear_create_project_status',
290-
'linear_create_project_label',
291278
'linear_list_project_labels',
292279
],
293280
},
@@ -637,7 +624,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
637624
required: true,
638625
condition: {
639626
field: 'operation',
640-
value: ['linear_create_attachment', 'linear_create_project_link'],
627+
value: ['linear_create_attachment'],
641628
},
642629
},
643630
// Attachment title
@@ -1233,6 +1220,36 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
12331220
value: ['linear_create_project_status'],
12341221
},
12351222
},
1223+
{
1224+
id: 'projectStatusType',
1225+
title: 'Status Type',
1226+
type: 'dropdown',
1227+
options: [
1228+
{ label: 'Backlog', id: 'backlog' },
1229+
{ label: 'Planned', id: 'planned' },
1230+
{ label: 'Started', id: 'started' },
1231+
{ label: 'Paused', id: 'paused' },
1232+
{ label: 'Completed', id: 'completed' },
1233+
{ label: 'Canceled', id: 'canceled' },
1234+
],
1235+
value: () => 'started',
1236+
required: true,
1237+
condition: {
1238+
field: 'operation',
1239+
value: ['linear_create_project_status'],
1240+
},
1241+
},
1242+
{
1243+
id: 'projectStatusPosition',
1244+
title: 'Position',
1245+
type: 'short-input',
1246+
placeholder: 'Enter position (e.g. 0, 1, 2...)',
1247+
required: true,
1248+
condition: {
1249+
field: 'operation',
1250+
value: ['linear_create_project_status'],
1251+
},
1252+
},
12361253
{
12371254
id: 'projectStatusId',
12381255
title: 'Status ID',
@@ -1338,7 +1355,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
13381355
'linear_list_favorites',
13391356
'linear_create_project_update',
13401357
'linear_list_project_updates',
1341-
'linear_create_project_link',
13421358
'linear_list_notifications',
13431359
'linear_update_notification',
13441360
'linear_create_customer',
@@ -1784,17 +1800,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
17841800
projectId: effectiveProjectId,
17851801
}
17861802

1787-
case 'linear_create_project_link':
1788-
if (!effectiveProjectId || !params.url?.trim()) {
1789-
throw new Error('Project ID and URL are required.')
1790-
}
1791-
return {
1792-
...baseParams,
1793-
projectId: effectiveProjectId,
1794-
url: params.url.trim(),
1795-
label: params.name,
1796-
}
1797-
17981803
case 'linear_list_notifications':
17991804
return baseParams
18001805

@@ -2005,15 +2010,11 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20052010

20062011
// Project Label Operations
20072012
case 'linear_create_project_label':
2008-
if (!effectiveProjectId) {
2009-
throw new Error('Project ID is required.')
2010-
}
20112013
if (!params.projectLabelName?.trim()) {
20122014
throw new Error('Project label name is required.')
20132015
}
20142016
return {
20152017
...baseParams,
2016-
projectId: effectiveProjectId,
20172018
name: params.projectLabelName.trim(),
20182019
description: params.projectLabelDescription?.trim() || undefined,
20192020
color: params.statusColor?.trim() || undefined,
@@ -2113,17 +2114,20 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
21132114

21142115
// Project Status Operations
21152116
case 'linear_create_project_status':
2116-
if (!effectiveProjectId) {
2117-
throw new Error('Project ID is required.')
2118-
}
2119-
if (!params.projectStatusName?.trim() || !params.statusColor?.trim()) {
2120-
throw new Error('Project status name and color are required.')
2117+
if (
2118+
!params.projectStatusName?.trim() ||
2119+
!params.projectStatusType?.trim() ||
2120+
!params.statusColor?.trim() ||
2121+
!params.projectStatusPosition?.trim()
2122+
) {
2123+
throw new Error('Project status name, type, color, and position are required.')
21212124
}
21222125
return {
21232126
...baseParams,
2124-
projectId: effectiveProjectId,
21252127
name: params.projectStatusName.trim(),
2128+
type: params.projectStatusType.trim(),
21262129
color: params.statusColor.trim(),
2130+
position: Number.parseFloat(params.projectStatusPosition.trim()),
21272131
description: params.projectStatusDescription?.trim() || undefined,
21282132
indefinite: params.projectStatusIndefinite === 'true',
21292133
}
@@ -2290,7 +2294,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
22902294
// Project update outputs
22912295
update: { type: 'json', description: 'Project update data' },
22922296
updates: { type: 'json', description: 'Project updates list' },
2293-
link: { type: 'json', description: 'Project link data' },
22942297
// Notification outputs
22952298
notification: { type: 'json', description: 'Notification data' },
22962299
notifications: { type: 'json', description: 'Notifications list' },

apps/sim/tools/linear/create_project_label.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ export const linearCreateProjectLabelTool: ToolConfig<
1919
},
2020

2121
params: {
22-
projectId: {
23-
type: 'string',
24-
required: true,
25-
visibility: 'user-only',
26-
description: 'The project for this label',
27-
},
2822
name: {
2923
type: 'string',
3024
required: true,
@@ -71,7 +65,6 @@ export const linearCreateProjectLabelTool: ToolConfig<
7165
},
7266
body: (params) => {
7367
const input: Record<string, any> = {
74-
projectId: params.projectId,
7568
name: params.name,
7669
}
7770

apps/sim/tools/linear/create_project_link.ts

Lines changed: 0 additions & 123 deletions
This file was deleted.

apps/sim/tools/linear/create_project_status.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,31 @@ export const linearCreateProjectStatusTool: ToolConfig<
1919
},
2020

2121
params: {
22-
projectId: {
22+
name: {
2323
type: 'string',
2424
required: true,
25-
visibility: 'user-only',
26-
description: 'The project to create the status for',
25+
visibility: 'user-or-llm',
26+
description: 'Project status name',
2727
},
28-
name: {
28+
type: {
2929
type: 'string',
3030
required: true,
3131
visibility: 'user-or-llm',
32-
description: 'Project status name',
32+
description:
33+
'Status type: "backlog", "planned", "started", "paused", "completed", or "canceled"',
3334
},
3435
color: {
3536
type: 'string',
3637
required: true,
3738
visibility: 'user-or-llm',
3839
description: 'Status color (hex code)',
3940
},
41+
position: {
42+
type: 'number',
43+
required: true,
44+
visibility: 'user-or-llm',
45+
description: 'Position in status list (e.g. 0, 1, 2...)',
46+
},
4047
description: {
4148
type: 'string',
4249
required: false,
@@ -49,12 +56,6 @@ export const linearCreateProjectStatusTool: ToolConfig<
4956
visibility: 'user-or-llm',
5057
description: 'Whether the status is indefinite',
5158
},
52-
position: {
53-
type: 'number',
54-
required: false,
55-
visibility: 'user-or-llm',
56-
description: 'Position in status list',
57-
},
5859
},
5960

6061
request: {
@@ -71,9 +72,10 @@ export const linearCreateProjectStatusTool: ToolConfig<
7172
},
7273
body: (params) => {
7374
const input: Record<string, any> = {
74-
projectId: params.projectId,
7575
name: params.name,
76+
type: params.type,
7677
color: params.color,
78+
position: params.position,
7779
}
7880

7981
if (params.description != null && params.description !== '') {
@@ -82,9 +84,6 @@ export const linearCreateProjectStatusTool: ToolConfig<
8284
if (params.indefinite != null) {
8385
input.indefinite = params.indefinite
8486
}
85-
if (params.position != null) {
86-
input.position = params.position
87-
}
8887

8988
return {
9089
query: `

0 commit comments

Comments
 (0)