@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.
- package/README.md +14 -2
- package/assets/linear_list_issues.png +0 -0
- package/assets/screenshot.png +0 -0
- package/extensions/index.ts +1 -1
- package/extensions/renderers/comments.ts +323 -0
- package/extensions/renderers/common.ts +305 -0
- package/extensions/renderers/documents.ts +326 -0
- package/extensions/renderers/initiatives.ts +344 -0
- package/extensions/renderers/issue-labels.ts +294 -0
- package/extensions/renderers/issue-relations.ts +318 -0
- package/extensions/renderers/issue-statuses.ts +199 -0
- package/extensions/renderers/issues.ts +373 -0
- package/extensions/renderers/milestones.ts +294 -0
- package/extensions/renderers/project-labels.ts +279 -0
- package/extensions/renderers/project-relations.ts +344 -0
- package/extensions/renderers/projects.ts +430 -0
- package/extensions/renderers/state.ts +35 -0
- package/extensions/renderers/teams.ts +246 -0
- package/extensions/renderers/users.ts +242 -0
- package/extensions/renderers/workspaces.ts +44 -0
- package/extensions/settings.ts +53 -23
- package/extensions/tools/comments.ts +17 -0
- package/extensions/tools/documents.ts +23 -0
- package/extensions/tools/initiatives.ts +24 -0
- package/extensions/tools/issue-labels.ts +17 -0
- package/extensions/tools/issue-relations.ts +29 -5
- package/extensions/tools/issue-statuses.ts +6 -0
- package/extensions/tools/issues.ts +29 -0
- package/extensions/tools/milestones.ts +18 -0
- package/extensions/tools/project-labels.ts +17 -0
- package/extensions/tools/project-relations.ts +17 -0
- package/extensions/tools/projects.ts +25 -1
- package/extensions/tools/teams.ts +11 -3
- package/extensions/tools/users.ts +10 -0
- package/extensions/tools/workspaces.ts +6 -0
- package/package.json +1 -1
|
@@ -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,12 +115,13 @@ export function projectTools() {
|
|
|
100
115
|
};
|
|
101
116
|
});
|
|
102
117
|
},
|
|
118
|
+
renderResult: renderLinearProjectResult('Project'),
|
|
103
119
|
}),
|
|
104
120
|
defineTool({
|
|
105
121
|
name: 'linear_save_project',
|
|
106
122
|
label: 'Linear Save Project',
|
|
107
123
|
description:
|
|
108
|
-
'Create or update a project.
|
|
124
|
+
'Create or update a project. Pass projectId to update an existing project; omit it to create. The id param is only for pre-setting a UUID on create.',
|
|
109
125
|
parameters: Type.Object({
|
|
110
126
|
projectId: Type.Optional(Type.String({ description: 'Project id for update mode.' })),
|
|
111
127
|
id: Type.Optional(Type.String({ description: 'ProjectCreateInput.id' })),
|
|
@@ -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
|
}
|
|
@@ -5,6 +5,12 @@ import { PaginationParams, FilterParam } from '../params';
|
|
|
5
5
|
import { TEAM_SELECTION } from '../selections';
|
|
6
6
|
import type { LinearTeam, JsonObject } from '../types';
|
|
7
7
|
import { compactObject, asObject } from '../util';
|
|
8
|
+
import {
|
|
9
|
+
renderLinearGetTeamCall,
|
|
10
|
+
renderLinearTeamListCall,
|
|
11
|
+
renderLinearTeamListResult,
|
|
12
|
+
renderLinearTeamResult,
|
|
13
|
+
} from '../renderers/teams';
|
|
8
14
|
|
|
9
15
|
export function teamTools() {
|
|
10
16
|
return [
|
|
@@ -17,6 +23,7 @@ export function teamTools() {
|
|
|
17
23
|
...PaginationParams,
|
|
18
24
|
...FilterParam,
|
|
19
25
|
}),
|
|
26
|
+
renderCall: renderLinearTeamListCall,
|
|
20
27
|
async execute(_toolCallId, params, signal, _onUpdate, ctx) {
|
|
21
28
|
return withLinearAuth(ctx, signal, async (apiKey) => {
|
|
22
29
|
const variables = compactObject({
|
|
@@ -50,9 +57,7 @@ export function teamTools() {
|
|
|
50
57
|
orderBy: $orderBy
|
|
51
58
|
) {
|
|
52
59
|
nodes {
|
|
53
|
-
|
|
54
|
-
key
|
|
55
|
-
name
|
|
60
|
+
${TEAM_SELECTION}
|
|
56
61
|
states(first: 50) {
|
|
57
62
|
nodes {
|
|
58
63
|
id
|
|
@@ -74,6 +79,7 @@ export function teamTools() {
|
|
|
74
79
|
};
|
|
75
80
|
});
|
|
76
81
|
},
|
|
82
|
+
renderResult: renderLinearTeamListResult,
|
|
77
83
|
}),
|
|
78
84
|
defineTool({
|
|
79
85
|
name: 'linear_get_team',
|
|
@@ -82,6 +88,7 @@ export function teamTools() {
|
|
|
82
88
|
parameters: Type.Object({
|
|
83
89
|
teamId: Type.String(),
|
|
84
90
|
}),
|
|
91
|
+
renderCall: renderLinearGetTeamCall,
|
|
85
92
|
async execute(_toolCallId, params, signal, _onUpdate, ctx) {
|
|
86
93
|
return withLinearAuth(ctx, signal, async (apiKey) => {
|
|
87
94
|
const data = await linearGraphQL<{ team: JsonObject | null }>(
|
|
@@ -102,6 +109,7 @@ export function teamTools() {
|
|
|
102
109
|
};
|
|
103
110
|
});
|
|
104
111
|
},
|
|
112
|
+
renderResult: renderLinearTeamResult('Team'),
|
|
105
113
|
}),
|
|
106
114
|
];
|
|
107
115
|
}
|
|
@@ -5,6 +5,12 @@ import { PaginationParams, FilterParam, SortParam } from '../params';
|
|
|
5
5
|
import { USER_SELECTION } from '../selections';
|
|
6
6
|
import type { JsonObject } from '../types';
|
|
7
7
|
import { compactObject, asObject, asObjectArray } from '../util';
|
|
8
|
+
import {
|
|
9
|
+
renderLinearGetUserCall,
|
|
10
|
+
renderLinearUserListCall,
|
|
11
|
+
renderLinearUserListResult,
|
|
12
|
+
renderLinearUserResult,
|
|
13
|
+
} from '../renderers/users';
|
|
8
14
|
|
|
9
15
|
export function userTools() {
|
|
10
16
|
return [
|
|
@@ -18,6 +24,7 @@ export function userTools() {
|
|
|
18
24
|
...SortParam,
|
|
19
25
|
includeDisabled: Type.Optional(Type.Boolean()),
|
|
20
26
|
}),
|
|
27
|
+
renderCall: renderLinearUserListCall,
|
|
21
28
|
async execute(_toolCallId, params, signal, _onUpdate, ctx) {
|
|
22
29
|
return withLinearAuth(ctx, signal, async (apiKey) => {
|
|
23
30
|
const variables = compactObject({
|
|
@@ -74,6 +81,7 @@ export function userTools() {
|
|
|
74
81
|
};
|
|
75
82
|
});
|
|
76
83
|
},
|
|
84
|
+
renderResult: renderLinearUserListResult,
|
|
77
85
|
}),
|
|
78
86
|
defineTool({
|
|
79
87
|
name: 'linear_get_user',
|
|
@@ -82,6 +90,7 @@ export function userTools() {
|
|
|
82
90
|
parameters: Type.Object({
|
|
83
91
|
userId: Type.String(),
|
|
84
92
|
}),
|
|
93
|
+
renderCall: renderLinearGetUserCall,
|
|
85
94
|
async execute(_toolCallId, params, signal, _onUpdate, ctx) {
|
|
86
95
|
return withLinearAuth(ctx, signal, async (apiKey) => {
|
|
87
96
|
const data = await linearGraphQL<{ user: JsonObject | null }>(
|
|
@@ -102,6 +111,7 @@ export function userTools() {
|
|
|
102
111
|
};
|
|
103
112
|
});
|
|
104
113
|
},
|
|
114
|
+
renderResult: renderLinearUserResult,
|
|
105
115
|
}),
|
|
106
116
|
];
|
|
107
117
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { defineTool } from '@mariozechner/pi-coding-agent';
|
|
2
2
|
import { Type } from '@sinclair/typebox';
|
|
3
3
|
import { switchWorkspace, type WorkspaceCredentials } from '../client';
|
|
4
|
+
import {
|
|
5
|
+
renderLinearSwitchWorkspaceCall,
|
|
6
|
+
renderLinearSwitchWorkspaceResult,
|
|
7
|
+
} from '../renderers/workspaces';
|
|
4
8
|
|
|
5
9
|
export function workspaceTools(creds: WorkspaceCredentials) {
|
|
6
10
|
const names = Object.keys(creds.workspaces);
|
|
@@ -16,6 +20,7 @@ export function workspaceTools(creds: WorkspaceCredentials) {
|
|
|
16
20
|
description: `Workspace name to switch to. One of: ${names.join(', ')}`,
|
|
17
21
|
}),
|
|
18
22
|
}),
|
|
23
|
+
renderCall: renderLinearSwitchWorkspaceCall,
|
|
19
24
|
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
20
25
|
const updated = await switchWorkspace(params.name);
|
|
21
26
|
return {
|
|
@@ -28,6 +33,7 @@ export function workspaceTools(creds: WorkspaceCredentials) {
|
|
|
28
33
|
details: { active: updated.activeWorkspace },
|
|
29
34
|
};
|
|
30
35
|
},
|
|
36
|
+
renderResult: renderLinearSwitchWorkspaceResult,
|
|
31
37
|
}),
|
|
32
38
|
];
|
|
33
39
|
}
|