@agllama/mcp 0.1.0 → 0.1.1

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.
Files changed (93) hide show
  1. package/README.md +161 -162
  2. package/dist/api-client.d.ts +45 -2
  3. package/dist/api-client.d.ts.map +1 -1
  4. package/dist/api-client.js +108 -2
  5. package/dist/api-client.js.map +1 -1
  6. package/dist/server.d.ts.map +1 -1
  7. package/dist/server.js +140 -1
  8. package/dist/server.js.map +1 -1
  9. package/dist/tools/backlog.d.ts +13 -7
  10. package/dist/tools/backlog.d.ts.map +1 -1
  11. package/dist/tools/backlog.js +59 -9
  12. package/dist/tools/backlog.js.map +1 -1
  13. package/dist/tools/boardConfig.d.ts +65 -0
  14. package/dist/tools/boardConfig.d.ts.map +1 -0
  15. package/dist/tools/boardConfig.js +150 -0
  16. package/dist/tools/boardConfig.js.map +1 -0
  17. package/dist/tools/boardTemplates.d.ts +47 -0
  18. package/dist/tools/boardTemplates.d.ts.map +1 -0
  19. package/dist/tools/boardTemplates.js +119 -0
  20. package/dist/tools/boardTemplates.js.map +1 -0
  21. package/dist/tools/boards.d.ts +20 -20
  22. package/dist/tools/boards.d.ts.map +1 -1
  23. package/dist/tools/boards.js +121 -19
  24. package/dist/tools/boards.js.map +1 -1
  25. package/dist/tools/comments.d.ts +24 -24
  26. package/dist/tools/comments.d.ts.map +1 -1
  27. package/dist/tools/comments.js +136 -23
  28. package/dist/tools/comments.js.map +1 -1
  29. package/dist/tools/connect.d.ts.map +1 -1
  30. package/dist/tools/connect.js +7 -18
  31. package/dist/tools/connect.js.map +1 -1
  32. package/dist/tools/context.d.ts +10 -7
  33. package/dist/tools/context.d.ts.map +1 -1
  34. package/dist/tools/context.js +57 -7
  35. package/dist/tools/context.js.map +1 -1
  36. package/dist/tools/documents.d.ts +99 -0
  37. package/dist/tools/documents.d.ts.map +1 -0
  38. package/dist/tools/documents.js +252 -0
  39. package/dist/tools/documents.js.map +1 -0
  40. package/dist/tools/help.d.ts.map +1 -1
  41. package/dist/tools/help.js +70 -6
  42. package/dist/tools/help.js.map +1 -1
  43. package/dist/tools/index.d.ts +4 -0
  44. package/dist/tools/index.d.ts.map +1 -1
  45. package/dist/tools/index.js +4 -0
  46. package/dist/tools/index.js.map +1 -1
  47. package/dist/tools/issueLinks.d.ts +12 -12
  48. package/dist/tools/issueLinks.d.ts.map +1 -1
  49. package/dist/tools/issueLinks.js +69 -12
  50. package/dist/tools/issueLinks.js.map +1 -1
  51. package/dist/tools/issues.d.ts +208 -28
  52. package/dist/tools/issues.d.ts.map +1 -1
  53. package/dist/tools/issues.js +483 -35
  54. package/dist/tools/issues.js.map +1 -1
  55. package/dist/tools/labels.d.ts +18 -18
  56. package/dist/tools/labels.d.ts.map +1 -1
  57. package/dist/tools/labels.js +102 -17
  58. package/dist/tools/labels.js.map +1 -1
  59. package/dist/tools/members.d.ts.map +1 -1
  60. package/dist/tools/members.js +2 -2
  61. package/dist/tools/members.js.map +1 -1
  62. package/dist/tools/organizations.d.ts.map +1 -1
  63. package/dist/tools/organizations.js +8 -8
  64. package/dist/tools/organizations.js.map +1 -1
  65. package/dist/tools/projects.d.ts.map +1 -1
  66. package/dist/tools/projects.js +11 -11
  67. package/dist/tools/projects.js.map +1 -1
  68. package/dist/tools/search.d.ts +4 -4
  69. package/dist/tools/search.d.ts.map +1 -1
  70. package/dist/tools/search.js +28 -5
  71. package/dist/tools/search.js.map +1 -1
  72. package/dist/tools/session.d.ts +38 -0
  73. package/dist/tools/session.d.ts.map +1 -0
  74. package/dist/tools/session.js +158 -0
  75. package/dist/tools/session.js.map +1 -0
  76. package/dist/tools/sprints.d.ts +18 -18
  77. package/dist/tools/sprints.d.ts.map +1 -1
  78. package/dist/tools/sprints.js +115 -30
  79. package/dist/tools/sprints.js.map +1 -1
  80. package/dist/tools/status.d.ts +6 -6
  81. package/dist/tools/status.d.ts.map +1 -1
  82. package/dist/tools/status.js +45 -8
  83. package/dist/tools/status.js.map +1 -1
  84. package/dist/tools/workflows.d.ts.map +1 -1
  85. package/dist/tools/workflows.js +19 -19
  86. package/dist/tools/workflows.js.map +1 -1
  87. package/dist/types.d.ts +123 -1
  88. package/dist/types.d.ts.map +1 -1
  89. package/dist/utils/column-instructions.d.ts +21 -0
  90. package/dist/utils/column-instructions.d.ts.map +1 -0
  91. package/dist/utils/column-instructions.js +54 -0
  92. package/dist/utils/column-instructions.js.map +1 -0
  93. package/package.json +5 -5
