@alasano/pi-linear 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +14 -2
  2. package/assets/linear_list_issues.png +0 -0
  3. package/assets/screenshot.png +0 -0
  4. package/extensions/renderers/comments.ts +323 -0
  5. package/extensions/renderers/common.ts +305 -0
  6. package/extensions/renderers/documents.ts +326 -0
  7. package/extensions/renderers/initiatives.ts +344 -0
  8. package/extensions/renderers/issue-labels.ts +294 -0
  9. package/extensions/renderers/issue-relations.ts +318 -0
  10. package/extensions/renderers/issue-statuses.ts +199 -0
  11. package/extensions/renderers/issues.ts +373 -0
  12. package/extensions/renderers/milestones.ts +294 -0
  13. package/extensions/renderers/project-labels.ts +279 -0
  14. package/extensions/renderers/project-relations.ts +344 -0
  15. package/extensions/renderers/projects.ts +430 -0
  16. package/extensions/renderers/state.ts +35 -0
  17. package/extensions/renderers/teams.ts +246 -0
  18. package/extensions/renderers/users.ts +242 -0
  19. package/extensions/renderers/workspaces.ts +44 -0
  20. package/extensions/settings.ts +40 -7
  21. package/extensions/tools/comments.ts +17 -0
  22. package/extensions/tools/documents.ts +23 -0
  23. package/extensions/tools/initiatives.ts +24 -0
  24. package/extensions/tools/issue-labels.ts +17 -0
  25. package/extensions/tools/issue-relations.ts +17 -0
  26. package/extensions/tools/issue-statuses.ts +6 -0
  27. package/extensions/tools/issues.ts +29 -0
  28. package/extensions/tools/milestones.ts +18 -0
  29. package/extensions/tools/project-labels.ts +17 -0
  30. package/extensions/tools/project-relations.ts +17 -0
  31. package/extensions/tools/projects.ts +24 -0
  32. package/extensions/tools/teams.ts +10 -0
  33. package/extensions/tools/users.ts +10 -0
  34. package/extensions/tools/workspaces.ts +6 -0
  35. package/package.json +1 -1
@@ -5,6 +5,15 @@ import { PaginationParams, FilterParam, RawInputParam, TeamConvenienceParams } f
5
5
  import { ISSUE_LABEL_SELECTION } from '../selections';
6
6
  import type { JsonObject } from '../types';
7
7
  import { compactObject, asObject, asString, mergeFilters } from '../util';
8
+ import {
9
+ renderLinearCreateIssueLabelCall,
10
+ renderLinearDeleteIssueLabelCall,
11
+ renderLinearIssueLabelDeleteResult,
12
+ renderLinearIssueLabelListCall,
13
+ renderLinearIssueLabelListResult,
14
+ renderLinearIssueLabelResult,
15
+ renderLinearUpdateIssueLabelCall,
16
+ } from '../renderers/issue-labels';
8
17
 
9
18
  export function issueLabelTools() {
10
19
  return [
@@ -17,6 +26,7 @@ export function issueLabelTools() {
17
26
  ...PaginationParams,
18
27
  ...FilterParam,
19
28
  }),
29
+ renderCall: renderLinearIssueLabelListCall,
20
30
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
21
31
  return withLinearAuth(ctx, signal, async (apiKey) => {
22
32
  const resolvedTeamId =
@@ -82,6 +92,7 @@ export function issueLabelTools() {
82
92
  };
83
93
  });
84
94
  },
95
+ renderResult: renderLinearIssueLabelListResult,
85
96
  }),
86
97
  defineTool({
87
98
  name: 'linear_create_issue_label',
@@ -100,6 +111,7 @@ export function issueLabelTools() {
100
111
  replaceTeamLabels: Type.Optional(Type.Boolean()),
101
112
  ...RawInputParam,
102
113
  }),
114
+ renderCall: renderLinearCreateIssueLabelCall,
103
115
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
104
116
  return withLinearAuth(ctx, signal, async (apiKey) => {
105
117
  const rawInput = asObject(params.input) || {};
@@ -166,6 +178,7 @@ export function issueLabelTools() {
166
178
  };
167
179
  });
168
180
  },
