@denvermullets/jait 1.4.0 → 1.6.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/dist/api-client.d.ts +5 -1
- package/dist/api-client.js +60 -34
- package/dist/attachments.d.ts +9 -2
- package/dist/attachments.js +93 -29
- package/dist/description-sections.d.ts +44 -0
- package/dist/description-sections.js +156 -0
- package/dist/index.js +8 -0
- package/dist/tools/comments.d.ts +20 -0
- package/dist/tools/comments.js +85 -25
- package/dist/tools/decisions.d.ts +2 -0
- package/dist/tools/decisions.js +64 -0
- package/dist/tools/description-section-tools.d.ts +18 -0
- package/dist/tools/description-section-tools.js +77 -0
- package/dist/tools/issues.d.ts +46 -6
- package/dist/tools/issues.js +180 -30
- package/dist/tools/labels.js +39 -0
- package/dist/tools/notifications.d.ts +2 -0
- package/dist/tools/notifications.js +62 -0
- package/dist/tools/projects.js +81 -13
- package/dist/tools/recurring-issues.d.ts +2 -0
- package/dist/tools/recurring-issues.js +132 -0
- package/dist/tools/sub-issues.d.ts +32 -0
- package/dist/tools/sub-issues.js +90 -0
- package/package.json +4 -4
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest } from "../api-client.js";
|
|
3
|
+
const priorityEnum = z
|
|
4
|
+
.enum(["urgent", "high", "medium", "low", "no_priority"])
|
|
5
|
+
.describe("Priority of each issue it files");
|
|
6
|
+
function formatRecurringIssue(r) {
|
|
7
|
+
const lines = [
|
|
8
|
+
`**${r.title}** — ID: ${r.id}${r.active ? "" : " (paused)"}`,
|
|
9
|
+
` Schedule: ${r.schedule_summary} (${r.time_zone}) | Next: ${r.next_run_on ?? "none"}`,
|
|
10
|
+
` Priority: ${r.priority}`,
|
|
11
|
+
];
|
|
12
|
+
if (r.assignee)
|
|
13
|
+
lines.push(` Assignee: ${r.assignee.name}`);
|
|
14
|
+
if (r.project)
|
|
15
|
+
lines.push(` Project: ${r.project.name}`);
|
|
16
|
+
if (r.lane)
|
|
17
|
+
lines.push(` Lane: ${r.lane.name}`);
|
|
18
|
+
if (r.label_ids.length > 0)
|
|
19
|
+
lines.push(` Label IDs: ${r.label_ids.join(", ")}`);
|
|
20
|
+
if (r.last_run_at)
|
|
21
|
+
lines.push(` Last filed: ${r.last_run_at}`);
|
|
22
|
+
if (r.description)
|
|
23
|
+
lines.push(` Description: ${r.description}`);
|
|
24
|
+
return lines.join("\n");
|
|
25
|
+
}
|
|
26
|
+
// Shared by create and update; every field is optional here and create
|
|
27
|
+
// marks its required ones below.
|
|
28
|
+
const scheduleFields = {
|
|
29
|
+
title: z.string().describe("Title of each issue it files"),
|
|
30
|
+
description: z.string().describe("Description of each issue it files"),
|
|
31
|
+
priority: priorityEnum,
|
|
32
|
+
assignee_id: z.number().describe("Assignee user ID"),
|
|
33
|
+
project_id: z.number().describe("Project ID"),
|
|
34
|
+
lane_id: z.number().describe("Lane the issues start in (default: the team's first lane)"),
|
|
35
|
+
label_ids: z.array(z.number()).describe("Label IDs"),
|
|
36
|
+
frequency: z.enum(["daily", "weekly", "monthly"]).describe("How often it repeats"),
|
|
37
|
+
interval: z
|
|
38
|
+
.number()
|
|
39
|
+
.int()
|
|
40
|
+
.min(1)
|
|
41
|
+
.max(365)
|
|
42
|
+
.describe("Every N days/weeks/months (default 1)"),
|
|
43
|
+
weekday: z
|
|
44
|
+
.number()
|
|
45
|
+
.int()
|
|
46
|
+
.min(0)
|
|
47
|
+
.max(6)
|
|
48
|
+
.describe("For weekly: day of week, 0 = Sunday … 6 = Saturday"),
|
|
49
|
+
day_of_month: z
|
|
50
|
+
.number()
|
|
51
|
+
.int()
|
|
52
|
+
.min(1)
|
|
53
|
+
.max(31)
|
|
54
|
+
.describe("For monthly: day of month (clamped to the month's last day)"),
|
|
55
|
+
time_zone: z
|
|
56
|
+
.string()
|
|
57
|
+
.describe("Rails time zone name, e.g. 'Eastern Time (US & Canada)' (default: yours)"),
|
|
58
|
+
starts_on: z
|
|
59
|
+
.string()
|
|
60
|
+
.describe("YYYY-MM-DD; the first issue is filed on the first matching day on or after this (never before today)"),
|
|
61
|
+
};
|
|
62
|
+
function toBody(args) {
|
|
63
|
+
const fields = {};
|
|
64
|
+
for (const [key, value] of Object.entries(args)) {
|
|
65
|
+
if (value !== undefined)
|
|
66
|
+
fields[key] = value;
|
|
67
|
+
}
|
|
68
|
+
return fields;
|
|
69
|
+
}
|
|
70
|
+
export function registerRecurringIssueTools(server) {
|
|
71
|
+
server.tool("list_recurring_issues", "List a team's recurring issue templates (issues filed automatically on a schedule).", { team_id: z.number().describe("Team ID") }, async ({ team_id }) => {
|
|
72
|
+
const list = await apiRequest(`/api/v1/teams/${team_id}/recurring_issues`);
|
|
73
|
+
const text = list.map(formatRecurringIssue).join("\n\n");
|
|
74
|
+
return {
|
|
75
|
+
content: [{ type: "text", text: text || "No recurring issues found." }],
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
server.tool("create_recurring_issue", "Create a recurring issue: a template that files a fresh issue on a schedule (e.g. every Friday). Weekly needs weekday; monthly needs day_of_month.", {
|
|
79
|
+
team_id: z.number().describe("Team ID"),
|
|
80
|
+
...scheduleFields,
|
|
81
|
+
description: scheduleFields.description.optional(),
|
|
82
|
+
priority: scheduleFields.priority.optional(),
|
|
83
|
+
assignee_id: scheduleFields.assignee_id.optional(),
|
|
84
|
+
project_id: scheduleFields.project_id.optional(),
|
|
85
|
+
lane_id: scheduleFields.lane_id.optional(),
|
|
86
|
+
label_ids: scheduleFields.label_ids.optional(),
|
|
87
|
+
interval: scheduleFields.interval.optional(),
|
|
88
|
+
weekday: scheduleFields.weekday.optional(),
|
|
89
|
+
day_of_month: scheduleFields.day_of_month.optional(),
|
|
90
|
+
time_zone: scheduleFields.time_zone.optional(),
|
|
91
|
+
}, async ({ team_id, ...args }) => {
|
|
92
|
+
const r = await apiRequest(`/api/v1/teams/${team_id}/recurring_issues`, {
|
|
93
|
+
method: "POST",
|
|
94
|
+
body: { recurring_issue: { interval: 1, ...toBody(args) } },
|
|
95
|
+
});
|
|
96
|
+
return {
|
|
97
|
+
content: [
|
|
98
|
+
{ type: "text", text: `Recurring issue created:\n\n${formatRecurringIssue(r)}` },
|
|
99
|
+
],
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
server.tool("update_recurring_issue", "Update a recurring issue template, or pause/resume it with `active`. Changing the frequency, interval, weekday or day_of_month only takes effect on the next run date when starts_on is also given.", {
|
|
103
|
+
team_id: z.number().describe("Team ID"),
|
|
104
|
+
recurring_issue_id: z.number().describe("Recurring issue ID"),
|
|
105
|
+
...Object.fromEntries(Object.entries(scheduleFields).map(([k, v]) => [k, v.optional()])),
|
|
106
|
+
active: z.boolean().optional().describe("false pauses it, true resumes it"),
|
|
107
|
+
}, async ({ team_id, recurring_issue_id, ...args }) => {
|
|
108
|
+
const fields = toBody(args);
|
|
109
|
+
if (Object.keys(fields).length === 0) {
|
|
110
|
+
return {
|
|
111
|
+
content: [{ type: "text", text: "Error: Nothing to update." }],
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const r = await apiRequest(`/api/v1/teams/${team_id}/recurring_issues/${recurring_issue_id}`, { method: "PATCH", body: { recurring_issue: fields } });
|
|
115
|
+
return {
|
|
116
|
+
content: [
|
|
117
|
+
{ type: "text", text: `Recurring issue updated:\n\n${formatRecurringIssue(r)}` },
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
server.tool("delete_recurring_issue", "Delete a recurring issue template. Issues it already filed are kept.", {
|
|
122
|
+
team_id: z.number().describe("Team ID"),
|
|
123
|
+
recurring_issue_id: z.number().describe("Recurring issue ID"),
|
|
124
|
+
}, async ({ team_id, recurring_issue_id }) => {
|
|
125
|
+
await apiRequest(`/api/v1/teams/${team_id}/recurring_issues/${recurring_issue_id}`, { method: "DELETE" });
|
|
126
|
+
return {
|
|
127
|
+
content: [
|
|
128
|
+
{ type: "text", text: `Recurring issue ${recurring_issue_id} deleted.` },
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
export interface HierarchyNode {
|
|
3
|
+
id: number;
|
|
4
|
+
identifier: string;
|
|
5
|
+
title: string;
|
|
6
|
+
priority: string;
|
|
7
|
+
lane: {
|
|
8
|
+
id: number;
|
|
9
|
+
name: string;
|
|
10
|
+
category: string | null;
|
|
11
|
+
};
|
|
12
|
+
assignee: {
|
|
13
|
+
id: number;
|
|
14
|
+
name: string;
|
|
15
|
+
} | null;
|
|
16
|
+
closed: boolean;
|
|
17
|
+
sub_issue_count: number;
|
|
18
|
+
sub_issues: HierarchyNode[];
|
|
19
|
+
}
|
|
20
|
+
export interface Hierarchy {
|
|
21
|
+
issue_id: number;
|
|
22
|
+
root_id: number;
|
|
23
|
+
ancestor_ids: number[];
|
|
24
|
+
truncated: boolean;
|
|
25
|
+
tree: HierarchyNode;
|
|
26
|
+
blocks: {
|
|
27
|
+
blocking_issue_id: number;
|
|
28
|
+
blocked_issue_id: number;
|
|
29
|
+
}[];
|
|
30
|
+
}
|
|
31
|
+
export declare function formatHierarchy(h: Hierarchy): string;
|
|
32
|
+
export declare function registerSubIssueTools(server: McpServer): void;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest } from "../api-client.js";
|
|
3
|
+
import { formatIssue } from "./issues.js";
|
|
4
|
+
export function formatHierarchy(h) {
|
|
5
|
+
const byId = new Map();
|
|
6
|
+
const lines = [];
|
|
7
|
+
const walk = (node, depth) => {
|
|
8
|
+
byId.set(node.id, node);
|
|
9
|
+
const marker = node.id === h.issue_id ? " ← this issue" : "";
|
|
10
|
+
const assignee = node.assignee ? ` | ${node.assignee.name}` : "";
|
|
11
|
+
const check = node.closed ? "[x]" : "[ ]";
|
|
12
|
+
lines.push(`${" ".repeat(depth)}- ${check} ${node.identifier}: ${node.title} (${node.lane.name} | ${node.priority}${assignee} | ID: ${node.id})${marker}`);
|
|
13
|
+
for (const child of node.sub_issues)
|
|
14
|
+
walk(child, depth + 1);
|
|
15
|
+
};
|
|
16
|
+
walk(h.tree, 0);
|
|
17
|
+
if (h.truncated)
|
|
18
|
+
lines.push(" … deeper levels omitted (raise max_depth to see more)");
|
|
19
|
+
if (h.blocks.length > 0) {
|
|
20
|
+
const name = (id) => byId.get(id)?.identifier ?? `#${id}`;
|
|
21
|
+
lines.push("", "Blocking links within this tree:");
|
|
22
|
+
for (const b of h.blocks)
|
|
23
|
+
lines.push(` ${name(b.blocking_issue_id)} blocks ${name(b.blocked_issue_id)}`);
|
|
24
|
+
}
|
|
25
|
+
return lines.join("\n");
|
|
26
|
+
}
|
|
27
|
+
export function registerSubIssueTools(server) {
|
|
28
|
+
server.tool("get_issue_hierarchy", "Get the full sub-issue tree an issue belongs to, rooted at its top-level ancestor, with each issue's status and any blocking links between issues in the tree. For an issue's direct sub-issues only, get_issue is enough; to list them with filters, use list_issues with parent_issue_id.", {
|
|
29
|
+
team_id: z.number().describe("Team ID"),
|
|
30
|
+
issue_id: z.number().describe("Any issue in the tree"),
|
|
31
|
+
max_depth: z
|
|
32
|
+
.number()
|
|
33
|
+
.int()
|
|
34
|
+
.min(1)
|
|
35
|
+
.max(10)
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("How many levels below the root to include (1-10, default 10)"),
|
|
38
|
+
}, async ({ team_id, issue_id, max_depth }) => {
|
|
39
|
+
const hierarchy = await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}/hierarchy`, { params: { max_depth } });
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: "text", text: formatHierarchy(hierarchy) }],
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
server.tool("add_sub_issue", "Make an existing issue a sub-issue of another issue in the same team. If it already has a parent, it is moved under the new one. To create a brand-new sub-issue, use create_issue with parent_issue_id instead.", {
|
|
45
|
+
team_id: z.number().describe("Team ID"),
|
|
46
|
+
parent_issue_id: z.number().describe("The issue to nest under"),
|
|
47
|
+
issue_id: z.number().describe("The issue that becomes the sub-issue"),
|
|
48
|
+
}, async ({ team_id, parent_issue_id, issue_id }) => {
|
|
49
|
+
const issue = await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}`, { method: "PATCH", body: { issue: { parent_issue_id } } });
|
|
50
|
+
return {
|
|
51
|
+
content: [
|
|
52
|
+
{
|
|
53
|
+
type: "text",
|
|
54
|
+
text: `Sub-issue added under issue ${parent_issue_id}:\n\n${formatIssue(issue)}`,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
server.tool("remove_sub_issue", "Detach a sub-issue from its parent, making it a top-level issue. The issue itself is kept.", {
|
|
60
|
+
team_id: z.number().describe("Team ID"),
|
|
61
|
+
parent_issue_id: z
|
|
62
|
+
.number()
|
|
63
|
+
.describe("The current parent; checked so the wrong link isn't removed"),
|
|
64
|
+
issue_id: z.number().describe("The sub-issue to detach"),
|
|
65
|
+
}, async ({ team_id, parent_issue_id, issue_id }) => {
|
|
66
|
+
const current = await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}`);
|
|
67
|
+
if (current.parent_issue_id !== parent_issue_id) {
|
|
68
|
+
const actual = current.parent_issue
|
|
69
|
+
? `${current.parent_issue.identifier} (ID: ${current.parent_issue.id})`
|
|
70
|
+
: "no parent";
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: "text",
|
|
75
|
+
text: `Error: ${current.identifier} is not a sub-issue of issue ${parent_issue_id}; it has ${actual}. Nothing was changed.`,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const issue = await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}`, { method: "PATCH", body: { issue: { parent_issue_id: null } } });
|
|
81
|
+
return {
|
|
82
|
+
content: [
|
|
83
|
+
{
|
|
84
|
+
type: "text",
|
|
85
|
+
text: `Sub-issue detached; it is now top-level:\n\n${formatIssue(issue)}`,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@denvermullets/jait",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "MCP server for Just Another Issue Tracker",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"prepublishOnly": "yarn build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
22
|
-
"zod": "^4.6.
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
22
|
+
"zod": "^4.6.7"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/node": "^26.6.
|
|
25
|
+
"@types/node": "^26.6.6",
|
|
26
26
|
"typescript": "^7.0.2"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|