@@ -0,0 +1,150 @@
1
+ import { z } from 'zod';
2
+ import { getApiClient, LlamaApiError } from '../api-client.js';
3
+ // ============================================
4
+ // Get Board Configuration
5
+ // ============================================
6
+ export const getBoardConfigToolName = 'llama_get_board_config';
7
+ export const getBoardConfigToolDescription = `Get full board configuration including all column AI settings.
8
+ Returns the board with all columns and their AI configurations (agent type, instructions, required actions, etc.).
9
+ Use this to see what AI agents are configured for each column.`;
10
+ export const getBoardConfigToolSchema = z.object({
11
+ orgSlug: z.string().describe('Organization slug'),
12
+ projectKey: z.string().describe('Project key'),
13
+ });
14
+ export async function executeGetBoardConfig(input) {
15
+ try {
16
+ const client = getApiClient();
17
+ const board = await client.getBoardConfiguration(input.orgSlug, input.projectKey);
18
+ return JSON.stringify({
19
+ success: true,
20
+ board: {
21
+ id: board.id,
22
+ name: board.name,
23
+ type: 'KANBAN', // Default for now
24
+ columns: board.columns.map((col) => ({
25
+ id: col.id,
26
+ name: col.name,
27
+ position: col.position,
28
+ status: col.status,
29
+ configuration: col.configuration || null,
30
+ })),
31
+ },
32
+ }, null, 2);
33
+ }
34
+ catch (error) {
35
+ if (error instanceof LlamaApiError) {
36
+ return JSON.stringify({
37
+ success: false,
38
+ error: `Failed to get board configuration: ${error.message}`,
39
+ statusCode: error.statusCode,
40
+ });
41
+ }
42
+ return JSON.stringify({
43
+ success: false,
44
+ error: error instanceof Error ? error.message : 'Unknown error',
45
+ });
46
+ }
47
+ }
48
+ // ============================================
49
+ // Update Column Configuration
50
+ // ============================================
51
+ export const updateColumnConfigToolName = 'llama_update_column_config';
52
+ export const updateColumnConfigToolDescription = `Update a board column's AI configuration.
53
+ Configure AI agent settings for a specific column including agent type, instructions, required actions, and context hints.
54
+ Use this to enable/disable AI or update agent behavior for a column.`;
55
+ export const updateColumnConfigToolSchema = z.object({
56
+ boardId: z.string().describe('Board ID'),
57
+ columnId: z.string().describe('Board column ID'),
58
+ aiEnabled: z.boolean().optional().describe('Enable/disable AI for this column'),
59
+ agentType: z
60
+ .string()
61
+ .optional()
62
+ .describe('Agent type (pr-review, test-validator, doc-writer, custom)'),
63
+ instructions: z.string().optional().describe('Markdown instructions for the AI agent'),
64
+ requiredActions: z
65
+ .array(z.string())
66
+ .optional()
67
+ .describe('Array of required actions the agent must perform'),
68
+ contextHints: z
69
+ .array(z.string())
70
+ .optional()
71
+ .describe('Array of context hints to help the agent'),
72
+ color: z.string().optional().describe('Column color (hex code)'),
73
+ icon: z.string().optional().describe('Column icon name'),
74
+ });
75
+ export async function executeUpdateColumnConfig(input) {
76
+ try {
77
+ const client = getApiClient();
78
+ // Extract boardId and columnId from input
79
+ const { boardId, columnId, ...configData } = input;
80
+ const config = await client.updateColumnConfiguration(boardId, columnId, configData);
81
+ return JSON.stringify({
82
+ success: true,
83
+ message: 'Column configuration updated successfully',
84
+ configuration: config,
85
+ });
86
+ }
87
+ catch (error) {
88
+ if (error instanceof LlamaApiError) {
89
+ return JSON.stringify({
90
+ success: false,
91
+ error: `Failed to update column configuration: ${error.message}`,
92
+ statusCode: error.statusCode,
93
+ });
94
+ }
95
+ return JSON.stringify({
96
+ success: false,
97
+ error: error instanceof Error ? error.message : 'Unknown error',
98
+ });
99
+ }
100
+ }
101
+ // ============================================
102
+ // Get Column Instructions
103
+ // ============================================
104
+ export const getColumnInstructionsToolName = 'llama_get_column_instructions';
105
+ export const getColumnInstructionsToolDescription = `Get instructions for a specific column.
106
+ Manual lookup without moving an issue. Returns the AI configuration and instructions for the column.
107
+ Use this to see what an AI agent should do for issues in a particular column.`;
108
+ export const getColumnInstructionsToolSchema = z.object({
109
+ boardId: z.string().describe('Board ID'),
110
+ columnId: z.string().describe('Board column ID'),
111
+ });
112
+ export async function executeGetColumnInstructions(input) {
113
+ try {
114
+ const client = getApiClient();
115
+ const config = await client.getColumnConfiguration(input.boardId, input.columnId);
116
+ if (!config) {
117
+ return JSON.stringify({
118
+ success: true,
119
+ message: 'No AI configuration found for this column',
120
+ columnInstructions: null,
121
+ });
122
+ }
123
+ return JSON.stringify({
124
+ success: true,
125
+ columnInstructions: {
126
+ aiEnabled: config.aiEnabled,
127
+ agentType: config.agentType,
128
+ instructions: config.instructions,
129
+ requiredActions: config.requiredActions,
130
+ contextHints: config.contextHints,
131
+ color: config.color,
132
+ icon: config.icon,
133
+ },
134
+ });
135
+ }
136
+ catch (error) {
137
+ if (error instanceof LlamaApiError) {
138
+ return JSON.stringify({
139
+ success: false,
140
+ error: `Failed to get column instructions: ${error.message}`,
141
+ statusCode: error.statusCode,
142
+ });
143
+ }
144
+ return JSON.stringify({
145
+ success: false,
146
+ error: error instanceof Error ? error.message : 'Unknown error',
147
+ });
148
+ }
149
+ }
150
+ //# sourceMappingURL=boardConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boardConfig.js","sourceRoot":"","sources":["../../src/tools/boardConfig.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,0BAA0B;AAC1B,+CAA+C;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D,MAAM,CAAC,MAAM,6BAA6B,GAAG;;+DAEkB,CAAC;AAEhE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACjD,UAAU,EAAE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zod';
2
+ export declare const listBoardTemplatesToolName = "llama_list_board_templates";
3
+ export declare const listBoardTemplatesToolDescription = "List available board templates at organization level.\nBoard templates provide pre-configured column setups with AI agent configurations.\nUse this to see what templates are available before applying one to a project.";
4
+ export declare const listBoardTemplatesToolSchema: z.ZodObject<{
5
+ orgSlug: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ orgSlug: string;
8
+ }, {
9
+ orgSlug: string;
10
+ }>;
11
+ export type ListBoardTemplatesToolInput = z.infer<typeof listBoardTemplatesToolSchema>;
12
+ export declare function executeListBoardTemplates(input: ListBoardTemplatesToolInput): Promise<string>;
13
+ export declare const applyBoardTemplateToolName = "llama_apply_board_template";
14
+ export declare const applyBoardTemplateToolDescription = "Apply a template to a project's board.\nThis updates the board columns with the template's configuration, including AI agent settings.\nUse llama_list_board_templates first to see available templates and get the templateId.";
15
+ export declare const applyBoardTemplateToolSchema: z.ZodObject<{
16
+ orgSlug: z.ZodString;
17
+ projectKey: z.ZodString;
18
+ templateId: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ orgSlug: string;
21
+ projectKey: string;
22
+ templateId: string;
23
+ }, {
24
+ orgSlug: string;
25
+ projectKey: string;
26
+ templateId: string;
27
+ }>;
28
+ export type ApplyBoardTemplateToolInput = z.infer<typeof applyBoardTemplateToolSchema>;
29
+ export declare function executeApplyBoardTemplate(input: ApplyBoardTemplateToolInput): Promise<string>;
30
+ export declare const cloneBoardConfigToolName = "llama_clone_board_config";
31
+ export declare const cloneBoardConfigToolDescription = "Clone board settings from one project to another within the same organization.\nThis copies all column configurations including AI agent settings, WIP limits, and other settings.\nBoth projects must exist in the same organization.";
32
+ export declare const cloneBoardConfigToolSchema: z.ZodObject<{
33
+ orgSlug: z.ZodString;
34
+ sourceProjectKey: z.ZodString;
35
+ targetProjectKey: z.ZodString;
36
+ }, "strip", z.ZodTypeAny, {
37
+ orgSlug: string;
38
+ sourceProjectKey: string;
39
+ targetProjectKey: string;
40
+ }, {
41
+ orgSlug: string;
42
+ sourceProjectKey: string;
43
+ targetProjectKey: string;
44
+ }>;
45
+ export type CloneBoardConfigToolInput = z.infer<typeof cloneBoardConfigToolSchema>;
46
+ export declare function executeCloneBoardConfig(input: CloneBoardConfigToolInput): Promise<string>;
47
+ //# sourceMappingURL=boardTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boardTemplates.d.ts","sourceRoot":"","sources":["../../src/tools/boardTemplates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,eAAO,MAAM,iCAAiC,8NAEiC,CAAC;AAEhF,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEvF,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,MAAM,CAAC,CAoCjB;AAMD,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,eAAO,MAAM,iCAAiC,oOAE0C,CAAC;AAEzF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;EAIvC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEvF,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,MAAM,CAAC,CAiCjB;AAMD,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAEnE,eAAO,MAAM,+BAA+B,2OAEO,CAAC;AAEpD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,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,CAiCjB"}
@@ -0,0 +1,119 @@
1
+ import { z } from 'zod';
2
+ import { getApiClient, LlamaApiError } from '../api-client.js';
3
+ // ============================================
4
+ // List Board Templates
5
+ // ============================================
6
+ export const listBoardTemplatesToolName = 'llama_list_board_templates';
7
+ export const listBoardTemplatesToolDescription = `List available board templates at organization level.
8
+ Board templates provide pre-configured column setups with AI agent configurations.
9
+ Use this to see what templates are available before applying one to a project.`;
10
+ export const listBoardTemplatesToolSchema = z.object({
11
+ orgSlug: z.string().describe('Organization slug'),
12
+ });
13
+ export async function executeListBoardTemplates(input) {
14
+ try {
15
+ const client = getApiClient();
16
+ const templates = await client.listBoardTemplates(input.orgSlug);
17
+ return JSON.stringify({
18
+ success: true,
19
+ templates: templates.map((t) => ({
20
+ id: t.id,
21
+ name: t.name,
22
+ description: t.description,
23
+ isDefault: t.isDefault,
24
+ columnCount: t.columnCount,
25
+ })),
26
+ count: templates.length,
27
+ }, null, 2);
28
+ }
29
+ catch (error) {
30
+ if (error instanceof LlamaApiError) {
31
+ return JSON.stringify({
32
+ success: false,
33
+ error: `Failed to list board templates: ${error.message}`,
34
+ statusCode: error.statusCode,
35
+ });
36
+ }
37
+ return JSON.stringify({
38
+ success: false,
39
+ error: error instanceof Error ? error.message : 'Unknown error',
40
+ });
41
+ }
42
+ }
43
+ // ============================================
44
+ // Apply Board Template
45
+ // ============================================
46
+ export const applyBoardTemplateToolName = 'llama_apply_board_template';
47
+ export const applyBoardTemplateToolDescription = `Apply a template to a project's board.
48
+ This updates the board columns with the template's configuration, including AI agent settings.
49
+ Use llama_list_board_templates first to see available templates and get the templateId.`;
50
+ export const applyBoardTemplateToolSchema = z.object({
51
+ orgSlug: z.string().describe('Organization slug'),
52
+ projectKey: z.string().describe('Project key to apply template to'),
53
+ templateId: z.string().describe('Template ID (from llama_list_board_templates)'),
54
+ });
55
+ export async function executeApplyBoardTemplate(input) {
56
+ try {
57
+ const client = getApiClient();
58
+ const result = await client.applyBoardTemplate(input.orgSlug, input.templateId, input.projectKey);
59
+ return JSON.stringify({
60
+ success: true,
61
+ message: result.message,
62
+ templateName: result.templateName,
63
+ projectKey: result.projectKey,
64
+ columnsUpdated: result.columnsUpdated,
65
+ });
66
+ }
67
+ catch (error) {
68
+ if (error instanceof LlamaApiError) {
69
+ return JSON.stringify({
70
+ success: false,
71
+ error: `Failed to apply board template: ${error.message}`,
72
+ statusCode: error.statusCode,
73
+ });
74
+ }
75
+ return JSON.stringify({
76
+ success: false,
77
+ error: error instanceof Error ? error.message : 'Unknown error',
78
+ });
79
+ }
80
+ }
81
+ // ============================================
82
+ // Clone Board Configuration
83
+ // ============================================
84
+ export const cloneBoardConfigToolName = 'llama_clone_board_config';
85
+ export const cloneBoardConfigToolDescription = `Clone board settings from one project to another within the same organization.
86
+ This copies all column configurations including AI agent settings, WIP limits, and other settings.
87
+ Both projects must exist in the same organization.`;
88
+ export const cloneBoardConfigToolSchema = z.object({
89
+ orgSlug: z.string().describe('Organization slug'),
90
+ sourceProjectKey: z.string().describe('Source project key to copy from'),
91
+ targetProjectKey: z.string().describe('Target project key to copy to'),
92
+ });
93
+ export async function executeCloneBoardConfig(input) {
94
+ try {
95
+ const client = getApiClient();
96
+ const result = await client.cloneBoardConfiguration(input.orgSlug, input.sourceProjectKey, input.targetProjectKey);
97
+ return JSON.stringify({
98
+ success: true,
99
+ message: result.message,
100
+ sourceProject: input.sourceProjectKey,
101
+ targetProject: input.targetProjectKey,
102
+ columnsUpdated: result.columnsUpdated,
103
+ });
104
+ }
105
+ catch (error) {
106
+ if (error instanceof LlamaApiError) {
107
+ return JSON.stringify({
108
+ success: false,
109
+ error: `Failed to clone board configuration: ${error.message}`,
110
+ statusCode: error.statusCode,
111
+ });
112
+ }
113
+ return JSON.stringify({
114
+ success: false,
115
+ error: error instanceof Error ? error.message : 'Unknown error',
116
+ });
117
+ }
118
+ }
119
+ //# sourceMappingURL=boardTemplates.js.map
@@ -0,0 +1 @@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CAAC,SAAS,CACnB;YACE,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,aAAa,EAAE,KAAK,CAAC,gBAAgB;YACrC,aAAa,EAAE,KAAK,CAAC,gBAAgB;YACrC,cAAc,EAAE,MAAM,CAAC,cAAc;SACtC,CAAC,CAAC;IACP,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,aAAa,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,SAAS,CACnB;gBACE,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,wCAAwC,KAAK,CAAC,OAAO,EAAE;gBAC9D,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC,CAAC;QACP,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,CAAC,CAAC;IACP,CAAC;AACH,CAAC"}
@@ -2,58 +2,58 @@ import { z } from 'zod';
2
2
  export declare const listBoardsToolName = "llama_list_boards";