181
+ renderResult: renderLinearIssueLabelResult('Created issue label'),
169
182
  }),
170
183
  defineTool({
171
184
  name: 'linear_update_issue_label',
@@ -182,6 +195,7 @@ export function issueLabelTools() {
182
195
  replaceTeamLabels: Type.Optional(Type.Boolean()),
183
196
  ...RawInputParam,
184
197
  }),
198
+ renderCall: renderLinearUpdateIssueLabelCall,
185
199
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
186
200
  return withLinearAuth(ctx, signal, async (apiKey) => {
187
201
  const rawInput = asObject(params.input) || {};
@@ -235,6 +249,7 @@ export function issueLabelTools() {
235
249
  };
236
250
  });
237
251
  },
252
+ renderResult: renderLinearIssueLabelResult('Updated issue label'),
238
253
  }),
239
254
  defineTool({
240
255
  name: 'linear_delete_issue_label',
@@ -243,6 +258,7 @@ export function issueLabelTools() {
243
258
  parameters: Type.Object({
244
259
  id: Type.String(),
245
260
  }),
261
+ renderCall: renderLinearDeleteIssueLabelCall,
246
262
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
247
263
  return withLinearAuth(ctx, signal, async (apiKey) => {
248
264
  const data = await linearGraphQL<{
@@ -268,6 +284,7 @@ export function issueLabelTools() {
268
284
  };
269
285
  });
270
286
  },
287
+ renderResult: renderLinearIssueLabelDeleteResult,
271
288
  }),
272
289
  ];
273
290
  }
@@ -5,6 +5,15 @@ import { PaginationParams } from '../params';
5
5
  import { ISSUE_RELATION_SELECTION } from '../selections';
6
6
  import type { JsonObject } from '../types';
7
7
  import { compactObject } from '../util';
8
+ import {
9
+ renderLinearCreateIssueRelationCall,
10
+ renderLinearDeleteIssueRelationCall,
11
+ renderLinearDeleteIssueRelationResult,
12
+ renderLinearIssueRelationListCall,
13
+ renderLinearIssueRelationListResult,
14
+ renderLinearIssueRelationResult,
15
+ renderLinearUpdateIssueRelationCall,
16
+ } from '../renderers/issue-relations';
8
17
 
9
18
  export function issueRelationTools() {
10
19
  return [
@@ -15,6 +24,7 @@ export function issueRelationTools() {
15
24
  parameters: Type.Object({
16
25
  ...PaginationParams,
17
26
  }),
27
+ renderCall: renderLinearIssueRelationListCall,
18
28
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
19
29
  return withLinearAuth(ctx, signal, async (apiKey) => {
20
30
  const variables = compactObject({
@@ -62,6 +72,7 @@ export function issueRelationTools() {
62
72
  };
63
73
  });
64
74
  },
75
+ renderResult: renderLinearIssueRelationListResult,
65
76
  }),
66
77
  defineTool({
67
78
  name: 'linear_create_issue_relation',
@@ -78,6 +89,7 @@ export function issueRelationTools() {
78
89
  description: 'Relation type: blocks, duplicate, related, or similar.',
79
90
  }),
80
91
  }),
92
+ renderCall: renderLinearCreateIssueRelationCall,
81
93
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
82
94
  return withLinearAuth(ctx, signal, async (apiKey) => {
83
95
  const input = {
@@ -116,6 +128,7 @@ export function issueRelationTools() {
116
128
  };
117
129
  });
118
130
  },
131
+ renderResult: renderLinearIssueRelationResult('Created issue relation'),
119
132
  }),
