mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
fix(linear): fix remaining ops (#2087)
This commit is contained in:
@@ -44,12 +44,22 @@ Fetch and filter issues from Linear
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `teamId` | string | No | Linear team ID to filter by |
|
||||
| `projectId` | string | No | Linear project ID to filter by |
|
||||
| `assigneeId` | string | No | User ID to filter by assignee |
|
||||
| `stateId` | string | No | Workflow state ID to filter by status |
|
||||
| `priority` | number | No | Priority to filter by \(0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low\) |
|
||||
| `labelIds` | array | No | Array of label IDs to filter by |
|
||||
| `createdAfter` | string | No | Filter issues created after this date \(ISO 8601 format\) |
|
||||
| `updatedAfter` | string | No | Filter issues updated after this date \(ISO 8601 format\) |
|
||||
| `includeArchived` | boolean | No | Include archived issues \(default: false\) |
|
||||
| `first` | number | No | Number of issues to return \(default: 50, max: 250\) |
|
||||
| `after` | string | No | Pagination cursor for next page |
|
||||
| `orderBy` | string | No | Sort order: "createdAt" or "updatedAt" \(default: "updatedAt"\) |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `issues` | array | Array of issues from the specified Linear team and project, each containing id, title, description, state, teamId, and projectId |
|
||||
| `issues` | array | Array of filtered issues from Linear |
|
||||
|
||||
### `linear_get_issue`
|
||||
|
||||
@@ -79,12 +89,22 @@ Create a new issue in Linear
|
||||
| `projectId` | string | No | Linear project ID |
|
||||
| `title` | string | Yes | Issue title |
|
||||
| `description` | string | No | Issue description |
|
||||
| `stateId` | string | No | Workflow state ID \(status\) |
|
||||
| `assigneeId` | string | No | User ID to assign the issue to |
|
||||
| `priority` | number | No | Priority \(0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low\) |
|
||||
| `estimate` | number | No | Estimate in points |
|
||||
| `labelIds` | array | No | Array of label IDs to set on the issue |
|
||||
| `cycleId` | string | No | Cycle ID to assign the issue to |
|
||||
| `parentId` | string | No | Parent issue ID \(for creating sub-issues\) |
|
||||
| `dueDate` | string | No | Due date in ISO 8601 format \(date only: YYYY-MM-DD\) |
|
||||
| `subscriberIds` | array | No | Array of user IDs to subscribe to the issue |
|
||||
| `projectMilestoneId` | string | No | Project milestone ID to associate with the issue |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `issue` | object | The created issue containing id, title, description, state, teamId, and projectId |
|
||||
| `issue` | object | The created issue with all its properties |
|
||||
|
||||
### `linear_update_issue`
|
||||
|
||||
@@ -101,7 +121,13 @@ Update an existing issue in Linear
|
||||
| `assigneeId` | string | No | User ID to assign the issue to |
|
||||
| `priority` | number | No | Priority \(0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low\) |
|
||||
| `estimate` | number | No | Estimate in points |
|
||||
| `labelIds` | array | No | Array of label IDs to set on the issue |
|
||||
| `labelIds` | array | No | Array of label IDs to set on the issue \(replaces all existing labels\) |
|
||||
| `projectId` | string | No | Project ID to move the issue to |
|
||||
| `cycleId` | string | No | Cycle ID to assign the issue to |
|
||||
| `parentId` | string | No | Parent issue ID \(for making this a sub-issue\) |
|
||||
| `dueDate` | string | No | Due date in ISO 8601 format \(date only: YYYY-MM-DD\) |
|
||||
| `addedLabelIds` | array | No | Array of label IDs to add to the issue \(without replacing existing labels\) |
|
||||
| `removedLabelIds` | array | No | Array of label IDs to remove from the issue |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -352,9 +378,9 @@ Update an existing project in Linear
|
||||
| `description` | string | No | New project description |
|
||||
| `state` | string | No | Project state \(planned, started, completed, canceled\) |
|
||||
| `leadId` | string | No | User ID of the project lead |
|
||||
| `startDate` | string | No | Project start date \(ISO format\) |
|
||||
| `targetDate` | string | No | Project target date \(ISO format\) |
|
||||
| `priority` | number | No | Project priority \(0-4\) |
|
||||
| `startDate` | string | No | Project start date \(ISO format: YYYY-MM-DD\) |
|
||||
| `targetDate` | string | No | Project target date \(ISO format: YYYY-MM-DD\) |
|
||||
| `priority` | number | No | Project priority \(0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low\) |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -530,7 +556,7 @@ Create a new workflow state (status) in Linear
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `teamId` | string | Yes | Team ID to create the state in |
|
||||
| `name` | string | Yes | State name \(e.g., "In Review"\) |
|
||||
| `color` | string | Yes | State color \(hex format\) |
|
||||
| `color` | string | No | State color \(hex format\) |
|
||||
| `type` | string | Yes | State type: "backlog", "unstarted", "started", "completed", or "canceled" |
|
||||
| `description` | string | No | State description |
|
||||
| `position` | number | No | Position in the workflow |
|
||||
@@ -711,7 +737,7 @@ Link two issues together in Linear (blocks, relates to, duplicates)
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `issueId` | string | Yes | Source issue ID |
|
||||
| `relatedIssueId` | string | Yes | Target issue ID to link to |
|
||||
| `type` | string | Yes | Relation type: "blocks", "blocked", "duplicate", "related" |
|
||||
| `type` | string | Yes | Relation type: "blocks", "duplicate", or "related". Note: When creating "blocks" from A to B, the inverse relation \(B blocked by A\) is automatically created. |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -1220,6 +1246,7 @@ Create a new project label in Linear
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `projectId` | string | Yes | The project for this label |
|
||||
| `name` | string | Yes | Project label name |
|
||||
| `color` | string | No | Label color \(hex code\) |
|
||||
| `description` | string | No | Label description |
|
||||
@@ -1397,6 +1424,7 @@ Create a new project status in Linear
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `projectId` | string | Yes | The project to create the status for |
|
||||
| `name` | string | Yes | Project status name |
|
||||
| `color` | string | Yes | Status color \(hex code\) |
|
||||
| `description` | string | No | Status description |
|
||||
|
||||
@@ -39,7 +39,7 @@ export const linearArchiveLabelTool: ToolConfig<
|
||||
body: (params) => ({
|
||||
query: `
|
||||
mutation ArchiveLabel($id: String!) {
|
||||
issueLabelDelete(id: $id) {
|
||||
issueLabelArchive(id: $id) {
|
||||
success
|
||||
}
|
||||
}
|
||||
@@ -62,9 +62,9 @@ export const linearArchiveLabelTool: ToolConfig<
|
||||
}
|
||||
|
||||
return {
|
||||
success: data.data.issueLabelDelete.success,
|
||||
success: data.data.issueLabelArchive.success,
|
||||
output: {
|
||||
success: data.data.issueLabelDelete.success,
|
||||
success: data.data.issueLabelArchive.success,
|
||||
labelId: params?.labelId,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -38,6 +38,66 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Issue description',
|
||||
},
|
||||
stateId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Workflow state ID (status)',
|
||||
},
|
||||
assigneeId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'User ID to assign the issue to',
|
||||
},
|
||||
priority: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Priority (0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low)',
|
||||
},
|
||||
estimate: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Estimate in points',
|
||||
},
|
||||
labelIds: {
|
||||
type: 'array',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Array of label IDs to set on the issue',
|
||||
},
|
||||
cycleId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Cycle ID to assign the issue to',
|
||||
},
|
||||
parentId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Parent issue ID (for creating sub-issues)',
|
||||
},
|
||||
dueDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Due date in ISO 8601 format (date only: YYYY-MM-DD)',
|
||||
},
|
||||
subscriberIds: {
|
||||
type: 'array',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Array of user IDs to subscribe to the issue',
|
||||
},
|
||||
projectMilestoneId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Project milestone ID to associate with the issue',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
@@ -68,6 +128,36 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
|
||||
if (params.description != null && params.description !== '') {
|
||||
input.description = params.description
|
||||
}
|
||||
if (params.stateId != null && params.stateId !== '') {
|
||||
input.stateId = params.stateId
|
||||
}
|
||||
if (params.assigneeId != null && params.assigneeId !== '') {
|
||||
input.assigneeId = params.assigneeId
|
||||
}
|
||||
if (params.priority != null) {
|
||||
input.priority = Number(params.priority)
|
||||
}
|
||||
if (params.estimate != null) {
|
||||
input.estimate = Number(params.estimate)
|
||||
}
|
||||
if (params.labelIds != null && Array.isArray(params.labelIds)) {
|
||||
input.labelIds = params.labelIds
|
||||
}
|
||||
if (params.cycleId != null && params.cycleId !== '') {
|
||||
input.cycleId = params.cycleId
|
||||
}
|
||||
if (params.parentId != null && params.parentId !== '') {
|
||||
input.parentId = params.parentId
|
||||
}
|
||||
if (params.dueDate != null && params.dueDate !== '') {
|
||||
input.dueDate = params.dueDate
|
||||
}
|
||||
if (params.subscriberIds != null && Array.isArray(params.subscriberIds)) {
|
||||
input.subscriberIds = params.subscriberIds
|
||||
}
|
||||
if (params.projectMilestoneId != null && params.projectMilestoneId !== '') {
|
||||
input.projectMilestoneId = params.projectMilestoneId
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
@@ -77,9 +167,42 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
|
||||
id
|
||||
title
|
||||
description
|
||||
state { name }
|
||||
priority
|
||||
estimate
|
||||
url
|
||||
dueDate
|
||||
state {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
assignee {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
team { id }
|
||||
project { id }
|
||||
cycle {
|
||||
id
|
||||
number
|
||||
name
|
||||
}
|
||||
parent {
|
||||
id
|
||||
title
|
||||
}
|
||||
projectMilestone {
|
||||
id
|
||||
name
|
||||
}
|
||||
labels {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
color
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,9 +242,22 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
|
||||
id: issue.id,
|
||||
title: issue.title,
|
||||
description: issue.description,
|
||||
state: issue.state?.name,
|
||||
priority: issue.priority,
|
||||
estimate: issue.estimate,
|
||||
url: issue.url,
|
||||
dueDate: issue.dueDate,
|
||||
state: issue.state,
|
||||
assignee: issue.assignee,
|
||||
teamId: issue.team?.id,
|
||||
projectId: issue.project?.id,
|
||||
cycleId: issue.cycle?.id,
|
||||
cycleNumber: issue.cycle?.number,
|
||||
cycleName: issue.cycle?.name,
|
||||
parentId: issue.parent?.id,
|
||||
parentTitle: issue.parent?.title,
|
||||
projectMilestoneId: issue.projectMilestone?.id,
|
||||
projectMilestoneName: issue.projectMilestone?.name,
|
||||
labels: issue.labels?.nodes || [],
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -130,15 +266,27 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
|
||||
outputs: {
|
||||
issue: {
|
||||
type: 'object',
|
||||
description:
|
||||
'The created issue containing id, title, description, state, teamId, and projectId',
|
||||
description: 'The created issue with all its properties',
|
||||
properties: {
|
||||
id: { type: 'string', description: 'Issue ID' },
|
||||
title: { type: 'string', description: 'Issue title' },
|
||||
description: { type: 'string', description: 'Issue description' },
|
||||
state: { type: 'string', description: 'Issue state' },
|
||||
priority: { type: 'number', description: 'Issue priority' },
|
||||
estimate: { type: 'number', description: 'Issue estimate' },
|
||||
url: { type: 'string', description: 'Issue URL' },
|
||||
dueDate: { type: 'string', description: 'Due date (YYYY-MM-DD)' },
|
||||
state: { type: 'object', description: 'Issue state' },
|
||||
assignee: { type: 'object', description: 'Assigned user' },
|
||||
teamId: { type: 'string', description: 'Team ID' },
|
||||
projectId: { type: 'string', description: 'Project ID' },
|
||||
cycleId: { type: 'string', description: 'Cycle ID' },
|
||||
cycleNumber: { type: 'number', description: 'Cycle number' },
|
||||
cycleName: { type: 'string', description: 'Cycle name' },
|
||||
parentId: { type: 'string', description: 'Parent issue ID' },
|
||||
parentTitle: { type: 'string', description: 'Parent issue title' },
|
||||
projectMilestoneId: { type: 'string', description: 'Project milestone ID' },
|
||||
projectMilestoneName: { type: 'string', description: 'Project milestone name' },
|
||||
labels: { type: 'array', description: 'Issue labels' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -35,7 +35,8 @@ export const linearCreateIssueRelationTool: ToolConfig<
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Relation type: "blocks", "blocked", "duplicate", "related"',
|
||||
description:
|
||||
'Relation type: "blocks", "duplicate", or "related". Note: When creating "blocks" from A to B, the inverse relation (B blocked by A) is automatically created.',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@ export const linearCreateProjectLabelTool: ToolConfig<
|
||||
},
|
||||
|
||||
params: {
|
||||
projectId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'The project for this label',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
@@ -65,6 +71,7 @@ export const linearCreateProjectLabelTool: ToolConfig<
|
||||
},
|
||||
body: (params) => {
|
||||
const input: Record<string, any> = {
|
||||
projectId: params.projectId,
|
||||
name: params.name,
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@ export const linearCreateProjectStatusTool: ToolConfig<
|
||||
},
|
||||
|
||||
params: {
|
||||
projectId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'The project to create the status for',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
@@ -65,6 +71,7 @@ export const linearCreateProjectStatusTool: ToolConfig<
|
||||
},
|
||||
body: (params) => {
|
||||
const input: Record<string, any> = {
|
||||
projectId: params.projectId,
|
||||
name: params.name,
|
||||
color: params.color,
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export const linearCreateWorkflowStateTool: ToolConfig<
|
||||
},
|
||||
color: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'State color (hex format)',
|
||||
},
|
||||
@@ -73,10 +73,12 @@ export const linearCreateWorkflowStateTool: ToolConfig<
|
||||
const input: Record<string, any> = {
|
||||
teamId: params.teamId,
|
||||
name: params.name,
|
||||
color: params.color,
|
||||
type: params.type,
|
||||
}
|
||||
|
||||
if (params.color != null && params.color !== '') {
|
||||
input.color = params.color
|
||||
}
|
||||
if (params.description != null && params.description !== '') {
|
||||
input.description = params.description
|
||||
}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import type {
|
||||
LinearIssue,
|
||||
LinearReadIssuesParams,
|
||||
LinearReadIssuesResponse,
|
||||
} from '@/tools/linear/types'
|
||||
import type { LinearReadIssuesParams, LinearReadIssuesResponse } from '@/tools/linear/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const linearReadIssuesTool: ToolConfig<LinearReadIssuesParams, LinearReadIssuesResponse> = {
|
||||
@@ -29,6 +25,66 @@ export const linearReadIssuesTool: ToolConfig<LinearReadIssuesParams, LinearRead
|
||||
visibility: 'user-only',
|
||||
description: 'Linear project ID to filter by',
|
||||
},
|
||||
assigneeId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'User ID to filter by assignee',
|
||||
},
|
||||
stateId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Workflow state ID to filter by status',
|
||||
},
|
||||
priority: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Priority to filter by (0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low)',
|
||||
},
|
||||
labelIds: {
|
||||
type: 'array',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Array of label IDs to filter by',
|
||||
},
|
||||
createdAfter: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter issues created after this date (ISO 8601 format)',
|
||||
},
|
||||
updatedAfter: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter issues updated after this date (ISO 8601 format)',
|
||||
},
|
||||
includeArchived: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Include archived issues (default: false)',
|
||||
},
|
||||
first: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of issues to return (default: 50, max: 250)',
|
||||
},
|
||||
after: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pagination cursor for next page',
|
||||
},
|
||||
orderBy: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Sort order: "createdAt" or "updatedAt" (default: "updatedAt")',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
@@ -52,25 +108,107 @@ export const linearReadIssuesTool: ToolConfig<LinearReadIssuesParams, LinearRead
|
||||
if (params.projectId != null && params.projectId !== '') {
|
||||
filter.project = { id: { eq: params.projectId } }
|
||||
}
|
||||
if (params.assigneeId != null && params.assigneeId !== '') {
|
||||
filter.assignee = { id: { eq: params.assigneeId } }
|
||||
}
|
||||
if (params.stateId != null && params.stateId !== '') {
|
||||
filter.state = { id: { eq: params.stateId } }
|
||||
}
|
||||
if (params.priority != null) {
|
||||
filter.priority = { eq: Number(params.priority) }
|
||||
}
|
||||
if (params.labelIds != null && Array.isArray(params.labelIds) && params.labelIds.length > 0) {
|
||||
filter.labels = { some: { id: { in: params.labelIds } } }
|
||||
}
|
||||
if (params.createdAfter != null && params.createdAfter !== '') {
|
||||
filter.createdAt = { gte: params.createdAfter }
|
||||
}
|
||||
if (params.updatedAfter != null && params.updatedAfter !== '') {
|
||||
filter.updatedAt = { gte: params.updatedAfter }
|
||||
}
|
||||
|
||||
const variables: Record<string, any> = {}
|
||||
if (Object.keys(filter).length > 0) {
|
||||
variables.filter = filter
|
||||
}
|
||||
if (params.first != null) {
|
||||
variables.first = Math.min(Number(params.first), 250)
|
||||
}
|
||||
if (params.after != null && params.after !== '') {
|
||||
variables.after = params.after
|
||||
}
|
||||
if (params.includeArchived != null) {
|
||||
variables.includeArchived = params.includeArchived
|
||||
}
|
||||
if (params.orderBy != null) {
|
||||
variables.orderBy = params.orderBy
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
query Issues($filter: IssueFilter) {
|
||||
issues(filter: $filter) {
|
||||
query Issues(
|
||||
$filter: IssueFilter
|
||||
$first: Int
|
||||
$after: String
|
||||
$includeArchived: Boolean
|
||||
$orderBy: PaginationOrderBy
|
||||
) {
|
||||
issues(
|
||||
filter: $filter
|
||||
first: $first
|
||||
after: $after
|
||||
includeArchived: $includeArchived
|
||||
orderBy: $orderBy
|
||||
) {
|
||||
nodes {
|
||||
id
|
||||
title
|
||||
description
|
||||
state { name }
|
||||
team { id }
|
||||
project { id }
|
||||
priority
|
||||
estimate
|
||||
url
|
||||
dueDate
|
||||
createdAt
|
||||
updatedAt
|
||||
state {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
assignee {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
team {
|
||||
id
|
||||
name
|
||||
}
|
||||
project {
|
||||
id
|
||||
name
|
||||
}
|
||||
cycle {
|
||||
id
|
||||
number
|
||||
name
|
||||
}
|
||||
labels {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
color
|
||||
}
|
||||
}
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
filter: Object.keys(filter).length > 0 ? filter : undefined,
|
||||
},
|
||||
variables,
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -94,17 +232,35 @@ export const linearReadIssuesTool: ToolConfig<LinearReadIssuesParams, LinearRead
|
||||
}
|
||||
}
|
||||
|
||||
const issues = data.data.issues.nodes || []
|
||||
const pageInfo = data.data.issues.pageInfo || {}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
issues: (data.data.issues.nodes as LinearIssue[]).map((issue) => ({
|
||||
issues: issues.map((issue: any) => ({
|
||||
id: issue.id,
|
||||
title: issue.title,
|
||||
description: issue.description,
|
||||
priority: issue.priority,
|
||||
estimate: issue.estimate,
|
||||
url: issue.url,
|
||||
dueDate: issue.dueDate,
|
||||
createdAt: issue.createdAt,
|
||||
updatedAt: issue.updatedAt,
|
||||
state: issue.state,
|
||||
teamId: issue.teamId,
|
||||
projectId: issue.projectId,
|
||||
assignee: issue.assignee,
|
||||
teamId: issue.team?.id,
|
||||
teamName: issue.team?.name,
|
||||
projectId: issue.project?.id,
|
||||
projectName: issue.project?.name,
|
||||
cycleId: issue.cycle?.id,
|
||||
cycleNumber: issue.cycle?.number,
|
||||
cycleName: issue.cycle?.name,
|
||||
labels: issue.labels?.nodes || [],
|
||||
})),
|
||||
hasNextPage: pageInfo.hasNextPage,
|
||||
endCursor: pageInfo.endCursor,
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -112,19 +268,39 @@ export const linearReadIssuesTool: ToolConfig<LinearReadIssuesParams, LinearRead
|
||||
outputs: {
|
||||
issues: {
|
||||
type: 'array',
|
||||
description:
|
||||
'Array of issues from the specified Linear team and project, each containing id, title, description, state, teamId, and projectId',
|
||||
description: 'Array of filtered issues from Linear',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string', description: 'Issue ID' },
|
||||
title: { type: 'string', description: 'Issue title' },
|
||||
description: { type: 'string', description: 'Issue description' },
|
||||
state: { type: 'string', description: 'Issue state' },
|
||||
priority: { type: 'number', description: 'Issue priority' },
|
||||
estimate: { type: 'number', description: 'Issue estimate' },
|
||||
url: { type: 'string', description: 'Issue URL' },
|
||||
dueDate: { type: 'string', description: 'Due date (YYYY-MM-DD)' },
|
||||
createdAt: { type: 'string', description: 'Creation timestamp' },
|
||||
updatedAt: { type: 'string', description: 'Last update timestamp' },
|
||||
state: { type: 'object', description: 'Issue state' },
|
||||
assignee: { type: 'object', description: 'Assigned user' },
|
||||
teamId: { type: 'string', description: 'Team ID' },
|
||||
teamName: { type: 'string', description: 'Team name' },
|
||||
projectId: { type: 'string', description: 'Project ID' },
|
||||
projectName: { type: 'string', description: 'Project name' },
|
||||
cycleId: { type: 'string', description: 'Cycle ID' },
|
||||
cycleNumber: { type: 'number', description: 'Cycle number' },
|
||||
cycleName: { type: 'string', description: 'Cycle name' },
|
||||
labels: { type: 'array', description: 'Issue labels' },
|
||||
},
|
||||
},
|
||||
},
|
||||
hasNextPage: {
|
||||
type: 'boolean',
|
||||
description: 'Whether there are more results available',
|
||||
},
|
||||
endCursor: {
|
||||
type: 'string',
|
||||
description: 'Cursor for fetching the next page (use as "after" parameter)',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -128,8 +128,18 @@ export interface LinearCycle {
|
||||
// ===== Request Params =====
|
||||
|
||||
export interface LinearReadIssuesParams {
|
||||
teamId: string
|
||||
projectId: string
|
||||
teamId?: string
|
||||
projectId?: string
|
||||
assigneeId?: string
|
||||
stateId?: string
|
||||
priority?: number
|
||||
labelIds?: string[]
|
||||
createdAfter?: string
|
||||
updatedAfter?: string
|
||||
includeArchived?: boolean
|
||||
first?: number
|
||||
after?: string
|
||||
orderBy?: 'createdAt' | 'updatedAt'
|
||||
accessToken?: string
|
||||
}
|
||||
|
||||
@@ -140,9 +150,19 @@ export interface LinearGetIssueParams {
|
||||
|
||||
export interface LinearCreateIssueParams {
|
||||
teamId: string
|
||||
projectId: string
|
||||
projectId?: string
|
||||
title: string
|
||||
description?: string
|
||||
stateId?: string
|
||||
assigneeId?: string
|
||||
priority?: number
|
||||
estimate?: number
|
||||
labelIds?: string[]
|
||||
cycleId?: string
|
||||
parentId?: string
|
||||
dueDate?: string
|
||||
subscriberIds?: string[]
|
||||
projectMilestoneId?: string
|
||||
accessToken?: string
|
||||
}
|
||||
|
||||
@@ -155,6 +175,12 @@ export interface LinearUpdateIssueParams {
|
||||
priority?: number
|
||||
estimate?: number
|
||||
labelIds?: string[]
|
||||
projectId?: string
|
||||
cycleId?: string
|
||||
parentId?: string
|
||||
dueDate?: string
|
||||
addedLabelIds?: string[]
|
||||
removedLabelIds?: string[]
|
||||
accessToken?: string
|
||||
}
|
||||
|
||||
@@ -313,7 +339,7 @@ export interface LinearListWorkflowStatesParams {
|
||||
export interface LinearCreateWorkflowStateParams {
|
||||
teamId: string
|
||||
name: string
|
||||
color: string
|
||||
color?: string
|
||||
type: string
|
||||
description?: string
|
||||
position?: number
|
||||
@@ -371,7 +397,7 @@ export interface LinearListAttachmentsParams {
|
||||
|
||||
export interface LinearUpdateAttachmentParams {
|
||||
attachmentId: string
|
||||
title?: string
|
||||
title: string
|
||||
subtitle?: string
|
||||
accessToken?: string
|
||||
}
|
||||
@@ -1179,6 +1205,7 @@ export interface LinearProjectLabel {
|
||||
}
|
||||
|
||||
export interface LinearCreateProjectLabelParams {
|
||||
projectId: string
|
||||
name: string
|
||||
color?: string
|
||||
description?: string
|
||||
@@ -1331,6 +1358,7 @@ export interface LinearProjectStatus {
|
||||
}
|
||||
|
||||
export interface LinearCreateProjectStatusParams {
|
||||
projectId: string
|
||||
name: string
|
||||
color: string
|
||||
description?: string
|
||||
|
||||
@@ -56,7 +56,9 @@ export const linearUpdateAttachmentTool: ToolConfig<
|
||||
title: params.title,
|
||||
}
|
||||
|
||||
if (params.subtitle != null && params.subtitle !== '') input.subtitle = params.subtitle
|
||||
if (params.subtitle != null && params.subtitle !== '') {
|
||||
input.subtitle = params.subtitle
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
|
||||
@@ -60,7 +60,43 @@ export const linearUpdateIssueTool: ToolConfig<LinearUpdateIssueParams, LinearUp
|
||||
type: 'array',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Array of label IDs to set on the issue',
|
||||
description: 'Array of label IDs to set on the issue (replaces all existing labels)',
|
||||
},
|
||||
projectId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Project ID to move the issue to',
|
||||
},
|
||||
cycleId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Cycle ID to assign the issue to',
|
||||
},
|
||||
parentId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Parent issue ID (for making this a sub-issue)',
|
||||
},
|
||||
dueDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Due date in ISO 8601 format (date only: YYYY-MM-DD)',
|
||||
},
|
||||
addedLabelIds: {
|
||||
type: 'array',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Array of label IDs to add to the issue (without replacing existing labels)',
|
||||
},
|
||||
removedLabelIds: {
|
||||
type: 'array',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Array of label IDs to remove from the issue',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -100,6 +136,24 @@ export const linearUpdateIssueTool: ToolConfig<LinearUpdateIssueParams, LinearUp
|
||||
if (params.labelIds != null && Array.isArray(params.labelIds)) {
|
||||
input.labelIds = params.labelIds
|
||||
}
|
||||
if (params.projectId != null && params.projectId !== '') {
|
||||
input.projectId = params.projectId
|
||||
}
|
||||
if (params.cycleId != null && params.cycleId !== '') {
|
||||
input.cycleId = params.cycleId
|
||||
}
|
||||
if (params.parentId != null && params.parentId !== '') {
|
||||
input.parentId = params.parentId
|
||||
}
|
||||
if (params.dueDate != null && params.dueDate !== '') {
|
||||
input.dueDate = params.dueDate
|
||||
}
|
||||
if (params.addedLabelIds != null && Array.isArray(params.addedLabelIds)) {
|
||||
input.addedLabelIds = params.addedLabelIds
|
||||
}
|
||||
if (params.removedLabelIds != null && Array.isArray(params.removedLabelIds)) {
|
||||
input.removedLabelIds = params.removedLabelIds
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
@@ -114,6 +168,7 @@ export const linearUpdateIssueTool: ToolConfig<LinearUpdateIssueParams, LinearUp
|
||||
estimate
|
||||
url
|
||||
updatedAt
|
||||
dueDate
|
||||
state {
|
||||
id
|
||||
name
|
||||
@@ -130,6 +185,15 @@ export const linearUpdateIssueTool: ToolConfig<LinearUpdateIssueParams, LinearUp
|
||||
project {
|
||||
id
|
||||
}
|
||||
cycle {
|
||||
id
|
||||
number
|
||||
name
|
||||
}
|
||||
parent {
|
||||
id
|
||||
title
|
||||
}
|
||||
labels {
|
||||
nodes {
|
||||
id
|
||||
@@ -181,10 +245,16 @@ export const linearUpdateIssueTool: ToolConfig<LinearUpdateIssueParams, LinearUp
|
||||
estimate: issue.estimate,
|
||||
url: issue.url,
|
||||
updatedAt: issue.updatedAt,
|
||||
dueDate: issue.dueDate,
|
||||
state: issue.state,
|
||||
assignee: issue.assignee,
|
||||
teamId: issue.team?.id,
|
||||
projectId: issue.project?.id,
|
||||
cycleId: issue.cycle?.id,
|
||||
cycleNumber: issue.cycle?.number,
|
||||
cycleName: issue.cycle?.name,
|
||||
parentId: issue.parent?.id,
|
||||
parentTitle: issue.parent?.title,
|
||||
labels: issue.labels?.nodes || [],
|
||||
},
|
||||
},
|
||||
@@ -205,6 +275,13 @@ export const linearUpdateIssueTool: ToolConfig<LinearUpdateIssueParams, LinearUp
|
||||
assignee: { type: 'object', description: 'Assigned user' },
|
||||
labels: { type: 'array', description: 'Issue labels' },
|
||||
updatedAt: { type: 'string', description: 'Last update timestamp' },
|
||||
dueDate: { type: 'string', description: 'Due date (YYYY-MM-DD)' },
|
||||
projectId: { type: 'string', description: 'Project ID' },
|
||||
cycleId: { type: 'string', description: 'Cycle ID' },
|
||||
cycleNumber: { type: 'number', description: 'Cycle number' },
|
||||
cycleName: { type: 'string', description: 'Cycle name' },
|
||||
parentId: { type: 'string', description: 'Parent issue ID' },
|
||||
parentTitle: { type: 'string', description: 'Parent issue title' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -50,19 +50,19 @@ export const linearUpdateProjectTool: ToolConfig<
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Project start date (ISO format)',
|
||||
description: 'Project start date (ISO format: YYYY-MM-DD)',
|
||||
},
|
||||
targetDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Project target date (ISO format)',
|
||||
description: 'Project target date (ISO format: YYYY-MM-DD)',
|
||||
},
|
||||
priority: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Project priority (0-4)',
|
||||
description: 'Project priority (0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low)',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -189,6 +189,8 @@ export const linearUpdateProjectTool: ToolConfig<
|
||||
description: { type: 'string', description: 'Project description' },
|
||||
state: { type: 'string', description: 'Project state' },
|
||||
priority: { type: 'number', description: 'Project priority' },
|
||||
startDate: { type: 'string', description: 'Project start date' },
|
||||
targetDate: { type: 'string', description: 'Project target date' },
|
||||
lead: { type: 'object', description: 'Project lead' },
|
||||
teams: { type: 'array', description: 'Associated teams' },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user