3
3
  export declare const listBoardsToolDescription = "List all boards in a project.\nEach project typically has one default board, but can have multiple.";
4
4
  export declare const listBoardsToolSchema: z.ZodObject<{
5
- orgSlug: z.ZodString;
6
- projectKey: z.ZodString;
5
+ orgSlug: z.ZodOptional<z.ZodString>;
6
+ projectKey: z.ZodOptional<z.ZodString>;
7
7
  }, "strip", z.ZodTypeAny, {
8
- orgSlug: string;
9
- projectKey: string;
8
+ orgSlug?: string | undefined;
9
+ projectKey?: string | undefined;
10
10
  }, {
11
- orgSlug: string;
12
- projectKey: string;
11
+ orgSlug?: string | undefined;
12
+ projectKey?: string | undefined;
13
13
  }>;
14
14
  export type ListBoardsToolInput = z.infer<typeof listBoardsToolSchema>;
15
15
  export declare function executeListBoards(input: ListBoardsToolInput): Promise<string>;
16
16
  export declare const getBoardToolName = "llama_get_board";
17
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
18
  export declare const getBoardToolSchema: z.ZodObject<{
19
- orgSlug: z.ZodString;
20
- projectKey: z.ZodString;
19
+ orgSlug: z.ZodOptional<z.ZodString>;
20
+ projectKey: z.ZodOptional<z.ZodString>;
21
21
  boardId: z.ZodString;
22
22
  }, "strip", z.ZodTypeAny, {
23
- orgSlug: string;
24
- projectKey: string;
25
23
  boardId: string;
24
+ orgSlug?: string | undefined;
25
+ projectKey?: string | undefined;
26
26
  }, {
27
- orgSlug: string;
28
- projectKey: string;
29
27
  boardId: string;
28
+ orgSlug?: string | undefined;
29
+ projectKey?: string | undefined;
30
30
  }>;