120
133
  defineTool({
121
134
  name: 'linear_update_issue_relation',
@@ -127,6 +140,7 @@ export function issueRelationTools() {
127
140
  issueId: Type.Optional(Type.String()),
128
141
  relatedIssueId: Type.Optional(Type.String()),
129
142
  }),
143
+ renderCall: renderLinearUpdateIssueRelationCall,
130
144
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
131
145
  return withLinearAuth(ctx, signal, async (apiKey) => {
132
146
  const [resolvedIssueId, resolvedRelatedIssueId] = await Promise.all([
@@ -176,6 +190,7 @@ export function issueRelationTools() {
176
190
  };
177
191
  });
178
192
  },
193
+ renderResult: renderLinearIssueRelationResult('Updated issue relation'),
179
194
  }),
180
195
  defineTool({
181
196
  name: 'linear_delete_issue_relation',
@@ -184,6 +199,7 @@ export function issueRelationTools() {
184
199
  parameters: Type.Object({
185
200
  id: Type.String(),
186
201
  }),
202
+ renderCall: renderLinearDeleteIssueRelationCall,
187
203
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
188
204
  return withLinearAuth(ctx, signal, async (apiKey) => {
189
205
  const data = await linearGraphQL<{
@@ -209,6 +225,7 @@ export function issueRelationTools() {
209
225
  };
210
226
  });
211
227
  },
228
+ renderResult: renderLinearDeleteIssueRelationResult,
212
229
  }),
213
230
  ];
214
231
  }
@@ -5,6 +5,10 @@ import { PaginationParams, FilterParam } from '../params';
5
5
  import { WORKFLOW_STATE_SELECTION } from '../selections';
6
6
  import type { JsonObject } from '../types';
7
7
  import { compactObject, asObject } from '../util';
8
+ import {
9
+ renderLinearIssueStatusListCall,
10
+ renderLinearIssueStatusListResult,
11
+ } from '../renderers/issue-statuses';
8
12
 
9
13
  export function issueStatusTools() {
10
14
  return [
@@ -17,6 +21,7 @@ export function issueStatusTools() {
17
21
  ...PaginationParams,
18
22
  ...FilterParam,
19
23
  }),
24
+ renderCall: renderLinearIssueStatusListCall,
20
25
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
21
26
  return withLinearAuth(ctx, signal, async (apiKey) => {
22
27
  const variables = compactObject({
@@ -67,6 +72,7 @@ export function issueStatusTools() {
67
72
  };
68
73
  });
69
74
  },
75
+ renderResult: renderLinearIssueStatusListResult,
70
76
  }),
71
77
  ];
72
78
  }
@@ -17,6 +17,19 @@ import {
17
17
  import { ISSUE_SELECTION } from '../selections';
18
18
  import type { LinearIssue, JsonObject } from '../types';
19
19
  import { compactObject, asObject, asObjectArray, asString, mergeFilters } from '../util';
20
+ import {
21
+ renderLinearArchiveIssueCall,
22
+ renderLinearCreateIssueCall,
23
+ renderLinearDeleteIssueCall,
24
+ renderLinearGetIssueCall,
25
+ renderLinearIssueListCall,
26
+ renderLinearIssueListResult,
27
+ renderLinearIssueResult,
28
+ renderLinearIssueSearchCall,
29
+ renderLinearIssueSuccessResult,
30
+ renderLinearUnarchiveIssueCall,
31
+ renderLinearUpdateIssueCall,
32
+ } from '../renderers/issues';
20
33
 
21
34
  export function issueTools() {
22
35
  return [
@@ -46,6 +59,7 @@ export function issueTools() {
46
59
  ...FilterParam,
47
60
  ...SortParam,
48
61
  }),
62
+ renderCall: renderLinearIssueListCall,
49
63
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
50
64
  return withLinearAuth(ctx, signal, async (apiKey) => {
51
65
  const convenienceFilter = compactObject({
@@ -113,6 +127,7 @@ export function issueTools() {
113
127
  };
114
128
  });
115
129
  },
130
+ renderResult: renderLinearIssueListResult,
116
131
  }),
117
132
  defineTool({
118
133
  name: 'linear_get_issue',
@@ -123,6 +138,7 @@ export function issueTools() {
123
138
  description: 'Issue identifier (ENG-123) or issue id.',
124
139
  }),
125
140
  }),
