@denvermullets/jait 1.1.0 → 1.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 +6 -0
- package/dist/index.js +2 -0
- package/dist/tools/comments.d.ts +2 -0
- package/dist/tools/comments.js +50 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,9 +17,15 @@ This writes the token to `~/.config/jait/config.json` (mode `0600`) so it doesn'
|
|
|
17
17
|
**Claude Code (recommended):**
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
+
# just in 1 project
|
|
20
21
|
claude mcp add jait -- npx -y @denvermullets/jait
|
|
21
22
|
```
|
|
22
23
|
|
|
24
|
+
```bash
|
|
25
|
+
# globally
|
|
26
|
+
claude mcp add -s user jait -- npx -y @denvermullets/jait
|
|
27
|
+
```
|
|
28
|
+
|
|
23
29
|
**Claude Desktop / Cursor / other clients:**
|
|
24
30
|
|
|
25
31
|
```json
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { registerMemberTools } from "./tools/members.js";
|
|
|
8
8
|
import { registerLabelTools } from "./tools/labels.js";
|
|
9
9
|
import { registerProjectTools } from "./tools/projects.js";
|
|
10
10
|
import { registerIssueDependencyTools } from "./tools/issue-dependencies.js";
|
|
11
|
+
import { registerCommentTools } from "./tools/comments.js";
|
|
11
12
|
import { writeToken, clearToken } from "./config-store.js";
|
|
12
13
|
const [, , cmd, arg] = process.argv;
|
|
13
14
|
if (cmd === "login") {
|
|
@@ -31,6 +32,7 @@ const server = new McpServer({
|
|
|
31
32
|
registerTeamTools(server);
|
|
32
33
|
registerIssueTools(server);
|
|
33
34
|
registerIssueDependencyTools(server);
|
|
35
|
+
registerCommentTools(server);
|
|
34
36
|
registerLaneTools(server);
|
|
35
37
|
registerMemberTools(server);
|
|
36
38
|
registerLabelTools(server);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiRequest } from "../api-client.js";
|
|
3
|
+
function formatComment(comment, indent = 0) {
|
|
4
|
+
const pad = " ".repeat(indent);
|
|
5
|
+
const author = comment.user ? comment.user.name : "Unknown";
|
|
6
|
+
const lines = [
|
|
7
|
+
`${pad}#${comment.id} by ${author} at ${comment.created_at}`,
|
|
8
|
+
`${pad} ${comment.body}`,
|
|
9
|
+
];
|
|
10
|
+
if (comment.replies && comment.replies.length > 0) {
|
|
11
|
+
for (const reply of comment.replies) {
|
|
12
|
+
lines.push(formatComment(reply, indent + 1));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return lines.join("\n");
|
|
16
|
+
}
|
|
17
|
+
export function registerCommentTools(server) {
|
|
18
|
+
server.tool("list_comments", "List all comments on an issue, with replies nested under their parent.", {
|
|
19
|
+
team_id: z.number().describe("Team ID"),
|
|
20
|
+
issue_id: z.number().describe("Issue ID"),
|
|
21
|
+
}, async ({ team_id, issue_id }) => {
|
|
22
|
+
const comments = await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}/comments`);
|
|
23
|
+
const text = comments.map((c) => formatComment(c)).join("\n\n");
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: "text", text: text || "No comments on this issue." }],
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
server.tool("create_comment", "Post a new comment on an issue. The author is derived from the API token. Pass parent_id to reply to an existing comment.", {
|
|
29
|
+
team_id: z.number().describe("Team ID"),
|
|
30
|
+
issue_id: z.number().describe("Issue ID"),
|
|
31
|
+
body: z.string().describe("Comment text"),
|
|
32
|
+
parent_id: z
|
|
33
|
+
.number()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Parent comment ID to reply to"),
|
|
36
|
+
}, async ({ team_id, issue_id, body, parent_id }) => {
|
|
37
|
+
const comment = await apiRequest(`/api/v1/teams/${team_id}/issues/${issue_id}/comments`, {
|
|
38
|
+
method: "POST",
|
|
39
|
+
body: { comment: { body, parent_id } },
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: `Comment posted:\n${formatComment(comment)}`,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|