31
31
  export type GetBoardToolInput = z.infer<typeof getBoardToolSchema>;
32
32
  export declare function executeGetBoard(input: GetBoardToolInput): Promise<string>;
33
33
  export declare const moveIssueOnBoardToolName = "llama_move_issue_on_board";
34
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
35
  export declare const moveIssueOnBoardToolSchema: z.ZodObject<{
36
- orgSlug: z.ZodString;
37
- projectKey: z.ZodString;
36
+ orgSlug: z.ZodOptional<z.ZodString>;
37
+ projectKey: z.ZodOptional<z.ZodString>;
38
38
  boardId: z.ZodString;
39
39
  issueId: z.ZodString;
40
40
  columnId: z.ZodString;
41
41
  afterIssueId: z.ZodOptional<z.ZodString>;
42
42
  beforeIssueId: z.ZodOptional<z.ZodString>;
43
43
  }, "strip", z.ZodTypeAny, {
44
- orgSlug: string;
45
- projectKey: string;
44
+ columnId: string;
46
45
  boardId: string;
47
46
  issueId: string;
48
- columnId: string;
47
+ orgSlug?: string | undefined;
48
+ projectKey?: string | undefined;
49
49
  afterIssueId?: string | undefined;
50
50
  beforeIssueId?: string | undefined;
51
51
  }, {
52
- orgSlug: string;
53
- projectKey: string;
52
+ columnId: string;
54
53
  boardId: string;
55
54
  issueId: string;
56
- columnId: string;
55
+ orgSlug?: string | undefined;
56
+ projectKey?: string | undefined;
57
57
  afterIssueId?: string | undefined;
58
58
  beforeIssueId?: string | undefined;
59
59
  }>;