141
+ renderCall: renderLinearGetIssueCall,
126
142
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
127
143
  return withLinearAuth(ctx, signal, async (apiKey) => {
128
144
  const issueRef = params.issue.trim();
@@ -149,6 +165,7 @@ export function issueTools() {
149
165
  };
150
166
  });
151
167
  },
168
+ renderResult: renderLinearIssueResult('Issue'),
152
169
  }),
153
170
  defineTool({
154
171
  name: 'linear_create_issue',
@@ -232,6 +249,7 @@ export function issueTools() {
232
249
  ),
233
250
  ...RawInputParam,
234
251
  }),
252
+ renderCall: renderLinearCreateIssueCall,
235
253
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
236
254
  return withLinearAuth(ctx, signal, async (apiKey) => {
237
255
  const rawInput = asObject(params.input) || {};
@@ -320,6 +338,7 @@ export function issueTools() {
320
338
  };
321
339
  });
322
340
  },
341
+ renderResult: renderLinearIssueResult('Created issue'),
323
342
  }),
324
343
  defineTool({
325
344
  name: 'linear_update_issue',
@@ -404,6 +423,7 @@ export function issueTools() {
404
423
  trashed: Type.Optional(Type.Boolean({ description: 'IssueUpdateInput.trashed' })),
405
424
  ...RawInputParam,
406
425
  }),
426
+ renderCall: renderLinearUpdateIssueCall,
407
427
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
408
428
  return withLinearAuth(ctx, signal, async (apiKey) => {
409
429
  const issueId = await resolveIssueId(apiKey, params.issue, signal);
@@ -484,6 +504,7 @@ export function issueTools() {
484
504
  };
485
505
  });
486
506
  },
507
+ renderResult: renderLinearIssueResult('Updated issue'),
487
508
  }),
488
509
  defineTool({
489
510
  name: 'linear_delete_issue',
@@ -495,6 +516,7 @@ export function issueTools() {
495
516
  }),
496
517
  permanentlyDelete: Type.Optional(Type.Boolean()),
497
518
  }),
519
+ renderCall: renderLinearDeleteIssueCall,
498
520
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
499
521
  return withLinearAuth(ctx, signal, async (apiKey) => {
500
522
  const issueId = await resolveIssueId(apiKey, params.issue, signal);
@@ -522,6 +544,7 @@ export function issueTools() {
522
544
  };
523
545
  });
524
546
  },
547
+ renderResult: renderLinearIssueSuccessResult('Deleted'),
525
548
  }),
526
549
  defineTool({
527
550
  name: 'linear_archive_issue',
@@ -534,6 +557,7 @@ export function issueTools() {
534
557
  }),
535
558
  trash: Type.Optional(Type.Boolean()),
536
559
  }),
560
+ renderCall: renderLinearArchiveIssueCall,
537
561
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
538
562
  return withLinearAuth(ctx, signal, async (apiKey) => {
539
563
  const issueId = await resolveIssueId(apiKey, params.issue, signal);
@@ -561,6 +585,7 @@ export function issueTools() {
561
585
  };
562
586
  });
563
587
  },
588
+ renderResult: renderLinearIssueSuccessResult('Archived'),
564
589
  }),
565
590
  defineTool({
566
591
  name: 'linear_unarchive_issue',
@@ -571,6 +596,7 @@ export function issueTools() {
571
596
  description: 'Issue identifier (ENG-123) or issue id.',
572
597
  }),
573
598
  }),
599
+ renderCall: renderLinearUnarchiveIssueCall,
574
600
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
575
601
  return withLinearAuth(ctx, signal, async (apiKey) => {
576
602
  const issueId = await resolveIssueId(apiKey, params.issue, signal);
@@ -598,6 +624,7 @@ export function issueTools() {
598
624
  };
599
625
  });
600
626
  },
627
+ renderResult: renderLinearIssueSuccessResult('Unarchived'),
601
628
  }),
