@alasano/pi-linear 0.1.0 → 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 (36) 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/index.ts +1 -1
  5. package/extensions/renderers/comments.ts +323 -0
  6. package/extensions/renderers/common.ts +305 -0
  7. package/extensions/renderers/documents.ts +326 -0
  8. package/extensions/renderers/initiatives.ts +344 -0
  9. package/extensions/renderers/issue-labels.ts +294 -0
  10. package/extensions/renderers/issue-relations.ts +318 -0
  11. package/extensions/renderers/issue-statuses.ts +199 -0
  12. package/extensions/renderers/issues.ts +373 -0
  13. package/extensions/renderers/milestones.ts +294 -0
  14. package/extensions/renderers/project-labels.ts +279 -0
  15. package/extensions/renderers/project-relations.ts +344 -0
  16. package/extensions/renderers/projects.ts +430 -0
  17. package/extensions/renderers/state.ts +35 -0
  18. package/extensions/renderers/teams.ts +246 -0
  19. package/extensions/renderers/users.ts +242 -0
  20. package/extensions/renderers/workspaces.ts +44 -0
  21. package/extensions/settings.ts +53 -23
  22. package/extensions/tools/comments.ts +17 -0
  23. package/extensions/tools/documents.ts +23 -0
  24. package/extensions/tools/initiatives.ts +24 -0
  25. package/extensions/tools/issue-labels.ts +17 -0
  26. package/extensions/tools/issue-relations.ts +29 -5
  27. package/extensions/tools/issue-statuses.ts +6 -0
  28. package/extensions/tools/issues.ts +29 -0
  29. package/extensions/tools/milestones.ts +18 -0
  30. package/extensions/tools/project-labels.ts +17 -0
  31. package/extensions/tools/project-relations.ts +17 -0
  32. package/extensions/tools/projects.ts +25 -1
  33. package/extensions/tools/teams.ts +11 -3
  34. package/extensions/tools/users.ts +10 -0
  35. package/extensions/tools/workspaces.ts +6 -0
  36. package/package.json +1 -1
@@ -5,6 +5,18 @@ import { PaginationParams, FilterParam, SortParam, RawInputParam } from '../para
5
5
  import { INITIATIVE_SELECTION } from '../selections';
6
6
  import type { JsonObject } from '../types';
7
7
  import { compactObject, asObject, asObjectArray, asString } from '../util';
8
+ import {
9
+ renderLinearArchiveInitiativeCall,
10
+ renderLinearDeleteInitiativeCall,
11
+ renderLinearGetInitiativeCall,
12
+ renderLinearInitiativeListCall,
13
+ renderLinearInitiativeListResult,
14
+ renderLinearInitiativeResult,
15
+ renderLinearInitiativeSuccessResult,
16
+ renderLinearSaveInitiativeCall,
17
+ renderLinearSaveInitiativeResult,
18
+ renderLinearUnarchiveInitiativeCall,
19
+ } from '../renderers/initiatives';
8
20
 
9
21
  export function initiativeTools() {
10
22
  return [
@@ -17,6 +29,7 @@ export function initiativeTools() {
17
29
  ...FilterParam,
18
30
  ...SortParam,
19
31
  }),
32
+ renderCall: renderLinearInitiativeListCall,
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 initiativeTools() {
70
83
  };
71
84
  });
72
85
  },
86
+ renderResult: renderLinearInitiativeListResult,
73
87
  }),
74
88
  defineTool({
75
89
  name: 'linear_get_initiative',
@@ -78,6 +92,7 @@ export function initiativeTools() {
78
92
  parameters: Type.Object({
79
93
  initiativeId: Type.String(),
80
94
  }),
95
+ renderCall: renderLinearGetInitiativeCall,
81
96
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
82
97
  return withLinearAuth(ctx, signal, async (apiKey) => {
83
98
  const data = await linearGraphQL<{ initiative: JsonObject | null }>(
@@ -100,6 +115,7 @@ export function initiativeTools() {
100
115
  };
101
116
  });
102
117
  },
118
+ renderResult: renderLinearInitiativeResult('Initiative'),
103
119
  }),
104
120
  defineTool({
105
121
  name: 'linear_save_initiative',
@@ -127,6 +143,7 @@ export function initiativeTools() {
127
143
  updateRemindersHour: Type.Optional(Type.Integer()),
128
144
  ...RawInputParam,
129
145
  }),
146
+ renderCall: renderLinearSaveInitiativeCall,
130
147
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
131
148
  return withLinearAuth(ctx, signal, async (apiKey) => {
132
149
  const rawInput = asObject(params.input) || {};
@@ -224,6 +241,7 @@ export function initiativeTools() {
224
241
  };
225
242
  });
226
243
  },
244
+ renderResult: renderLinearSaveInitiativeResult,
227
245
  }),