@@ -1 +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"}
1
+ {"version":3,"file":"boards.d.ts","sourceRoot":"","sources":["../../src/tools/boards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD,eAAO,MAAM,yBAAyB,wGAC+B,CAAC;AAEtE,eAAO,MAAM,oBAAoB;;;;;;;;;EAS/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,CAiEjB;AAMD,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAElD,eAAO,MAAM,uBAAuB,gLAE2B,CAAC;AAEhE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAU7B,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,CA+FjB;AAMD,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAEpE,eAAO,MAAM,+BAA+B,wMAE8B,CAAC;AAE3E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;EAoBrC,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,CAiGjB"}
@@ -1,5 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { getApiClient, LlamaApiError } from '../api-client.js';
3
+ import { getColumnInstructionsForStatus } from '../utils/column-instructions.js';
4
+ import { getSessionDefaults } from './session.js';
3
5
  // ============================================
4
6
  // List Boards
5
7
  // ============================================
@@ -7,13 +9,41 @@ export const listBoardsToolName = 'llama_list_boards';
7
9
  export const listBoardsToolDescription = `List all boards in a project.
8
10
  Each project typically has one default board, but can have multiple.`;
9
11
  export const listBoardsToolSchema = z.object({
10
- orgSlug: z.string().describe('Organization slug'),
11
- projectKey: z.string().describe('Project key'),
12
+ orgSlug: z
13
+ .string()
14
+ .optional()
15
+ .describe('Organization slug (uses session default if not provided)'),
16
+ projectKey: z
17
+ .string()
18
+ .optional()
19
+ .describe('Project key (uses session default if not provided)'),
12
20
  });
13
21
  export async function executeListBoards(input) {
14
22
  try {
23
+ const session = await getSessionDefaults();
24
+ const orgSlug = input.orgSlug ?? session?.orgSlug;
25
+ const projectKey = input.projectKey ?? session?.projectKey;
26
+ if (!orgSlug) {
27
+ return JSON.stringify({
28
+ success: false,
29
+ error: 'orgSlug is required. Either provide it or set session context with llama_set_context first.',
30
+ });
31
+ }
32
+ if (!projectKey) {
33
+ return JSON.stringify({
34
+ success: false,
35
+ error: 'projectKey is required. Either provide it or set session context with llama_set_context first.',
36
+ });
37
+ }
15
38
  const client = getApiClient();
16
- const boards = await client.listBoards(input.orgSlug, input.projectKey);
39
+ // Record tool call
40
+ try {
41
+ await client.recordToolCall('llama_list_boards', { orgSlug, projectKey });
42
+ }
43
+ catch {
44
+ // Ignore recording errors
45
+ }
46
+ const boards = await client.listBoards(orgSlug, projectKey);
17
47
  return JSON.stringify({
18
48
  success: true,
19
49
  boards: boards.map((b) => ({
@@ -30,12 +60,12 @@ export async function executeListBoards(input) {
30
60
  success: false,
31
61
  error: `Failed to list boards: ${error.message}`,
32
62
  statusCode: error.statusCode,
33
- }, null, 2);
63
+ });
34
64
  }
35
65
  return JSON.stringify({
36
66
  success: false,
37
67
  error: error instanceof Error ? error.message : 'Unknown error',
38
- }, null, 2);
68
+ });
39
69
  }
40
70
  }