602
629
  defineTool({
603
630
  name: 'linear_search_issues',
@@ -610,6 +637,7 @@ export function issueTools() {
610
637
  ...PaginationParams,
611
638
  ...FilterParam,
612
639
  }),
640
+ renderCall: renderLinearIssueSearchCall,
613
641
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
614
642
  return withLinearAuth(ctx, signal, async (apiKey) => {
615
643
  const variables = compactObject({
@@ -669,6 +697,7 @@ export function issueTools() {
669
697
  };
670
698
  });
671
699
  },
700
+ renderResult: renderLinearIssueListResult,
672
701
  }),
673
702
  ];
674
703
  }
@@ -5,6 +5,16 @@ import { PaginationParams, FilterParam, RawInputParam } from '../params';
5
5
  import { MILESTONE_SELECTION } from '../selections';
6
6
  import type { JsonObject } from '../types';
7
7
  import { compactObject, asObject, asString, GenericObjectSchema } from '../util';
8
+ import {
9
+ renderLinearMilestoneDeleteCall,
10
+ renderLinearMilestoneDeleteResult,
11
+ renderLinearMilestoneGetCall,
12
+ renderLinearMilestoneListCall,
13
+ renderLinearMilestoneListResult,
14
+ renderLinearMilestoneResult,
15
+ renderLinearMilestoneSaveCall,
16
+ renderLinearMilestoneSaveResult,
17
+ } from '../renderers/milestones';
8
18
 
9
19
  export function milestoneTools() {
10
20
  return [
@@ -16,6 +26,7 @@ export function milestoneTools() {
16
26
  ...PaginationParams,
17
27
  ...FilterParam,
18
28
  }),
29
+ renderCall: renderLinearMilestoneListCall,
19
30
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
20
31
  return withLinearAuth(ctx, signal, async (apiKey) => {
21
32
  const variables = compactObject({
@@ -66,6 +77,7 @@ export function milestoneTools() {
66
77
  };
67
78
  });
68
79
  },
80
+ renderResult: renderLinearMilestoneListResult,
69
81
  }),
70
82
  defineTool({
71
83
  name: 'linear_get_milestone',
@@ -74,6 +86,7 @@ export function milestoneTools() {
74
86
  parameters: Type.Object({
75
87
  milestoneId: Type.String(),
76
88
  }),
89
+ renderCall: renderLinearMilestoneGetCall,
77
90
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
78
91
  return withLinearAuth(ctx, signal, async (apiKey) => {
79
92
  const data = await linearGraphQL<{
@@ -98,6 +111,7 @@ export function milestoneTools() {
98
111
  };
99
112
  });
100
113
  },
114
+ renderResult: renderLinearMilestoneResult('Milestone'),
101
115
  }),
102
116
  defineTool({
103
117
  name: 'linear_save_milestone',
@@ -115,6 +129,7 @@ export function milestoneTools() {
115
129
  targetDate: Type.Optional(Type.String()),
116
130
  ...RawInputParam,
117
131
  }),
132
+ renderCall: renderLinearMilestoneSaveCall,
118
133
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
119
134
  return withLinearAuth(ctx, signal, async (apiKey) => {
120
135
  const rawInput = asObject(params.input) || {};
@@ -212,6 +227,7 @@ export function milestoneTools() {
212
227
  };
213
228
  });
214
229
  },
230
+ renderResult: renderLinearMilestoneSaveResult(),
215
231
  }),
216
232
  defineTool({
217
233
  name: 'linear_delete_milestone',
@@ -220,6 +236,7 @@ export function milestoneTools() {
220
236
  parameters: Type.Object({
221
237
  milestoneId: Type.String(),
222
238
  }),
239
+ renderCall: renderLinearMilestoneDeleteCall,
223
240
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
224
241
  return withLinearAuth(ctx, signal, async (apiKey) => {
225
242
  const data = await linearGraphQL<{
@@ -245,6 +262,7 @@ export function milestoneTools() {
245
262
  };
246
263
  });
247
264
  },
265
+ renderResult: renderLinearMilestoneDeleteResult,
248
266
  }),
249
267
  ];
