@agllama/mcp 0.1.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/LICENSE +21 -0
- package/README.md +249 -0
- package/dist/api-client.d.ts +71 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +315 -0
- package/dist/api-client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +495 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/backlog.d.ts +16 -0
- package/dist/tools/backlog.d.ts.map +1 -0
- package/dist/tools/backlog.js +59 -0
- package/dist/tools/backlog.js.map +1 -0
- package/dist/tools/boards.d.ts +62 -0
- package/dist/tools/boards.d.ts.map +1 -0
- package/dist/tools/boards.js +158 -0
- package/dist/tools/boards.js.map +1 -0
- package/dist/tools/comments.d.ts +82 -0
- package/dist/tools/comments.d.ts.map +1 -0
- package/dist/tools/comments.js +162 -0
- package/dist/tools/comments.js.map +1 -0
- package/dist/tools/connect.d.ts +7 -0
- package/dist/tools/connect.d.ts.map +1 -0
- package/dist/tools/connect.js +61 -0
- package/dist/tools/connect.js.map +1 -0
- package/dist/tools/context.d.ts +16 -0
- package/dist/tools/context.d.ts.map +1 -0
- package/dist/tools/context.js +79 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/help.d.ts +13 -0
- package/dist/tools/help.d.ts.map +1 -0
- package/dist/tools/help.js +421 -0
- package/dist/tools/help.js.map +1 -0
- package/dist/tools/index.d.ts +17 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +17 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/issueLinks.d.ts +45 -0
- package/dist/tools/issueLinks.d.ts.map +1 -0
- package/dist/tools/issueLinks.js +90 -0
- package/dist/tools/issueLinks.js.map +1 -0
- package/dist/tools/issues.d.ts +127 -0
- package/dist/tools/issues.d.ts.map +1 -0
- package/dist/tools/issues.js +262 -0
- package/dist/tools/issues.js.map +1 -0
- package/dist/tools/labels.d.ts +56 -0
- package/dist/tools/labels.d.ts.map +1 -0
- package/dist/tools/labels.js +123 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/members.d.ts +13 -0
- package/dist/tools/members.d.ts.map +1 -0
- package/dist/tools/members.js +43 -0
- package/dist/tools/members.js.map +1 -0
- package/dist/tools/organizations.d.ts +35 -0
- package/dist/tools/organizations.d.ts.map +1 -0
- package/dist/tools/organizations.js +116 -0
- package/dist/tools/organizations.js.map +1 -0
- package/dist/tools/projects.d.ts +67 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +165 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/search.d.ts +34 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +62 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/sprints.d.ts +141 -0
- package/dist/tools/sprints.d.ts.map +1 -0
- package/dist/tools/sprints.js +380 -0
- package/dist/tools/sprints.js.map +1 -0
- package/dist/tools/status.d.ts +22 -0
- package/dist/tools/status.d.ts.map +1 -0
- package/dist/tools/status.js +44 -0
- package/dist/tools/status.js.map +1 -0
- package/dist/tools/workflows.d.ts +137 -0
- package/dist/tools/workflows.d.ts.map +1 -0
- package/dist/tools/workflows.js +355 -0
- package/dist/tools/workflows.js.map +1 -0
- package/dist/types.d.ts +312 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getApiClient, LlamaApiError } from '../api-client.js';
|
|
3
|
+
// ============================================
|
|
4
|
+
// Get Backlog
|
|
5
|
+
// ============================================
|
|
6
|
+
export const getBacklogToolName = 'llama_get_backlog';
|
|
7
|
+
export const getBacklogToolDescription = `Get all issues in the backlog (not assigned to any sprint).
|
|
8
|
+
Returns issues sorted by rank/priority.
|
|
9
|
+
Use this to see what work is waiting to be planned into sprints.`;
|
|
10
|
+
export const getBacklogToolSchema = z.object({
|
|
11
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
12
|
+
projectKey: z.string().describe('Project key'),
|
|
13
|
+
});
|
|
14
|
+
export async function executeGetBacklog(input) {
|
|
15
|
+
try {
|
|
16
|
+
const client = getApiClient();
|
|
17
|
+
const backlog = await client.getBacklog(input.orgSlug, input.projectKey);
|
|
18
|
+
// Group by type for easier reading
|
|
19
|
+
const epics = backlog.issues.filter((i) => i.type === 'EPIC');
|
|
20
|
+
const stories = backlog.issues.filter((i) => i.type === 'STORY');
|
|
21
|
+
const tasks = backlog.issues.filter((i) => i.type === 'TASK');
|
|
22
|
+
const bugs = backlog.issues.filter((i) => i.type === 'BUG');
|
|
23
|
+
return JSON.stringify({
|
|
24
|
+
success: true,
|
|
25
|
+
backlog: {
|
|
26
|
+
total: backlog.total,
|
|
27
|
+
breakdown: {
|
|
28
|
+
epics: epics.length,
|
|
29
|
+
stories: stories.length,
|
|
30
|
+
tasks: tasks.length,
|
|
31
|
+
bugs: bugs.length,
|
|
32
|
+
},
|
|
33
|
+
issues: backlog.issues.map((issue) => ({
|
|
34
|
+
key: issue.key,
|
|
35
|
+
summary: issue.summary,
|
|
36
|
+
type: issue.type,
|
|
37
|
+
priority: issue.priority,
|
|
38
|
+
status: issue.status,
|
|
39
|
+
assignee: issue.assignee,
|
|
40
|
+
estimate: issue.estimate,
|
|
41
|
+
})),
|
|
42
|
+
},
|
|
43
|
+
}, null, 2);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error instanceof LlamaApiError) {
|
|
47
|
+
return JSON.stringify({
|
|
48
|
+
success: false,
|
|
49
|
+
error: `Failed to get backlog: ${error.message}`,
|
|
50
|
+
statusCode: error.statusCode,
|
|
51
|
+
}, null, 2);
|
|
52
|
+
}
|
|
53
|
+
return JSON.stringify({
|
|
54
|
+
success: false,
|
|
55
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
56
|
+
}, null, 2);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=backlog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backlog.js","sourceRoot":"","sources":["../../src/tools/backlog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+CAA+C;AAC/C,cAAc;AACd,+CAA+C;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAG;;iEAEwB,CAAC;AAElE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACjD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;CAC/C,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAA0B;IAE1B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAEzE,mCAAmC;QACnC,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAA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KAAK,CAAC,UAAU;aAC7B,EACD,IAAI,EACJ,CAAC,CACF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CACnB;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAChE,EACD,IAAI,EACJ,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listBoardsToolName = "llama_list_boards";
|
|
3
|
+
export declare const listBoardsToolDescription = "List all boards in a project.\nEach project typically has one default board, but can have multiple.";
|
|
4
|
+
export declare const listBoardsToolSchema: z.ZodObject<{
|
|
5
|
+
orgSlug: z.ZodString;
|
|
6
|
+
projectKey: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
orgSlug: string;
|
|
9
|
+
projectKey: string;
|
|
10
|
+
}, {
|
|
11
|
+
orgSlug: string;
|
|
12
|
+
projectKey: string;
|
|
13
|
+
}>;
|
|
14
|
+
export type ListBoardsToolInput = z.infer<typeof listBoardsToolSchema>;
|
|
15
|
+
export declare function executeListBoards(input: ListBoardsToolInput): Promise<string>;
|
|
16
|
+
export declare const getBoardToolName = "llama_get_board";
|
|
17
|
+
export declare const getBoardToolDescription = "Get a board with all its columns and issues.\nReturns the full board state including issues in each column.\nUse this to see the current state of work on the Kanban board.";
|
|
18
|
+
export declare const getBoardToolSchema: z.ZodObject<{
|
|
19
|
+
orgSlug: z.ZodString;
|
|
20
|
+
projectKey: z.ZodString;
|
|
21
|
+
boardId: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
orgSlug: string;
|
|
24
|
+
projectKey: string;
|
|
25
|
+
boardId: string;
|
|
26
|
+
}, {
|
|
27
|
+
orgSlug: string;
|
|
28
|
+
projectKey: string;
|
|
29
|
+
boardId: string;
|
|
30
|
+
}>;
|
|
31
|
+
export type GetBoardToolInput = z.infer<typeof getBoardToolSchema>;
|
|
32
|
+
export declare function executeGetBoard(input: GetBoardToolInput): Promise<string>;
|
|
33
|
+
export declare const moveIssueOnBoardToolName = "llama_move_issue_on_board";
|
|
34
|
+
export declare const moveIssueOnBoardToolDescription = "Move an issue to a different column on the board.\nThis changes the issue's status based on the column's status mapping.\nOptionally specify afterIssueId or beforeIssueId for precise positioning.";
|
|
35
|
+
export declare const moveIssueOnBoardToolSchema: z.ZodObject<{
|
|
36
|
+
orgSlug: z.ZodString;
|
|
37
|
+
projectKey: z.ZodString;
|
|
38
|
+
boardId: z.ZodString;
|
|
39
|
+
issueId: z.ZodString;
|
|
40
|
+
columnId: z.ZodString;
|
|
41
|
+
afterIssueId: z.ZodOptional<z.ZodString>;
|
|
42
|
+
beforeIssueId: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
orgSlug: string;
|
|
45
|
+
projectKey: string;
|
|
46
|
+
boardId: string;
|
|
47
|
+
issueId: string;
|
|
48
|
+
columnId: string;
|
|
49
|
+
afterIssueId?: string | undefined;
|
|
50
|
+
beforeIssueId?: string | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
orgSlug: string;
|
|
53
|
+
projectKey: string;
|
|
54
|
+
boardId: string;
|
|
55
|
+
issueId: string;
|
|
56
|
+
columnId: string;
|
|
57
|
+
afterIssueId?: string | undefined;
|
|
58
|
+
beforeIssueId?: string | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
export type MoveIssueOnBoardToolInput = z.infer<typeof moveIssueOnBoardToolSchema>;
|
|
61
|
+
export declare function executeMoveIssueOnBoard(input: MoveIssueOnBoardToolInput): Promise<string>;
|
|
62
|
+
//# sourceMappingURL=boards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boards.d.ts","sourceRoot":"","sources":["../../src/tools/boards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD,eAAO,MAAM,yBAAyB,wGAC+B,CAAC;AAEtE,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,CAwCjB;AAMD,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAElD,eAAO,MAAM,uBAAuB,gLAE2B,CAAC;AAEhE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEnE,wBAAsB,eAAe,CACnC,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,MAAM,CAAC,CAyEjB;AAMD,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAEpE,eAAO,MAAM,+BAA+B,wMAE8B,CAAC;AAE3E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;EAcrC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEnF,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,MAAM,CAAC,CA6CjB"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getApiClient, LlamaApiError } from '../api-client.js';
|
|
3
|
+
// ============================================
|
|
4
|
+
// List Boards
|
|
5
|
+
// ============================================
|
|
6
|
+
export const listBoardsToolName = 'llama_list_boards';
|
|
7
|
+
export const listBoardsToolDescription = `List all boards in a project.
|
|
8
|
+
Each project typically has one default board, but can have multiple.`;
|
|
9
|
+
export const listBoardsToolSchema = z.object({
|
|
10
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
11
|
+
projectKey: z.string().describe('Project key'),
|
|
12
|
+
});
|
|
13
|
+
export async function executeListBoards(input) {
|
|
14
|
+
try {
|
|
15
|
+
const client = getApiClient();
|
|
16
|
+
const boards = await client.listBoards(input.orgSlug, input.projectKey);
|
|
17
|
+
return JSON.stringify({
|
|
18
|
+
success: true,
|
|
19
|
+
boards: boards.map((b) => ({
|
|
20
|
+
id: b.id,
|
|
21
|
+
name: b.name,
|
|
22
|
+
columnCount: b.columns?.length ?? 0,
|
|
23
|
+
})),
|
|
24
|
+
count: boards.length,
|
|
25
|
+
}, null, 2);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (error instanceof LlamaApiError) {
|
|
29
|
+
return JSON.stringify({
|
|
30
|
+
success: false,
|
|
31
|
+
error: `Failed to list boards: ${error.message}`,
|
|
32
|
+
statusCode: error.statusCode,
|
|
33
|
+
}, null, 2);
|
|
34
|
+
}
|
|
35
|
+
return JSON.stringify({
|
|
36
|
+
success: false,
|
|
37
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
38
|
+
}, null, 2);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// ============================================
|
|
42
|
+
// Get Board
|
|
43
|
+
// ============================================
|
|
44
|
+
export const getBoardToolName = 'llama_get_board';
|
|
45
|
+
export const getBoardToolDescription = `Get a board with all its columns and issues.
|
|
46
|
+
Returns the full board state including issues in each column.
|
|
47
|
+
Use this to see the current state of work on the Kanban board.`;
|
|
48
|
+
export const getBoardToolSchema = z.object({
|
|
49
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
50
|
+
projectKey: z.string().describe('Project key'),
|
|
51
|
+
boardId: z.string().describe('Board ID (from llama_list_boards)'),
|
|
52
|
+
});
|
|
53
|
+
export async function executeGetBoard(input) {
|
|
54
|
+
try {
|
|
55
|
+
const client = getApiClient();
|
|
56
|
+
const board = await client.getBoard(input.orgSlug, input.projectKey, input.boardId);
|
|
57
|
+
// Group issues by statusId (API returns flat array, we need to associate with columns)
|
|
58
|
+
const issuesByStatus = new Map();
|
|
59
|
+
for (const issue of board.issues ?? []) {
|
|
60
|
+
const statusId = issue.statusId;
|
|
61
|
+
if (!issuesByStatus.has(statusId)) {
|
|
62
|
+
issuesByStatus.set(statusId, []);
|
|
63
|
+
}
|
|
64
|
+
issuesByStatus.get(statusId).push(issue);
|
|
65
|
+
}
|
|
66
|
+
// Format board data for readability
|
|
67
|
+
const formattedBoard = {
|
|
68
|
+
id: board.id,
|
|
69
|
+
name: board.name,
|
|
70
|
+
columns: board.columns.map((col) => {
|
|
71
|
+
const columnIssues = issuesByStatus.get(col.statusId) ?? [];
|
|
72
|
+
return {
|
|
73
|
+
id: col.id,
|
|
74
|
+
name: col.name,
|
|
75
|
+
position: col.position,
|
|
76
|
+
wipLimit: col.wipLimit,
|
|
77
|
+
statusCategory: col.status?.category ?? col.statusCategory,
|
|
78
|
+
issueCount: columnIssues.length,
|
|
79
|
+
issues: columnIssues.map((issue) => ({
|
|
80
|
+
key: issue.key,
|
|
81
|
+
summary: issue.summary,
|
|
82
|
+
type: issue.type,
|
|
83
|
+
priority: issue.priority,
|
|
84
|
+
assignee: issue.assignee?.name ?? null,
|
|
85
|
+
})),
|
|
86
|
+
};
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
return JSON.stringify({
|
|
90
|
+
success: true,
|
|
91
|
+
board: formattedBoard,
|
|
92
|
+
}, null, 2);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
if (error instanceof LlamaApiError) {
|
|
96
|
+
return JSON.stringify({
|
|
97
|
+
success: false,
|
|
98
|
+
error: `Failed to get board: ${error.message}`,
|
|
99
|
+
statusCode: error.statusCode,
|
|
100
|
+
}, null, 2);
|
|
101
|
+
}
|
|
102
|
+
return JSON.stringify({
|
|
103
|
+
success: false,
|
|
104
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
105
|
+
}, null, 2);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// ============================================
|
|
109
|
+
// Move Issue on Board
|
|
110
|
+
// ============================================
|
|
111
|
+
export const moveIssueOnBoardToolName = 'llama_move_issue_on_board';
|
|
112
|
+
export const moveIssueOnBoardToolDescription = `Move an issue to a different column on the board.
|
|
113
|
+
This changes the issue's status based on the column's status mapping.
|
|
114
|
+
Optionally specify afterIssueId or beforeIssueId for precise positioning.`;
|
|
115
|
+
export const moveIssueOnBoardToolSchema = z.object({
|
|
116
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
117
|
+
projectKey: z.string().describe('Project key'),
|
|
118
|
+
boardId: z.string().describe('Board ID'),
|
|
119
|
+
issueId: z.string().describe('Issue ID to move'),
|
|
120
|
+
columnId: z.string().describe('Target column ID'),
|
|
121
|
+
afterIssueId: z
|
|
122
|
+
.string()
|
|
123
|
+
.optional()
|
|
124
|
+
.describe('Place after this issue ID (for ordering)'),
|
|
125
|
+
beforeIssueId: z
|
|
126
|
+
.string()
|
|
127
|
+
.optional()
|
|
128
|
+
.describe('Place before this issue ID (for ordering)'),
|
|
129
|
+
});
|
|
130
|
+
export async function executeMoveIssueOnBoard(input) {
|
|
131
|
+
try {
|
|
132
|
+
const client = getApiClient();
|
|
133
|
+
await client.moveIssueOnBoard(input.orgSlug, input.projectKey, input.boardId, {
|
|
134
|
+
issueId: input.issueId,
|
|
135
|
+
columnId: input.columnId,
|
|
136
|
+
afterIssueId: input.afterIssueId,
|
|
137
|
+
beforeIssueId: input.beforeIssueId,
|
|
138
|
+
});
|
|
139
|
+
return JSON.stringify({
|
|
140
|
+
success: true,
|
|
141
|
+
message: `Moved issue to column`,
|
|
142
|
+
}, null, 2);
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
if (error instanceof LlamaApiError) {
|
|
146
|
+
return JSON.stringify({
|
|
147
|
+
success: false,
|
|
148
|
+
error: `Failed to move issue: ${error.message}`,
|
|
149
|
+
statusCode: error.statusCode,
|
|
150
|
+
}, null, 2);
|
|
151
|
+
}
|
|
152
|
+
return JSON.stringify({
|
|
153
|
+
success: false,
|
|
154
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
155
|
+
}, null, 2);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=boards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boards.js","sourceRoot":"","sources":["../../src/tools/boards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,+CAA+C;AAC/C,cAAc;AACd,+CAA+C;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GAAG;qEAC4B,CAAC;AAEtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACjD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;CAC/C,CAAC,CAAC;AAIH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAA0B;IAE1B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAExE,OAAO,IAAI,CAAC,SAAS,CACnB;YACE,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACzB,EAAE,E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,CAAC,CACF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CACnB;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAChE,EACD,IAAI,EACJ,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listCommentsToolName = "llama_list_comments";
|
|
3
|
+
export declare const listCommentsToolDescription = "List all comments on an issue.\nReturns comments with author, content, and timestamps.";
|
|
4
|
+
export declare const listCommentsToolSchema: z.ZodObject<{
|
|
5
|
+
orgSlug: z.ZodString;
|
|
6
|
+
projectKey: z.ZodString;
|
|
7
|
+
issueKey: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
orgSlug: string;
|
|
10
|
+
projectKey: string;
|
|
11
|
+
issueKey: string;
|
|
12
|
+
}, {
|
|
13
|
+
orgSlug: string;
|
|
14
|
+
projectKey: string;
|
|
15
|
+
issueKey: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type ListCommentsToolInput = z.infer<typeof listCommentsToolSchema>;
|
|
18
|
+
export declare function executeListComments(input: ListCommentsToolInput): Promise<string>;
|
|
19
|
+
export declare const addCommentToolName = "llama_add_comment";
|
|
20
|
+
export declare const addCommentToolDescription = "Add a comment to an issue.\nSupports markdown formatting in the comment content.";
|
|
21
|
+
export declare const addCommentToolSchema: z.ZodObject<{
|
|
22
|
+
orgSlug: z.ZodString;
|
|
23
|
+
projectKey: z.ZodString;
|
|
24
|
+
issueKey: z.ZodString;
|
|
25
|
+
content: z.ZodString;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
orgSlug: string;
|
|
28
|
+
projectKey: string;
|
|
29
|
+
issueKey: string;
|
|
30
|
+
content: string;
|
|
31
|
+
}, {
|
|
32
|
+
orgSlug: string;
|
|
33
|
+
projectKey: string;
|
|
34
|
+
issueKey: string;
|
|
35
|
+
content: string;
|
|
36
|
+
}>;
|
|
37
|
+
export type AddCommentToolInput = z.infer<typeof addCommentToolSchema>;
|
|
38
|
+
export declare function executeAddComment(input: AddCommentToolInput): Promise<string>;
|
|
39
|
+
export declare const updateCommentToolName = "llama_update_comment";
|
|
40
|
+
export declare const updateCommentToolDescription = "Update an existing comment.\nOnly the comment author can update their own comments.";
|
|
41
|
+
export declare const updateCommentToolSchema: z.ZodObject<{
|
|
42
|
+
orgSlug: z.ZodString;
|
|
43
|
+
projectKey: z.ZodString;
|
|
44
|
+
issueKey: z.ZodString;
|
|
45
|
+
commentId: z.ZodString;
|
|
46
|
+
content: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
orgSlug: string;
|
|
49
|
+
projectKey: string;
|
|
50
|
+
issueKey: string;
|
|
51
|
+
content: string;
|
|
52
|
+
commentId: string;
|
|
53
|
+
}, {
|
|
54
|
+
orgSlug: string;
|
|
55
|
+
projectKey: string;
|
|
56
|
+
issueKey: string;
|
|
57
|
+
content: string;
|
|
58
|
+
commentId: string;
|
|
59
|
+
}>;
|
|
60
|
+
export type UpdateCommentToolInput = z.infer<typeof updateCommentToolSchema>;
|
|
61
|
+
export declare function executeUpdateComment(input: UpdateCommentToolInput): Promise<string>;
|
|
62
|
+
export declare const deleteCommentToolName = "llama_delete_comment";
|
|
63
|
+
export declare const deleteCommentToolDescription = "Delete a comment from an issue.\nOnly the comment author can delete their own comments.";
|
|
64
|
+
export declare const deleteCommentToolSchema: z.ZodObject<{
|
|
65
|
+
orgSlug: z.ZodString;
|
|
66
|
+
projectKey: z.ZodString;
|
|
67
|
+
issueKey: z.ZodString;
|
|
68
|
+
commentId: z.ZodString;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
orgSlug: string;
|
|
71
|
+
projectKey: string;
|
|
72
|
+
issueKey: string;
|
|
73
|
+
commentId: string;
|
|
74
|
+
}, {
|
|
75
|
+
orgSlug: string;
|
|
76
|
+
projectKey: string;
|
|
77
|
+
issueKey: string;
|
|
78
|
+
commentId: string;
|
|
79
|
+
}>;
|
|
80
|
+
export type DeleteCommentToolInput = z.infer<typeof deleteCommentToolSchema>;
|
|
81
|
+
export declare function executeDeleteComment(input: DeleteCommentToolInput): Promise<string>;
|
|
82
|
+
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/tools/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAE1D,eAAO,MAAM,2BAA2B,2FACe,CAAC;AAExD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAIjC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,MAAM,CAAC,CA+CjB;AAMD,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD,eAAO,MAAM,yBAAyB,qFACe,CAAC;AAEtD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,CA8CjB;AAMD,eAAO,MAAM,qBAAqB,yBAAyB,CAAC;AAE5D,eAAO,MAAM,4BAA4B,wFACc,CAAC;AAExD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;EAMlC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,MAAM,CAAC,CA8CjB;AAMD,eAAO,MAAM,qBAAqB,yBAAyB,CAAC;AAE5D,eAAO,MAAM,4BAA4B,4FACc,CAAC;AAExD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAwCjB"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getApiClient, LlamaApiError } from '../api-client.js';
|
|
3
|
+
// ============================================
|
|
4
|
+
// List Comments
|
|
5
|
+
// ============================================
|
|
6
|
+
export const listCommentsToolName = 'llama_list_comments';
|
|
7
|
+
export const listCommentsToolDescription = `List all comments on an issue.
|
|
8
|
+
Returns comments with author, content, and timestamps.`;
|
|
9
|
+
export const listCommentsToolSchema = z.object({
|
|
10
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
11
|
+
projectKey: z.string().describe('Project key'),
|
|
12
|
+
issueKey: z.string().describe('Issue key (e.g., "PROJ-123")'),
|
|
13
|
+
});
|
|
14
|
+
export async function executeListComments(input) {
|
|
15
|
+
try {
|
|
16
|
+
const client = getApiClient();
|
|
17
|
+
const comments = await client.listComments(input.orgSlug, input.projectKey, input.issueKey);
|
|
18
|
+
return JSON.stringify({
|
|
19
|
+
success: true,
|
|
20
|
+
issueKey: input.issueKey,
|
|
21
|
+
comments: comments.map((c) => ({
|
|
22
|
+
id: c.id,
|
|
23
|
+
author: c.authorName,
|
|
24
|
+
content: c.content,
|
|
25
|
+
createdAt: c.createdAt,
|
|
26
|
+
updatedAt: c.updatedAt,
|
|
27
|
+
})),
|
|
28
|
+
count: comments.length,
|
|
29
|
+
}, null, 2);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (error instanceof LlamaApiError) {
|
|
33
|
+
return JSON.stringify({
|
|
34
|
+
success: false,
|
|
35
|
+
error: `Failed to list comments: ${error.message}`,
|
|
36
|
+
statusCode: error.statusCode,
|
|
37
|
+
}, null, 2);
|
|
38
|
+
}
|
|
39
|
+
return JSON.stringify({
|
|
40
|
+
success: false,
|
|
41
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
42
|
+
}, null, 2);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// ============================================
|
|
46
|
+
// Add Comment
|
|
47
|
+
// ============================================
|
|
48
|
+
export const addCommentToolName = 'llama_add_comment';
|
|
49
|
+
export const addCommentToolDescription = `Add a comment to an issue.
|
|
50
|
+
Supports markdown formatting in the comment content.`;
|
|
51
|
+
export const addCommentToolSchema = z.object({
|
|
52
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
53
|
+
projectKey: z.string().describe('Project key'),
|
|
54
|
+
issueKey: z.string().describe('Issue key (e.g., "PROJ-123")'),
|
|
55
|
+
content: z.string().describe('Comment content (markdown supported)'),
|
|
56
|
+
});
|
|
57
|
+
export async function executeAddComment(input) {
|
|
58
|
+
try {
|
|
59
|
+
const client = getApiClient();
|
|
60
|
+
const comment = await client.createComment(input.orgSlug, input.projectKey, input.issueKey, { content: input.content });
|
|
61
|
+
return JSON.stringify({
|
|
62
|
+
success: true,
|
|
63
|
+
message: `Added comment to ${input.issueKey}`,
|
|
64
|
+
comment: {
|
|
65
|
+
id: comment.id,
|
|
66
|
+
author: comment.authorName,
|
|
67
|
+
content: comment.content,
|
|
68
|
+
createdAt: comment.createdAt,
|
|
69
|
+
},
|
|
70
|
+
}, null, 2);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
if (error instanceof LlamaApiError) {
|
|
74
|
+
return JSON.stringify({
|
|
75
|
+
success: false,
|
|
76
|
+
error: `Failed to add comment: ${error.message}`,
|
|
77
|
+
statusCode: error.statusCode,
|
|
78
|
+
}, null, 2);
|
|
79
|
+
}
|
|
80
|
+
return JSON.stringify({
|
|
81
|
+
success: false,
|
|
82
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
83
|
+
}, null, 2);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// ============================================
|
|
87
|
+
// Update Comment
|
|
88
|
+
// ============================================
|
|
89
|
+
export const updateCommentToolName = 'llama_update_comment';
|
|
90
|
+
export const updateCommentToolDescription = `Update an existing comment.
|
|
91
|
+
Only the comment author can update their own comments.`;
|
|
92
|
+
export const updateCommentToolSchema = z.object({
|
|
93
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
94
|
+
projectKey: z.string().describe('Project key'),
|
|
95
|
+
issueKey: z.string().describe('Issue key'),
|
|
96
|
+
commentId: z.string().describe('Comment ID to update'),
|
|
97
|
+
content: z.string().describe('New comment content'),
|
|
98
|
+
});
|
|
99
|
+
export async function executeUpdateComment(input) {
|
|
100
|
+
try {
|
|
101
|
+
const client = getApiClient();
|
|
102
|
+
const comment = await client.updateComment(input.orgSlug, input.projectKey, input.issueKey, input.commentId, input.content);
|
|
103
|
+
return JSON.stringify({
|
|
104
|
+
success: true,
|
|
105
|
+
message: `Updated comment on ${input.issueKey}`,
|
|
106
|
+
comment: {
|
|
107
|
+
id: comment.id,
|
|
108
|
+
content: comment.content,
|
|
109
|
+
updatedAt: comment.updatedAt,
|
|
110
|
+
},
|
|
111
|
+
}, null, 2);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (error instanceof LlamaApiError) {
|
|
115
|
+
return JSON.stringify({
|
|
116
|
+
success: false,
|
|
117
|
+
error: `Failed to update comment: ${error.message}`,
|
|
118
|
+
statusCode: error.statusCode,
|
|
119
|
+
}, null, 2);
|
|
120
|
+
}
|
|
121
|
+
return JSON.stringify({
|
|
122
|
+
success: false,
|
|
123
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
124
|
+
}, null, 2);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// ============================================
|
|
128
|
+
// Delete Comment
|
|
129
|
+
// ============================================
|
|
130
|
+
export const deleteCommentToolName = 'llama_delete_comment';
|
|
131
|
+
export const deleteCommentToolDescription = `Delete a comment from an issue.
|
|
132
|
+
Only the comment author can delete their own comments.`;
|
|
133
|
+
export const deleteCommentToolSchema = z.object({
|
|
134
|
+
orgSlug: z.string().describe('Organization slug'),
|
|
135
|
+
projectKey: z.string().describe('Project key'),
|
|
136
|
+
issueKey: z.string().describe('Issue key'),
|
|
137
|
+
commentId: z.string().describe('Comment ID to delete'),
|
|
138
|
+
});
|
|
139
|
+
export async function executeDeleteComment(input) {
|
|
140
|
+
try {
|
|
141
|
+
const client = getApiClient();
|
|
142
|
+
await client.deleteComment(input.orgSlug, input.projectKey, input.issueKey, input.commentId);
|
|
143
|
+
return JSON.stringify({
|
|
144
|
+
success: true,
|
|
145
|
+
message: `Deleted comment from ${input.issueKey}`,
|
|
146
|
+
}, null, 2);
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
if (error instanceof LlamaApiError) {
|
|
150
|
+
return JSON.stringify({
|
|
151
|
+
success: false,
|
|
152
|
+
error: `Failed to delete comment: ${error.message}`,
|
|
153
|
+
statusCode: error.statusCode,
|
|
154
|
+
}, null, 2);
|
|
155
|
+
}
|
|
156
|
+
return JSON.stringify({
|
|
157
|
+
success: false,
|
|
158
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
159
|
+
}, null, 2);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/tools/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE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EAAE;gBACnD,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,EACD,IAAI,EACJ,CAAC,CACF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CACnB;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAChE,EACD,IAAI,EACJ,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const connectToolName = "llama_connect";
|
|
3
|
+
export declare const connectToolDescription = "Test connection to Llama API and get current user info. Call this first to verify your API key is working.";
|
|
4
|
+
export declare const connectToolSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
5
|
+
export type ConnectToolInput = z.infer<typeof connectToolSchema>;
|
|
6
|
+
export declare function executeConnect(): Promise<string>;
|
|
7
|
+
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/tools/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,eAAO,MAAM,sBAAsB,+GAC2E,CAAC;AAE/G,eAAO,MAAM,iBAAiB,gDAAe,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEjE,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CA2EtD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getApiClient, LlamaApiError } from '../api-client.js';
|
|
3
|
+
export const connectToolName = 'llama_connect';
|
|
4
|
+
export const connectToolDescription = 'Test connection to Llama API and get current user info. Call this first to verify your API key is working.';
|
|
5
|
+
export const connectToolSchema = z.object({});
|
|
6
|
+
export async function executeConnect() {
|
|
7
|
+
// Debug logging
|
|
8
|
+
const apiUrl = process.env.LLAMA_API_URL;
|
|
9
|
+
const apiKey = process.env.LLAMA_API_KEY;
|
|
10
|
+
const keyPreview = apiKey ? `${apiKey.substring(0, 8)}...${apiKey.substring(apiKey.length - 4)}` : 'NOT SET';
|
|
11
|
+
console.error(`[llama_connect] LLAMA_API_URL: ${apiUrl || 'NOT SET'}`);
|
|
12
|
+
console.error(`[llama_connect] LLAMA_API_KEY: ${keyPreview}`);
|
|
13
|
+
// If env vars not set, return debug info
|
|
14
|
+
if (!apiUrl || !apiKey) {
|
|
15
|
+
return JSON.stringify({
|
|
16
|
+
success: false,
|
|
17
|
+
error: 'Environment variables not set',
|
|
18
|
+
debug: {
|
|
19
|
+
LLAMA_API_URL: apiUrl || 'NOT SET',
|
|
20
|
+
LLAMA_API_KEY: keyPreview,
|
|
21
|
+
},
|
|
22
|
+
}, null, 2);
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
const client = getApiClient();
|
|
26
|
+
const user = await client.testConnection();
|
|
27
|
+
return JSON.stringify({
|
|
28
|
+
success: true,
|
|
29
|
+
message: 'Successfully connected to Llama API',
|
|
30
|
+
user: {
|
|
31
|
+
id: user.id,
|
|
32
|
+
email: user.email,
|
|
33
|
+
name: user.name,
|
|
34
|
+
},
|
|
35
|
+
}, null, 2);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (error instanceof LlamaApiError) {
|
|
39
|
+
return JSON.stringify({
|
|
40
|
+
success: false,
|
|
41
|
+
error: `Connection failed: ${error.message}`,
|
|
42
|
+
statusCode: error.statusCode,
|
|
43
|
+
debug: {
|
|
44
|
+
LLAMA_API_URL: apiUrl,
|
|
45
|
+
LLAMA_API_KEY: keyPreview,
|
|
46
|
+
},
|
|
47
|
+
}, null, 2);
|
|
48
|
+
}
|
|
49
|
+
return JSON.stringify({
|
|
50
|
+
success: false,
|
|
51
|
+
error: error instanceof Error
|
|
52
|
+
? error.message
|
|
53
|
+
: 'Unknown error connecting to Llama API',
|
|
54
|
+
debug: {
|
|
55
|
+
LLAMA_API_URL: apiUrl,
|
|
56
|
+
LLAMA_API_KEY: keyPreview,
|
|
57
|
+
},
|
|
58
|
+
}, null, 2);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=connect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/tools/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GACjC,4GAA4G,CAAC;AAE/G,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAI9C,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,gBAAgB;IAChB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IACzC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IACzC,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAE7G,OAAO,CAAC,KAAK,CAAC,kCAAkC,MAAM,IAAI,SAAS,EAAE,CAAC,CAAC;IACvE,OAAO,CAAC,KAAK,CAAC,kCAAkC,UAAU,EAAE,CAAC,CAAC;IAE9D,yCAAyC;IACzC,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;aAC1B;SACF,EACD,IAAI,EACJ,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const contextToolName = "llama_context";
|
|
3
|
+
export declare const contextToolDescription = "Get project context snapshot from Llama. Returns:\n- Project info (key, name, description)\n- Organization info\n- Workflow statuses\n- Active sprint with issues\n- Pending sprints\n- Backlog issues (first 50)\n- Team members\n\nUse this to understand the current state of a project before creating or updating issues.";
|
|
4
|
+
export declare const contextToolSchema: z.ZodObject<{
|
|
5
|
+
orgSlug: z.ZodString;
|
|
6
|
+
projectKey: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
orgSlug: string;
|
|
9
|
+
projectKey: string;
|
|
10
|
+
}, {
|
|
11
|
+
orgSlug: string;
|
|
12
|
+
projectKey: string;
|
|
13
|
+
}>;
|
|
14
|
+
export type ContextToolInput = z.infer<typeof contextToolSchema>;
|
|
15
|
+
export declare function executeContext(input: ContextToolInput): Promise<string>;
|
|
16
|
+
//# sourceMappingURL=context.d.ts.map
|