41
71
  // ============================================
@@ -46,14 +76,42 @@ export const getBoardToolDescription = `Get a board with all its columns and iss
46
76
  Returns the full board state including issues in each column.
47
77
  Use this to see the current state of work on the Kanban board.`;
48
78
  export const getBoardToolSchema = z.object({
49
- orgSlug: z.string().describe('Organization slug'),
50
- projectKey: z.string().describe('Project key'),
79
+ orgSlug: z
80
+ .string()
81
+ .optional()
82
+ .describe('Organization slug (uses session default if not provided)'),
83
+ projectKey: z
84
+ .string()
85
+ .optional()
86
+ .describe('Project key (uses session default if not provided)'),
51
87
  boardId: z.string().describe('Board ID (from llama_list_boards)'),
52
88
  });
53
89
  export async function executeGetBoard(input) {
54
90
  try {
91
+ const session = await getSessionDefaults();
92
+ const orgSlug = input.orgSlug ?? session?.orgSlug;
93
+ const projectKey = input.projectKey ?? session?.projectKey;
94
+ if (!orgSlug) {
95
+ return JSON.stringify({
96
+ success: false,
97
+ error: 'orgSlug is required. Either provide it or set session context with llama_set_context first.',
98
+ });
99
+ }
100
+ if (!projectKey) {
101
+ return JSON.stringify({
102
+ success: false,
103
+ error: 'projectKey is required. Either provide it or set session context with llama_set_context first.',
104
+ });
105
+ }
55
106
  const client = getApiClient();
56
- const board = await client.getBoard(input.orgSlug, input.projectKey, input.boardId);
107
+ // Record tool call
108
+ try {
109
+ await client.recordToolCall('llama_get_board', { orgSlug, projectKey });
110
+ }
111
+ catch {
112
+ // Ignore recording errors
113
+ }
114
+ const board = await client.getBoard(orgSlug, projectKey, input.boardId);
57
115
  // Group issues by statusId (API returns flat array, we need to associate with columns)
58
116
  const issuesByStatus = new Map();
59
117
  for (const issue of board.issues ?? []) {
@@ -89,7 +147,7 @@ export async function executeGetBoard(input) {
89
147
  return JSON.stringify({
90
148
  success: true,
91
149
  board: formattedBoard,
92
- }, null, 2);
150
+ });
93
151
  }
94
152
  catch (error) {
95
153
  if (error instanceof LlamaApiError) {
@@ -97,12 +155,12 @@ export async function executeGetBoard(input) {
97
155
  success: false,
98
156
  error: `Failed to get board: ${error.message}`,
99
157
  statusCode: error.statusCode,
100
- }, null, 2);
158
+ });
101
159
  }