250
268
  }
@@ -5,6 +5,15 @@ import { PaginationParams, FilterParam, RawInputParam } from '../params';
5
5
  import { PROJECT_LABEL_SELECTION } from '../selections';
6
6
  import type { JsonObject } from '../types';
7
7
  import { compactObject, asObject, asString } from '../util';
8
+ import {
9
+ renderLinearCreateProjectLabelCall,
10
+ renderLinearDeleteProjectLabelCall,
11
+ renderLinearProjectLabelDeleteResult,
12
+ renderLinearProjectLabelListCall,
13
+ renderLinearProjectLabelListResult,
14
+ renderLinearProjectLabelResult,
15
+ renderLinearUpdateProjectLabelCall,
16
+ } from '../renderers/project-labels';
8
17
 
9
18
  export function projectLabelTools() {
10
19
  return [
@@ -16,6 +25,7 @@ export function projectLabelTools() {
16
25
  ...PaginationParams,
17
26
  ...FilterParam,
18
27
  }),
28
+ renderCall: renderLinearProjectLabelListCall,
19
29
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
20
30
  return withLinearAuth(ctx, signal, async (apiKey) => {
21
31
  const variables = compactObject({
@@ -66,6 +76,7 @@ export function projectLabelTools() {
66
76
  };
67
77
  });
68
78
  },
79
+ renderResult: renderLinearProjectLabelListResult,
69
80
  }),
70
81
  defineTool({
71
82
  name: 'linear_create_project_label',
@@ -79,6 +90,7 @@ export function projectLabelTools() {
79
90
  isGroup: Type.Optional(Type.Boolean()),
80
91
  ...RawInputParam,
81
92
  }),
93
+ renderCall: renderLinearCreateProjectLabelCall,
82
94
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
83
95
  return withLinearAuth(ctx, signal, async (apiKey) => {
84
96
  const rawInput = asObject(params.input) || {};
@@ -127,6 +139,7 @@ export function projectLabelTools() {
127
139
  };
128
140
  });
129
141
  },
142
+ renderResult: renderLinearProjectLabelResult('Created project label'),
130
143
  }),
131
144
  defineTool({
132
145
  name: 'linear_update_project_label',
@@ -141,6 +154,7 @@ export function projectLabelTools() {
141
154
  isGroup: Type.Optional(Type.Boolean()),
142
155
  ...RawInputParam,
143
156
  }),
157
+ renderCall: renderLinearUpdateProjectLabelCall,
144
158
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
145
159
  return withLinearAuth(ctx, signal, async (apiKey) => {
146
160
  const rawInput = asObject(params.input) || {};
@@ -189,6 +203,7 @@ export function projectLabelTools() {
189
203
  };
190
204
  });
191
205
  },
206
+ renderResult: renderLinearProjectLabelResult('Updated project label'),
192
207
  }),
193
208
  defineTool({
194
209
  name: 'linear_delete_project_label',
@@ -197,6 +212,7 @@ export function projectLabelTools() {
197
212
  parameters: Type.Object({
198
213
  id: Type.String(),
199
214
  }),
215
+ renderCall: renderLinearDeleteProjectLabelCall,
200
216
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
201
217
  return withLinearAuth(ctx, signal, async (apiKey) => {
202
218
  const data = await linearGraphQL<{
@@ -222,6 +238,7 @@ export function projectLabelTools() {
222
238
  };
223
239
  });
224
240
  },
241
+ renderResult: renderLinearProjectLabelDeleteResult,
225
242
  }),
226
243
  ];
227
244
  }
@@ -5,6 +5,15 @@ import { PaginationParams } from '../params';
5
5
  import { PROJECT_RELATION_SELECTION } from '../selections';
6
6
  import type { JsonObject } from '../types';
7
7
  import { compactObject } from '../util';