228
246
  defineTool({
229
247
  name: 'linear_delete_initiative',
@@ -232,6 +250,7 @@ export function initiativeTools() {
232
250
  parameters: Type.Object({
233
251
  initiativeId: Type.String(),
234
252
  }),
253
+ renderCall: renderLinearDeleteInitiativeCall,
235
254
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
236
255
  return withLinearAuth(ctx, signal, async (apiKey) => {
237
256
  const data = await linearGraphQL<{
@@ -257,6 +276,7 @@ export function initiativeTools() {
257
276
  };
258
277
  });
259
278
  },
279
+ renderResult: renderLinearInitiativeSuccessResult('Deleted'),
260
280
  }),
261
281
  defineTool({
262
282
  name: 'linear_archive_initiative',
@@ -265,6 +285,7 @@ export function initiativeTools() {
265
285
  parameters: Type.Object({
266
286
  initiativeId: Type.String(),
267
287
  }),
288
+ renderCall: renderLinearArchiveInitiativeCall,
268
289
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
269
290
  return withLinearAuth(ctx, signal, async (apiKey) => {
270
291
  const data = await linearGraphQL<{
@@ -290,6 +311,7 @@ export function initiativeTools() {
290
311
  };
291
312
  });
292
313
  },
314
+ renderResult: renderLinearInitiativeSuccessResult('Archived'),
293
315
  }),
294
316
  defineTool({
295
317
  name: 'linear_unarchive_initiative',
@@ -298,6 +320,7 @@ export function initiativeTools() {
298
320
  parameters: Type.Object({
299
321
  initiativeId: Type.String(),
300
322
  }),
323
+ renderCall: renderLinearUnarchiveInitiativeCall,
301
324
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
302
325
  return withLinearAuth(ctx, signal, async (apiKey) => {
303
326
  const data = await linearGraphQL<{
@@ -323,6 +346,7 @@ export function initiativeTools() {
323
346
  };
324
347
  });
325
348
  },
349
+ renderResult: renderLinearInitiativeSuccessResult('Unarchived'),
326
350
  }),
327
351
  ];
328
352
  }
@@ -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
  }
@@ -1,10 +1,19 @@
1
1
  import { defineTool } from '@mariozechner/pi-coding-agent';
2
2
  import { Type } from '@sinclair/typebox';
3
- import { withLinearAuth, linearGraphQL } from '../client';
3
+ import { withLinearAuth, linearGraphQL, resolveIssueId } from '../client';
4
4
  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,11 +89,12 @@ 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 = {
84
- issueId: params.issueId,
85
- relatedIssueId: params.relatedIssueId,
96
+ issueId: await resolveIssueId(apiKey, params.issueId, signal),
97
+ relatedIssueId: await resolveIssueId(apiKey, params.relatedIssueId, signal),
86
98
  type: params.type,
87
99
  };
88
100
 
@@ -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,12 +140,20 @@ 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) => {
146
+ const [resolvedIssueId, resolvedRelatedIssueId] = await Promise.all([
147
+ params.issueId ? resolveIssueId(apiKey, params.issueId, signal) : undefined,
148
+ params.relatedIssueId
149
+ ? resolveIssueId(apiKey, params.relatedIssueId, signal)
150
+ : undefined,
151
+ ]);
152
+
132
153
  const input = compactObject({
133
154
  type: params.type,
134
- issueId: params.issueId,
135
- relatedIssueId: params.relatedIssueId,
155
+ issueId: resolvedIssueId,
156
+ relatedIssueId: resolvedRelatedIssueId,
136
157
  });
137
158
 
138
159
  if (Object.keys(input).length === 0) {
@@ -169,6 +190,7 @@ export function issueRelationTools() {
169
190
  };
170
191
  });
171
192
  },
193
+ renderResult: renderLinearIssueRelationResult('Updated issue relation'),
172
194
  }),
173
195
  defineTool({
174
196
  name: 'linear_delete_issue_relation',
@@ -177,6 +199,7 @@ export function issueRelationTools() {
177
199
  parameters: Type.Object({
178
200
  id: Type.String(),
179
201
  }),
202
+ renderCall: renderLinearDeleteIssueRelationCall,
180
203
  async execute(_toolCallId, params, signal, _onUpdate, ctx) {
181
204
  return withLinearAuth(ctx, signal, async (apiKey) => {
182
205
  const data = await linearGraphQL<{
@@ -202,6 +225,7 @@ export function issueRelationTools() {
202
225
  };
203
226
  });
204
227
  },
228
+ renderResult: renderLinearDeleteIssueRelationResult,
205
229
  }),
206
230
  ];
207
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
  }