@opentabs-dev/opentabs-plugin-linear 0.0.81 → 0.0.83
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/dist/adapter.iife.js +17268 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +92 -2
- package/dist/index.js.map +1 -1
- package/dist/tools/add-issue-label.d.ts +28 -0
- package/dist/tools/add-issue-label.d.ts.map +1 -0
- package/dist/tools/add-issue-label.js +56 -0
- package/dist/tools/add-issue-label.js.map +1 -0
- package/dist/tools/add-issue-subscriber.d.ts +8 -0
- package/dist/tools/add-issue-subscriber.d.ts.map +1 -0
- package/dist/tools/add-issue-subscriber.js +29 -0
- package/dist/tools/add-issue-subscriber.js.map +1 -0
- package/dist/tools/batch-update-issues.d.ts +35 -0
- package/dist/tools/batch-update-issues.d.ts.map +1 -0
- package/dist/tools/batch-update-issues.js +80 -0
- package/dist/tools/batch-update-issues.js.map +1 -0
- package/dist/tools/create-attachment.d.ts +19 -0
- package/dist/tools/create-attachment.d.ts.map +1 -0
- package/dist/tools/create-attachment.js +45 -0
- package/dist/tools/create-attachment.js.map +1 -0
- package/dist/tools/create-document.d.ts +21 -0
- package/dist/tools/create-document.d.ts.map +1 -0
- package/dist/tools/create-document.js +46 -0
- package/dist/tools/create-document.js.map +1 -0
- package/dist/tools/create-initiative.d.ts +26 -0
- package/dist/tools/create-initiative.d.ts.map +1 -0
- package/dist/tools/create-initiative.js +50 -0
- package/dist/tools/create-initiative.js.map +1 -0
- package/dist/tools/create-issue-relation.d.ts +18 -0
- package/dist/tools/create-issue-relation.d.ts.map +1 -0
- package/dist/tools/create-issue-relation.js +53 -0
- package/dist/tools/create-issue-relation.js.map +1 -0
- package/dist/tools/create-milestone.d.ts +16 -0
- package/dist/tools/create-milestone.d.ts.map +1 -0
- package/dist/tools/create-milestone.js +45 -0
- package/dist/tools/create-milestone.js.map +1 -0
- package/dist/tools/create-project-update.d.ts +20 -0
- package/dist/tools/create-project-update.d.ts.map +1 -0
- package/dist/tools/create-project-update.js +37 -0
- package/dist/tools/create-project-update.js.map +1 -0
- package/dist/tools/delete-attachment.d.ts +7 -0
- package/dist/tools/delete-attachment.d.ts.map +1 -0
- package/dist/tools/delete-attachment.js +28 -0
- package/dist/tools/delete-attachment.js.map +1 -0
- package/dist/tools/delete-comment.d.ts +7 -0
- package/dist/tools/delete-comment.d.ts.map +1 -0
- package/dist/tools/delete-comment.js +28 -0
- package/dist/tools/delete-comment.js.map +1 -0
- package/dist/tools/delete-issue-relation.d.ts +7 -0
- package/dist/tools/delete-issue-relation.d.ts.map +1 -0
- package/dist/tools/delete-issue-relation.js +28 -0
- package/dist/tools/delete-issue-relation.js.map +1 -0
- package/dist/tools/delete-label.d.ts +7 -0
- package/dist/tools/delete-label.d.ts.map +1 -0
- package/dist/tools/delete-label.js +28 -0
- package/dist/tools/delete-label.js.map +1 -0
- package/dist/tools/delete-project-update.d.ts +7 -0
- package/dist/tools/delete-project-update.d.ts.map +1 -0
- package/dist/tools/delete-project-update.js +28 -0
- package/dist/tools/delete-project-update.js.map +1 -0
- package/dist/tools/get-attachment.d.ts +16 -0
- package/dist/tools/get-attachment.d.ts.map +1 -0
- package/dist/tools/get-attachment.js +30 -0
- package/dist/tools/get-attachment.js.map +1 -0
- package/dist/tools/get-cycle.d.ts +15 -0
- package/dist/tools/get-cycle.d.ts.map +1 -0
- package/dist/tools/get-cycle.js +29 -0
- package/dist/tools/get-cycle.js.map +1 -0
- package/dist/tools/get-document.d.ts +18 -0
- package/dist/tools/get-document.d.ts.map +1 -0
- package/dist/tools/get-document.js +31 -0
- package/dist/tools/get-document.js.map +1 -0
- package/dist/tools/get-initiative.d.ts +30 -0
- package/dist/tools/get-initiative.d.ts.map +1 -0
- package/dist/tools/get-initiative.js +42 -0
- package/dist/tools/get-initiative.js.map +1 -0
- package/dist/tools/get-milestone.d.ts +13 -0
- package/dist/tools/get-milestone.d.ts.map +1 -0
- package/dist/tools/get-milestone.js +29 -0
- package/dist/tools/get-milestone.js.map +1 -0
- package/dist/tools/get-team.d.ts +12 -0
- package/dist/tools/get-team.d.ts.map +1 -0
- package/dist/tools/get-team.js +29 -0
- package/dist/tools/get-team.js.map +1 -0
- package/dist/tools/get-user.d.ts +14 -0
- package/dist/tools/get-user.d.ts.map +1 -0
- package/dist/tools/get-user.js +29 -0
- package/dist/tools/get-user.js.map +1 -0
- package/dist/tools/list-attachments.d.ts +22 -0
- package/dist/tools/list-attachments.d.ts.map +1 -0
- package/dist/tools/list-attachments.js +46 -0
- package/dist/tools/list-attachments.js.map +1 -0
- package/dist/tools/list-documents.d.ts +24 -0
- package/dist/tools/list-documents.d.ts.map +1 -0
- package/dist/tools/list-documents.js +49 -0
- package/dist/tools/list-documents.js.map +1 -0
- package/dist/tools/list-initiatives.d.ts +28 -0
- package/dist/tools/list-initiatives.d.ts.map +1 -0
- package/dist/tools/list-initiatives.js +48 -0
- package/dist/tools/list-initiatives.js.map +1 -0
- package/dist/tools/list-issue-history.d.ts +23 -0
- package/dist/tools/list-issue-history.d.ts.map +1 -0
- package/dist/tools/list-issue-history.js +52 -0
- package/dist/tools/list-issue-history.js.map +1 -0
- package/dist/tools/list-milestones.d.ts +13 -0
- package/dist/tools/list-milestones.d.ts.map +1 -0
- package/dist/tools/list-milestones.js +35 -0
- package/dist/tools/list-milestones.js.map +1 -0
- package/dist/tools/list-project-labels.d.ts +14 -0
- package/dist/tools/list-project-labels.d.ts.map +1 -0
- package/dist/tools/list-project-labels.js +36 -0
- package/dist/tools/list-project-labels.js.map +1 -0
- package/dist/tools/list-project-updates.d.ts +20 -0
- package/dist/tools/list-project-updates.d.ts.map +1 -0
- package/dist/tools/list-project-updates.js +46 -0
- package/dist/tools/list-project-updates.js.map +1 -0
- package/dist/tools/list-sub-issues.d.ts +33 -0
- package/dist/tools/list-sub-issues.d.ts.map +1 -0
- package/dist/tools/list-sub-issues.js +53 -0
- package/dist/tools/list-sub-issues.js.map +1 -0
- package/dist/tools/list-team-members.d.ts +20 -0
- package/dist/tools/list-team-members.d.ts.map +1 -0
- package/dist/tools/list-team-members.js +45 -0
- package/dist/tools/list-team-members.js.map +1 -0
- package/dist/tools/move-issue-to-project.d.ts +28 -0
- package/dist/tools/move-issue-to-project.d.ts.map +1 -0
- package/dist/tools/move-issue-to-project.js +43 -0
- package/dist/tools/move-issue-to-project.js.map +1 -0
- package/dist/tools/remove-issue-label.d.ts +28 -0
- package/dist/tools/remove-issue-label.d.ts.map +1 -0
- package/dist/tools/remove-issue-label.js +56 -0
- package/dist/tools/remove-issue-label.js.map +1 -0
- package/dist/tools/remove-issue-subscriber.d.ts +8 -0
- package/dist/tools/remove-issue-subscriber.d.ts.map +1 -0
- package/dist/tools/remove-issue-subscriber.js +29 -0
- package/dist/tools/remove-issue-subscriber.js.map +1 -0
- package/dist/tools/schemas.d.ts +207 -0
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +120 -0
- package/dist/tools/schemas.js.map +1 -1
- package/dist/tools/set-issue-cycle.d.ts +28 -0
- package/dist/tools/set-issue-cycle.d.ts.map +1 -0
- package/dist/tools/set-issue-cycle.js +43 -0
- package/dist/tools/set-issue-cycle.js.map +1 -0
- package/dist/tools/update-document.d.ts +22 -0
- package/dist/tools/update-document.d.ts.map +1 -0
- package/dist/tools/update-document.js +47 -0
- package/dist/tools/update-document.js.map +1 -0
- package/dist/tools/update-initiative.d.ts +27 -0
- package/dist/tools/update-initiative.d.ts.map +1 -0
- package/dist/tools/update-initiative.js +51 -0
- package/dist/tools/update-initiative.js.map +1 -0
- package/dist/tools/update-label.d.ts +17 -0
- package/dist/tools/update-label.d.ts.map +1 -0
- package/dist/tools/update-label.js +43 -0
- package/dist/tools/update-label.js.map +1 -0
- package/dist/tools/update-milestone.d.ts +16 -0
- package/dist/tools/update-milestone.d.ts.map +1 -0
- package/dist/tools/update-milestone.js +44 -0
- package/dist/tools/update-milestone.js.map +1 -0
- package/dist/tools.json +5531 -0
- package/package.json +3 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getDocument: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
document_id: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
document: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
title: z.ZodString;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
slug_id: z.ZodString;
|
|
10
|
+
icon: z.ZodString;
|
|
11
|
+
creator_name: z.ZodString;
|
|
12
|
+
project_name: z.ZodString;
|
|
13
|
+
url: z.ZodString;
|
|
14
|
+
created_at: z.ZodString;
|
|
15
|
+
updated_at: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
//# sourceMappingURL=get-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-document.d.ts","sourceRoot":"","sources":["../../src/tools/get-document.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;kBA6BtB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { documentSchema, mapDocument } from './schemas.js';
|
|
5
|
+
export const getDocument = defineTool({
|
|
6
|
+
name: 'get_document',
|
|
7
|
+
displayName: 'Get Document',
|
|
8
|
+
description: 'Get detailed information about a single Linear document by its UUID.',
|
|
9
|
+
summary: 'Get details of a single document',
|
|
10
|
+
icon: 'file-text',
|
|
11
|
+
group: 'Documents',
|
|
12
|
+
input: z.object({
|
|
13
|
+
document_id: z.string().describe('Document UUID'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
document: documentSchema.describe('The requested document'),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await graphql(`query GetDocument($id: String!) {
|
|
20
|
+
document(id: $id) {
|
|
21
|
+
id title content slugId icon url createdAt updatedAt
|
|
22
|
+
creator { name displayName }
|
|
23
|
+
project { name }
|
|
24
|
+
}
|
|
25
|
+
}`, { id: params.document_id });
|
|
26
|
+
if (!data.document)
|
|
27
|
+
throw ToolError.notFound('Document not found');
|
|
28
|
+
return { document: mapDocument(data.document) };
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=get-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-document.js","sourceRoot":"","sources":["../../src/tools/get-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,sEAAsE;IACnF,OAAO,EAAE,kCAAkC;IAC3C,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;KAClD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,cAAc,CAAC,QAAQ,CAAC,wBAAwB,CAAC;KAC5D,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,OAAO,CACxB;;;;;;QAME,EACF,EAAE,EAAE,EAAE,MAAM,CAAC,WAAW,EAAE,CAC3B,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;QAEnE,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,QAA6C,CAAC,EAAE,CAAC;IACvF,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getInitiative: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
initiative_id: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
initiative: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
description: z.ZodString;
|
|
9
|
+
status: z.ZodString;
|
|
10
|
+
color: z.ZodString;
|
|
11
|
+
icon: z.ZodString;
|
|
12
|
+
owner_name: z.ZodString;
|
|
13
|
+
url: z.ZodString;
|
|
14
|
+
created_at: z.ZodString;
|
|
15
|
+
updated_at: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
description: z.ZodString;
|
|
21
|
+
state: z.ZodString;
|
|
22
|
+
lead_name: z.ZodString;
|
|
23
|
+
target_date: z.ZodString;
|
|
24
|
+
start_date: z.ZodString;
|
|
25
|
+
url: z.ZodString;
|
|
26
|
+
created_at: z.ZodString;
|
|
27
|
+
updated_at: z.ZodString;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
//# sourceMappingURL=get-initiative.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-initiative.d.ts","sourceRoot":"","sources":["../../src/tools/get-initiative.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4CxB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { initiativeSchema, mapInitiative, projectSchema, mapProject } from './schemas.js';
|
|
5
|
+
export const getInitiative = defineTool({
|
|
6
|
+
name: 'get_initiative',
|
|
7
|
+
displayName: 'Get Initiative',
|
|
8
|
+
description: 'Get detailed information about a single Linear initiative by its UUID.',
|
|
9
|
+
summary: 'Get details of a single initiative',
|
|
10
|
+
icon: 'target',
|
|
11
|
+
group: 'Initiatives',
|
|
12
|
+
input: z.object({
|
|
13
|
+
initiative_id: z.string().describe('Initiative UUID'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
initiative: initiativeSchema.describe('The requested initiative'),
|
|
17
|
+
projects: z.array(projectSchema).describe('Projects associated with this initiative'),
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const data = await graphql(`query GetInitiative($id: String!) {
|
|
21
|
+
initiative(id: $id) {
|
|
22
|
+
id name description status color icon url createdAt updatedAt
|
|
23
|
+
owner { name displayName }
|
|
24
|
+
projects {
|
|
25
|
+
nodes {
|
|
26
|
+
id name description url createdAt updatedAt
|
|
27
|
+
status { name }
|
|
28
|
+
lead { name displayName }
|
|
29
|
+
targetDate startDate
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}`, { id: params.initiative_id });
|
|
34
|
+
if (!data.initiative)
|
|
35
|
+
throw ToolError.notFound('Initiative not found');
|
|
36
|
+
return {
|
|
37
|
+
initiative: mapInitiative(data.initiative),
|
|
38
|
+
projects: (data.initiative.projects?.nodes ?? []).map(p => mapProject(p)),
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=get-initiative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-initiative.js","sourceRoot":"","sources":["../../src/tools/get-initiative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1F,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,wEAAwE;IACrF,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;KACtD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QACjE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;KACtF,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,OAAO,CAKxB;;;;;;;;;;;;;QAaE,EACF,EAAE,EAAE,EAAE,MAAM,CAAC,aAAa,EAAE,CAC7B,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;QAEvE,OAAO;YACL,UAAU,EAAE,aAAa,CAAC,IAAI,CAAC,UAAiD,CAAC;YACjF,QAAQ,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAqC,CAAC,CAAC;SAC9G,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getMilestone: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
milestone_id: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
milestone: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
description: z.ZodString;
|
|
9
|
+
target_date: z.ZodString;
|
|
10
|
+
sort_order: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
//# sourceMappingURL=get-milestone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-milestone.d.ts","sourceRoot":"","sources":["../../src/tools/get-milestone.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,YAAY;;;;;;;;;;kBA2BvB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { mapMilestone, milestoneSchema } from './schemas.js';
|
|
5
|
+
export const getMilestone = defineTool({
|
|
6
|
+
name: 'get_milestone',
|
|
7
|
+
displayName: 'Get Milestone',
|
|
8
|
+
description: 'Get detailed information about a single project milestone by its UUID.',
|
|
9
|
+
summary: 'Get details of a single milestone',
|
|
10
|
+
icon: 'milestone',
|
|
11
|
+
group: 'Projects',
|
|
12
|
+
input: z.object({
|
|
13
|
+
milestone_id: z.string().describe('Milestone UUID'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
milestone: milestoneSchema.describe('The requested milestone'),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await graphql(`query GetMilestone($id: String!) {
|
|
20
|
+
projectMilestone(id: $id) {
|
|
21
|
+
id name description targetDate sortOrder
|
|
22
|
+
}
|
|
23
|
+
}`, { id: params.milestone_id });
|
|
24
|
+
if (!data.projectMilestone)
|
|
25
|
+
throw ToolError.notFound('Milestone not found');
|
|
26
|
+
return { milestone: mapMilestone(data.projectMilestone) };
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=get-milestone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-milestone.js","sourceRoot":"","sources":["../../src/tools/get-milestone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACrC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,wEAAwE;IACrF,OAAO,EAAE,mCAAmC;IAC5C,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;KACpD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,eAAe,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KAC/D,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,OAAO,CACxB;;;;QAIE,EACF,EAAE,EAAE,EAAE,MAAM,CAAC,YAAY,EAAE,CAC5B,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,gBAAgB;YAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;QAE5E,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,gBAAsD,CAAC,EAAE,CAAC;IAClG,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getTeam: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
team_id: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
team: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
key: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
description: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
//# sourceMappingURL=get-team.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-team.d.ts","sourceRoot":"","sources":["../../src/tools/get-team.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,OAAO;;;;;;;;;kBA2BlB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { mapTeam, teamSchema } from './schemas.js';
|
|
5
|
+
export const getTeam = defineTool({
|
|
6
|
+
name: 'get_team',
|
|
7
|
+
displayName: 'Get Team',
|
|
8
|
+
description: 'Get detailed information about a single Linear team by its UUID.',
|
|
9
|
+
summary: 'Get details of a single team',
|
|
10
|
+
icon: 'users',
|
|
11
|
+
group: 'Teams & Users',
|
|
12
|
+
input: z.object({
|
|
13
|
+
team_id: z.string().describe('Team UUID'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
team: teamSchema.describe('The requested team'),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await graphql(`query GetTeam($id: String!) {
|
|
20
|
+
team(id: $id) {
|
|
21
|
+
id key name description
|
|
22
|
+
}
|
|
23
|
+
}`, { id: params.team_id });
|
|
24
|
+
if (!data.team)
|
|
25
|
+
throw ToolError.notFound('Team not found');
|
|
26
|
+
return { team: mapTeam(data.team) };
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=get-team.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-team.js","sourceRoot":"","sources":["../../src/tools/get-team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;IAChC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,kEAAkE;IAC/E,OAAO,EAAE,8BAA8B;IACvC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,eAAe;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KAChD,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,OAAO,CACxB;;;;QAIE,EACF,EAAE,EAAE,EAAE,MAAM,CAAC,OAAO,EAAE,CACvB,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAE3D,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAqC,CAAC,EAAE,CAAC;IACvE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getUser: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
user_id: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
user: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
email: z.ZodString;
|
|
9
|
+
display_name: z.ZodString;
|
|
10
|
+
active: z.ZodBoolean;
|
|
11
|
+
admin: z.ZodBoolean;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
//# sourceMappingURL=get-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user.d.ts","sourceRoot":"","sources":["../../src/tools/get-user.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,OAAO;;;;;;;;;;;kBA2BlB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { mapUser, userSchema } from './schemas.js';
|
|
5
|
+
export const getUser = defineTool({
|
|
6
|
+
name: 'get_user',
|
|
7
|
+
displayName: 'Get User',
|
|
8
|
+
description: 'Get detailed information about a single Linear user by their UUID.',
|
|
9
|
+
summary: 'Get details of a single user',
|
|
10
|
+
icon: 'user',
|
|
11
|
+
group: 'Teams & Users',
|
|
12
|
+
input: z.object({
|
|
13
|
+
user_id: z.string().describe('User UUID'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
user: userSchema.describe('The requested user'),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await graphql(`query GetUser($id: String!) {
|
|
20
|
+
user(id: $id) {
|
|
21
|
+
id name email displayName active admin
|
|
22
|
+
}
|
|
23
|
+
}`, { id: params.user_id });
|
|
24
|
+
if (!data.user)
|
|
25
|
+
throw ToolError.notFound('User not found');
|
|
26
|
+
return { user: mapUser(data.user) };
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=get-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user.js","sourceRoot":"","sources":["../../src/tools/get-user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;IAChC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,oEAAoE;IACjF,OAAO,EAAE,8BAA8B;IACvC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,eAAe;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KAChD,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,OAAO,CACxB;;;;QAIE,EACF,EAAE,EAAE,EAAE,MAAM,CAAC,OAAO,EAAE,CACvB,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAE3D,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAqC,CAAC,EAAE,CAAC;IACvE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listAttachments: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
issue_id: z.ZodString;
|
|
4
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
after: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
subtitle: z.ZodString;
|
|
11
|
+
url: z.ZodString;
|
|
12
|
+
source_type: z.ZodString;
|
|
13
|
+
creator_name: z.ZodString;
|
|
14
|
+
created_at: z.ZodString;
|
|
15
|
+
updated_at: z.ZodString;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
pagination: z.ZodObject<{
|
|
18
|
+
has_next_page: z.ZodBoolean;
|
|
19
|
+
end_cursor: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
//# sourceMappingURL=list-attachments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-attachments.d.ts","sourceRoot":"","sources":["../../src/tools/list-attachments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;kBAmD1B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { attachmentSchema, mapAttachment, paginationSchema } from './schemas.js';
|
|
5
|
+
export const listAttachments = defineTool({
|
|
6
|
+
name: 'list_attachments',
|
|
7
|
+
displayName: 'List Attachments',
|
|
8
|
+
description: 'List attachments (linked PRs, documents, URLs) on a Linear issue.',
|
|
9
|
+
summary: 'List attachments on an issue',
|
|
10
|
+
icon: 'paperclip',
|
|
11
|
+
group: 'Issues',
|
|
12
|
+
input: z.object({
|
|
13
|
+
issue_id: z.string().describe('Issue UUID to list attachments for'),
|
|
14
|
+
limit: z.number().optional().describe('Maximum number of attachments to return (default 25, max 50)'),
|
|
15
|
+
after: z.string().optional().describe('Pagination cursor from a previous response'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
attachments: z.array(attachmentSchema).describe('List of attachments on the issue'),
|
|
19
|
+
pagination: paginationSchema.describe('Pagination info for fetching more results'),
|
|
20
|
+
}),
|
|
21
|
+
handle: async (params) => {
|
|
22
|
+
const limit = Math.min(params.limit ?? 25, 50);
|
|
23
|
+
const data = await graphql(`query ListAttachments($id: String!, $first: Int, $after: String) {
|
|
24
|
+
issue(id: $id) {
|
|
25
|
+
attachments(first: $first, after: $after) {
|
|
26
|
+
nodes {
|
|
27
|
+
id title subtitle url sourceType createdAt updatedAt
|
|
28
|
+
creator { name displayName }
|
|
29
|
+
}
|
|
30
|
+
pageInfo { hasNextPage endCursor }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}`, { id: params.issue_id, first: limit, after: params.after });
|
|
34
|
+
if (!data.issue)
|
|
35
|
+
throw ToolError.notFound('Issue not found');
|
|
36
|
+
const result = data.issue.attachments;
|
|
37
|
+
return {
|
|
38
|
+
attachments: result.nodes.map(n => mapAttachment(n)),
|
|
39
|
+
pagination: {
|
|
40
|
+
has_next_page: result.pageInfo?.hasNextPage ?? false,
|
|
41
|
+
end_cursor: result.pageInfo?.endCursor ?? '',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=list-attachments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-attachments.js","sourceRoot":"","sources":["../../src/tools/list-attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjF,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,mEAAmE;IAChF,OAAO,EAAE,8BAA8B;IACvC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,C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AE,SAAS,IAAI,EAAE;aAC7C;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listDocuments: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
project_id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
after: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
documents: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
content: z.ZodString;
|
|
11
|
+
slug_id: z.ZodString;
|
|
12
|
+
icon: z.ZodString;
|
|
13
|
+
creator_name: z.ZodString;
|
|
14
|
+
project_name: z.ZodString;
|
|
15
|
+
url: z.ZodString;
|
|
16
|
+
created_at: z.ZodString;
|
|
17
|
+
updated_at: z.ZodString;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
pagination: z.ZodObject<{
|
|
20
|
+
has_next_page: z.ZodBoolean;
|
|
21
|
+
end_cursor: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
//# sourceMappingURL=list-documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-documents.d.ts","sourceRoot":"","sources":["../../src/tools/list-documents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;kBAoDxB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { documentSchema, mapDocument, paginationSchema } from './schemas.js';
|
|
5
|
+
export const listDocuments = defineTool({
|
|
6
|
+
name: 'list_documents',
|
|
7
|
+
displayName: 'List Documents',
|
|
8
|
+
description: 'List documents in the Linear workspace, optionally filtered by project.',
|
|
9
|
+
summary: 'List documents',
|
|
10
|
+
icon: 'file-text',
|
|
11
|
+
group: 'Documents',
|
|
12
|
+
input: z.object({
|
|
13
|
+
project_id: z.string().optional().describe('Filter by project UUID'),
|
|
14
|
+
limit: z.number().optional().describe('Maximum number of results to return (default 25, max 50)'),
|
|
15
|
+
after: z.string().optional().describe('Pagination cursor from a previous response'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
documents: z.array(documentSchema).describe('List of documents'),
|
|
19
|
+
pagination: paginationSchema.describe('Pagination info for fetching more results'),
|
|
20
|
+
}),
|
|
21
|
+
handle: async (params) => {
|
|
22
|
+
const limit = Math.min(params.limit ?? 25, 50);
|
|
23
|
+
const filter = {};
|
|
24
|
+
if (params.project_id)
|
|
25
|
+
filter.project = { id: { eq: params.project_id } };
|
|
26
|
+
const filterArg = Object.keys(filter).length > 0 ? filter : undefined;
|
|
27
|
+
const data = await graphql(`query ListDocuments($first: Int, $after: String, $filter: DocumentFilter) {
|
|
28
|
+
documents(first: $first, after: $after, filter: $filter) {
|
|
29
|
+
nodes {
|
|
30
|
+
id title content slugId icon url createdAt updatedAt
|
|
31
|
+
creator { name displayName }
|
|
32
|
+
project { name }
|
|
33
|
+
}
|
|
34
|
+
pageInfo { hasNextPage endCursor }
|
|
35
|
+
}
|
|
36
|
+
}`, { first: limit, after: params.after, filter: filterArg });
|
|
37
|
+
if (!data.documents)
|
|
38
|
+
throw ToolError.internal('Failed to list documents');
|
|
39
|
+
const result = data.documents;
|
|
40
|
+
return {
|
|
41
|
+
documents: result.nodes.map(n => mapDocument(n)),
|
|
42
|
+
pagination: {
|
|
43
|
+
has_next_page: result.pageInfo?.hasNextPage ?? false,
|
|
44
|
+
end_cursor: result.pageInfo?.endCursor ?? '',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=list-documents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-documents.js","sourceRoot":"","sources":["../../src/tools/list-documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE7E,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,yEAAyE;IACtF,OAAO,EAAE,gBAAgB;IACzB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACpE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;QACjG,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;KACpF,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAChE,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CAAC,2CAA2C,CAAC;KACnF,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC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5
|
+
Active: "Active";
|
|
6
|
+
Completed: "Completed";
|
|
7
|
+
}>>;
|
|
8
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
after: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
initiatives: z.ZodArray<z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
description: z.ZodString;
|
|
15
|
+
status: z.ZodString;
|
|
16
|
+
color: z.ZodString;
|
|
17
|
+
icon: z.ZodString;
|
|
18
|
+
owner_name: z.ZodString;
|
|
19
|
+
url: z.ZodString;
|
|
20
|
+
created_at: z.ZodString;
|
|
21
|
+
updated_at: z.ZodString;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
pagination: z.ZodObject<{
|
|
24
|
+
has_next_page: z.ZodBoolean;
|
|
25
|
+
end_cursor: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
//# sourceMappingURL=list-initiatives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-initiatives.d.ts","sourceRoot":"","sources":["../../src/tools/list-initiatives.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;kBAmD1B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { initiativeSchema, mapInitiative, paginationSchema } from './schemas.js';
|
|
5
|
+
export const listInitiatives = defineTool({
|
|
6
|
+
name: 'list_initiatives',
|
|
7
|
+
displayName: 'List Initiatives',
|
|
8
|
+
description: 'List initiatives in the Linear workspace, optionally filtered by status.',
|
|
9
|
+
summary: 'List initiatives',
|
|
10
|
+
icon: 'target',
|
|
11
|
+
group: 'Initiatives',
|
|
12
|
+
input: z.object({
|
|
13
|
+
status: z.enum(['Planned', 'Active', 'Completed']).optional().describe('Filter by initiative status'),
|
|
14
|
+
limit: z.number().optional().describe('Maximum number of results to return (default 25, max 50)'),
|
|
15
|
+
after: z.string().optional().describe('Pagination cursor from a previous response'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
initiatives: z.array(initiativeSchema).describe('List of initiatives'),
|
|
19
|
+
pagination: paginationSchema.describe('Pagination info for fetching more results'),
|
|
20
|
+
}),
|
|
21
|
+
handle: async (params) => {
|
|
22
|
+
const limit = Math.min(params.limit ?? 25, 50);
|
|
23
|
+
const filter = {};
|
|
24
|
+
if (params.status)
|
|
25
|
+
filter.status = { eq: params.status };
|
|
26
|
+
const filterArg = Object.keys(filter).length > 0 ? filter : undefined;
|
|
27
|
+
const data = await graphql(`query ListInitiatives($first: Int, $after: String, $filter: InitiativeFilter) {
|
|
28
|
+
initiatives(first: $first, after: $after, filter: $filter) {
|
|
29
|
+
nodes {
|
|
30
|
+
id name description status color icon url createdAt updatedAt
|
|
31
|
+
owner { name displayName }
|
|
32
|
+
}
|
|
33
|
+
pageInfo { hasNextPage endCursor }
|
|
34
|
+
}
|
|
35
|
+
}`, { first: limit, after: params.after, filter: filterArg });
|
|
36
|
+
if (!data.initiatives)
|
|
37
|
+
throw ToolError.internal('Failed to list initiatives');
|
|
38
|
+
const result = data.initiatives;
|
|
39
|
+
return {
|
|
40
|
+
initiatives: result.nodes.map(n => mapInitiative(n)),
|
|
41
|
+
pagination: {
|
|
42
|
+
has_next_page: result.pageInfo?.hasNextPage ?? false,
|
|
43
|
+
end_cursor: result.pageInfo?.endCursor ?? '',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=list-initiatives.js.map
|
|
@@ -0,0 +1 @@
|
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,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAE/C,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,IAAI,MAAM,CAAC,MAAM;YAAE,MAAM,CAAC,MAAM,GAAG,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QACzD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAEtE,MAAM,IAAI,GAAG,MAAM,OAAO,CAMxB;;;;;;;;QAQE,EACF,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CACzD,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;QAC9E,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;QAChC,OAAO;YACL,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAwC,CAAC,CAAC;YAC3F,UAAU,EAAE;gBACV,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,IAAI,KAAK;gBACpD,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,IAAI,EAAE;aAC7C;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listIssueHistory: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
issue_id: z.ZodString;
|
|
4
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
after: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
history: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
actor_name: z.ZodString;
|
|
10
|
+
from_state_name: z.ZodString;
|
|
11
|
+
to_state_name: z.ZodString;
|
|
12
|
+
from_assignee_name: z.ZodString;
|
|
13
|
+
to_assignee_name: z.ZodString;
|
|
14
|
+
from_priority: z.ZodNumber;
|
|
15
|
+
to_priority: z.ZodNumber;
|
|
16
|
+
created_at: z.ZodString;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
pagination: z.ZodObject<{
|
|
19
|
+
has_next_page: z.ZodBoolean;
|
|
20
|
+
end_cursor: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
//# sourceMappingURL=list-issue-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-issue-history.d.ts","sourceRoot":"","sources":["../../src/tools/list-issue-history.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;kBAyD3B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { graphql } from '../linear-api.js';
|
|
2
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { issueHistorySchema, mapIssueHistory, paginationSchema } from './schemas.js';
|
|
5
|
+
export const listIssueHistory = defineTool({
|
|
6
|
+
name: 'list_issue_history',
|
|
7
|
+
displayName: 'List Issue History',
|
|
8
|
+
description: 'List the change history (state changes, assignee changes, priority changes) for a Linear issue.',
|
|
9
|
+
summary: 'List issue change history',
|
|
10
|
+
icon: 'history',
|
|
11
|
+
group: 'Issues',
|
|
12
|
+
input: z.object({
|
|
13
|
+
issue_id: z.string().describe('Issue UUID to list history for'),
|
|
14
|
+
limit: z.number().optional().describe('Maximum number of entries to return (default 25, max 50)'),
|
|
15
|
+
after: z.string().optional().describe('Pagination cursor from a previous response'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
history: z.array(issueHistorySchema).describe('List of history entries'),
|
|
19
|
+
pagination: paginationSchema.describe('Pagination info for fetching more results'),
|
|
20
|
+
}),
|
|
21
|
+
handle: async (params) => {
|
|
22
|
+
const limit = Math.min(params.limit ?? 25, 50);
|
|
23
|
+
const data = await graphql(`query ListIssueHistory($id: String!, $first: Int, $after: String) {
|
|
24
|
+
issue(id: $id) {
|
|
25
|
+
history(first: $first, after: $after) {
|
|
26
|
+
nodes {
|
|
27
|
+
id createdAt
|
|
28
|
+
actor { name displayName }
|
|
29
|
+
fromState { name }
|
|
30
|
+
toState { name }
|
|
31
|
+
fromAssignee { name displayName }
|
|
32
|
+
toAssignee { name displayName }
|
|
33
|
+
fromPriority
|
|
34
|
+
toPriority
|
|
35
|
+
}
|
|
36
|
+
pageInfo { hasNextPage endCursor }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}`, { id: params.issue_id, first: limit, after: params.after });
|
|
40
|
+
if (!data.issue)
|
|
41
|
+
throw ToolError.notFound('Issue not found');
|
|
42
|
+
const result = data.issue.history;
|
|
43
|
+
return {
|
|
44
|
+
history: result.nodes.map(n => mapIssueHistory(n)),
|
|
45
|
+
pagination: {
|
|
46
|
+
has_next_page: result.pageInfo?.hasNextPage ?? false,
|
|
47
|
+
end_cursor: result.pageInfo?.endCursor ?? '',
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=list-issue-history.js.map
|