8
+ import {
9
+ renderLinearCreateProjectRelationCall,
10
+ renderLinearDeleteProjectRelationCall,
11
+ renderLinearDeleteProjectRelationResult,
12
+ renderLinearProjectRelationListCall,
13
+ renderLinearProjectRelationListResult,
14
+ renderLinearProjectRelationResult,
15
+ renderLinearUpdateProjectRelationCall,
16
+ } from '../renderers/project-relations';
8
17
 
9
18
  export function projectRelationTools() {
10
19
  return [
@@ -15,6 +24,7 @@ export function projectRelationTools() {
15
24
  parameters: Type.Object({
16
25
  ...PaginationParams,
17
26
  }),
27
+ renderCall: renderLinearProjectRelationListCall,
18
28
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
19
29
  return withLinearAuth(ctx, signal, async (apiKey) => {
20
30
  const variables = compactObject({
@@ -62,6 +72,7 @@ export function projectRelationTools() {
62
72
  };
63
73
  });
64
74
  },
75
+ renderResult: renderLinearProjectRelationListResult,
65
76
  }),
66
77
  defineTool({
67
78
  name: 'linear_create_project_relation',
@@ -78,6 +89,7 @@ export function projectRelationTools() {
78
89
  projectMilestoneId: Type.Optional(Type.String()),
79
90
  relatedProjectMilestoneId: Type.Optional(Type.String()),
80
91
  }),
92
+ renderCall: renderLinearCreateProjectRelationCall,
81
93
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
82
94
  return withLinearAuth(ctx, signal, async (apiKey) => {
83
95
  const input = compactObject({
@@ -120,6 +132,7 @@ export function projectRelationTools() {
120
132
  };
121
133
  });
122
134
  },
135
+ renderResult: renderLinearProjectRelationResult('Created project relation'),
123
136
  }),
124
137
  defineTool({
125
138
  name: 'linear_update_project_relation',
@@ -135,6 +148,7 @@ export function projectRelationTools() {
135
148
  projectMilestoneId: Type.Optional(Type.String()),
136
149
  relatedProjectMilestoneId: Type.Optional(Type.String()),
137
150
  }),
151
+ renderCall: renderLinearUpdateProjectRelationCall,
138
152
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
139
153
  return withLinearAuth(ctx, signal, async (apiKey) => {
140
154
  const input = compactObject({
@@ -181,6 +195,7 @@ export function projectRelationTools() {
181
195
  };
182
196
  });
183
197
  },
198
+ renderResult: renderLinearProjectRelationResult('Updated project relation'),
184
199
  }),
185
200
  defineTool({
186
201
  name: 'linear_delete_project_relation',
@@ -189,6 +204,7 @@ export function projectRelationTools() {
189
204
  parameters: Type.Object({
190
205
  id: Type.String(),
191
206
  }),
207
+ renderCall: renderLinearDeleteProjectRelationCall,
192
208
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
193
209
  return withLinearAuth(ctx, signal, async (apiKey) => {
194
210
  const data = await linearGraphQL<{
@@ -214,6 +230,7 @@ export function projectRelationTools() {
214
230
  };
215
231
  });
216
232
  },
233
+ renderResult: renderLinearDeleteProjectRelationResult,
217
234
  }),
218
235
  ];
219
236
  }
@@ -5,6 +5,18 @@ import { PaginationParams, FilterParam, SortParam, RawInputParam } from '../para
5
5
  import { PROJECT_SELECTION } from '../selections';
6
6
  import type { JsonObject } from '../types';
7
7
  import { compactObject, asObject, asObjectArray, asString } from '../util';
8
+ import {
9
+ renderLinearArchiveProjectCall,
10
+ renderLinearDeleteProjectCall,
11
+ renderLinearGetProjectCall,
12
+ renderLinearProjectListCall,
13
+ renderLinearProjectListResult,
14
+ renderLinearProjectResult,
15
+ renderLinearProjectSuccessResult,
16
+ renderLinearSaveProjectCall,
17
+ renderLinearSaveProjectResult,
18
+ renderLinearUnarchiveProjectCall,
19
+ } from '../renderers/projects';
8
20
 
9
21
  export function projectTools() {
10
22
  return [
@@ -17,6 +29,7 @@ export function projectTools() {
17
29
  ...FilterParam,
18
30
  ...SortParam,
19
31
  }),
32
+ renderCall: renderLinearProjectListCall,
20
33
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
21
34
  return withLinearAuth(ctx, signal, async (apiKey) => {
22
35
  const variables = compactObject({
@@ -70,6 +83,7 @@ export function projectTools() {
70
83
  };
71
84
  });
72
85
  },
86
+ renderResult: renderLinearProjectListResult,
73
87
  }),
74
88
  defineTool({
75
89
  name: 'linear_get_project',
@@ -78,6 +92,7 @@ export function projectTools() {
78
92
  parameters: Type.Object({
79
93
  projectId: Type.String({ description: 'Project id.' }),
80
94
  }),
95
+ renderCall: renderLinearGetProjectCall,
81
96
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
82
97
  return withLinearAuth(ctx, signal, async (apiKey) => {
83
98
  const data = await linearGraphQL<{ project: JsonObject | null }>(
@@ -100,6 +115,7 @@ export function projectTools() {
100
115
  };
101
116
  });
102
117
  },
118
+ renderResult: renderLinearProjectResult('Project'),
103
119
  }),
104
120
  defineTool({
105
121
  name: 'linear_save_project',
@@ -145,6 +161,7 @@ export function projectTools() {
145
161
  slackChannelName: Type.Optional(Type.String()),
146
162
  ...RawInputParam,
147
163
  }),
164
+ renderCall: renderLinearSaveProjectCall,
148
165
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
149
166
  return withLinearAuth(ctx, signal, async (apiKey) => {
150
167
  const rawInput = asObject(params.input) || {};
@@ -260,6 +277,7 @@ export function projectTools() {
260
277
  };
261
278
  });
262
279
  },
280
+ renderResult: renderLinearSaveProjectResult,
263
281
  }),