102
160
  return JSON.stringify({
103
161
  success: false,
104
162
  error: error instanceof Error ? error.message : 'Unknown error',
105
- }, null, 2);
163
+ });
106
164
  }
107
165
  }
108
166
  // ============================================
@@ -113,8 +171,14 @@ export const moveIssueOnBoardToolDescription = `Move an issue to a different col
113
171
  This changes the issue's status based on the column's status mapping.
114
172
  Optionally specify afterIssueId or beforeIssueId for precise positioning.`;
115
173
  export const moveIssueOnBoardToolSchema = z.object({
116
- orgSlug: z.string().describe('Organization slug'),
117
- projectKey: z.string().describe('Project key'),
174
+ orgSlug: z
175
+ .string()
176
+ .optional()
177
+ .describe('Organization slug (uses session default if not provided)'),
178
+ projectKey: z
179
+ .string()
180
+ .optional()
181
+ .describe('Project key (uses session default if not provided)'),
118
182
  boardId: z.string().describe('Board ID'),
119
183
  issueId: z.string().describe('Issue ID to move'),
120
184
  columnId: z.string().describe('Target column ID'),
@@ -129,17 +193,55 @@ export const moveIssueOnBoardToolSchema = z.object({
129
193
  });
130
194
  export async function executeMoveIssueOnBoard(input) {
131
195
  try {
196
+ const session = await getSessionDefaults();
197
+ const orgSlug = input.orgSlug ?? session?.orgSlug;
198
+ const projectKey = input.projectKey ?? session?.projectKey;
199
+ if (!orgSlug) {
200
+ return JSON.stringify({
201
+ success: false,
202
+ error: 'orgSlug is required. Either provide it or set session context with llama_set_context first.',
203
+ });
204
+ }
205
+ if (!projectKey) {
206
+ return JSON.stringify({
207
+ success: false,
208
+ error: 'projectKey is required. Either provide it or set session context with llama_set_context first.',
209
+ });
210
+ }
132
211
  const client = getApiClient();
133
- await client.moveIssueOnBoard(input.orgSlug, input.projectKey, input.boardId, {
212
+ // Record tool call
213
+ try {
214
+ await client.recordToolCall('llama_move_issue_on_board', { orgSlug, projectKey });
215
+ }
216
+ catch {
217
+ // Ignore recording errors
218
+ }
219
+ // First, get the board to find the status ID for the target column
220
+ const board = await client.getBoard(orgSlug, projectKey, input.boardId);
221
+ const targetColumn = board.columns.find((col) => col.id === input.columnId);
222
+ if (!targetColumn) {
223
+ return JSON.stringify({
224
+ success: false,
225
+ error: 'Target column not found on board',
226
+ });
227
+ }
228
+ await client.moveIssueOnBoard(orgSlug, projectKey, input.boardId, {
134
229
  issueId: input.issueId,
135
230
  columnId: input.columnId,
136
231
  afterIssueId: input.afterIssueId,
137
232
  beforeIssueId: input.beforeIssueId,
138
233
  });
139
- return JSON.stringify({
234
+ // Check if the target column has AI instructions
235
+ const columnInstructions = await getColumnInstructionsForStatus(orgSlug, projectKey, targetColumn.statusId);
236
+ const response = {
140
237
  success: true,
141
- message: `Moved issue to column`,
142
- }, null, 2);
238
+ message: `Moved issue to column "${targetColumn.name}"`,
239
+ };
240
+ // Add column instructions if they exist
241
+ if (columnInstructions) {
242
+ response.columnInstructions = columnInstructions;
243
+ }
244
+ return JSON.stringify(response);
143
245
  }
144
246
  catch (error) {
145
247
  if (error instanceof LlamaApiError) {
@@ -147,12 +249,12 @@ export async function executeMoveIssueOnBoard(input) {
147
249
  success: false,
148
250
  error: `Failed to move issue: ${error.message}`,
149
251
  statusCode: error.statusCode,
150
- }, null, 2);
252
+ });
151
253
  }
152
254
  return JSON.stringify({
153
255
  success: false,
154
256
  error: error instanceof Error ? error.message : 'Unknown error',
155
- }, null, 2);
257
+ });
156
258
  }
157
259
  }
158
260
  //# sourceMappingURL=boards.js.map