264
282
  defineTool({
265
283
  name: 'linear_delete_project',
@@ -268,6 +286,7 @@ export function projectTools() {
268
286
  parameters: Type.Object({
269
287
  projectId: Type.String(),
270
288
  }),
289
+ renderCall: renderLinearDeleteProjectCall,
271
290
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
272
291
  return withLinearAuth(ctx, signal, async (apiKey) => {
273
292
  const data = await linearGraphQL<{
@@ -293,6 +312,7 @@ export function projectTools() {
293
312
  };
294
313
  });
295
314
  },
315
+ renderResult: renderLinearProjectSuccessResult('Deleted'),
296
316
  }),
297
317
  defineTool({
298
318
  name: 'linear_archive_project',
@@ -302,6 +322,7 @@ export function projectTools() {
302
322
  projectId: Type.String(),
303
323
  trash: Type.Optional(Type.Boolean()),
304
324
  }),
325
+ renderCall: renderLinearArchiveProjectCall,
305
326
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
306
327
  return withLinearAuth(ctx, signal, async (apiKey) => {
307
328
  const data = await linearGraphQL<{
@@ -327,6 +348,7 @@ export function projectTools() {
327
348
  };
328
349
  });
329
350
  },
351
+ renderResult: renderLinearProjectSuccessResult('Archived'),
330
352
  }),
331
353
  defineTool({
332
354
  name: 'linear_unarchive_project',
@@ -335,6 +357,7 @@ export function projectTools() {
335
357
  parameters: Type.Object({
336
358
  projectId: Type.String(),
337
359
  }),
360
+ renderCall: renderLinearUnarchiveProjectCall,
338
361
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
339
362
  return withLinearAuth(ctx, signal, async (apiKey) => {
340
363
  const data = await linearGraphQL<{
@@ -360,6 +383,7 @@ export function projectTools() {
360
383
  };
361
384
  });
362
385
  },
386
+ renderResult: renderLinearProjectSuccessResult('Unarchived'),
363
387
  }),
364
388
  ];
365
389
  }