@khanglvm/jira-mcp 1.3.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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -0
  3. package/dist/client.d.ts +287 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +235 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/config-fetcher.d.ts +30 -0
  8. package/dist/config-fetcher.d.ts.map +1 -0
  9. package/dist/config-fetcher.js +279 -0
  10. package/dist/config-fetcher.js.map +1 -0
  11. package/dist/config.d.ts +54 -0
  12. package/dist/config.d.ts.map +1 -0
  13. package/dist/config.js +66 -0
  14. package/dist/config.js.map +1 -0
  15. package/dist/index.d.ts +12 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +228 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/mcp-registry.d.ts +106 -0
  20. package/dist/mcp-registry.d.ts.map +1 -0
  21. package/dist/mcp-registry.js +168 -0
  22. package/dist/mcp-registry.js.map +1 -0
  23. package/dist/setup.d.ts +41 -0
  24. package/dist/setup.d.ts.map +1 -0
  25. package/dist/setup.js +263 -0
  26. package/dist/setup.js.map +1 -0
  27. package/dist/tools/index.d.ts +10 -0
  28. package/dist/tools/index.d.ts.map +1 -0
  29. package/dist/tools/index.js +10 -0
  30. package/dist/tools/index.js.map +1 -0
  31. package/dist/tools/issues.d.ts +364 -0
  32. package/dist/tools/issues.d.ts.map +1 -0
  33. package/dist/tools/issues.js +392 -0
  34. package/dist/tools/issues.js.map +1 -0
  35. package/dist/tools/projects.d.ts +70 -0
  36. package/dist/tools/projects.d.ts.map +1 -0
  37. package/dist/tools/projects.js +101 -0
  38. package/dist/tools/projects.js.map +1 -0
  39. package/dist/tools/search.d.ts +76 -0
  40. package/dist/tools/search.d.ts.map +1 -0
  41. package/dist/tools/search.js +111 -0
  42. package/dist/tools/search.js.map +1 -0
  43. package/dist/tools/transitions.d.ts +99 -0
  44. package/dist/tools/transitions.d.ts.map +1 -0
  45. package/dist/tools/transitions.js +121 -0
  46. package/dist/tools/transitions.js.map +1 -0
  47. package/dist/tools/users.d.ts +70 -0
  48. package/dist/tools/users.d.ts.map +1 -0
  49. package/dist/tools/users.js +96 -0
  50. package/dist/tools/users.js.map +1 -0
  51. package/dist/types/mcp-config.d.ts +154 -0
  52. package/dist/types/mcp-config.d.ts.map +1 -0
  53. package/dist/types/mcp-config.js +7 -0
  54. package/dist/types/mcp-config.js.map +1 -0
  55. package/dist/utils/path-resolver.d.ts +16 -0
  56. package/dist/utils/path-resolver.d.ts.map +1 -0
  57. package/dist/utils/path-resolver.js +37 -0
  58. package/dist/utils/path-resolver.js.map +1 -0
  59. package/package.json +61 -0
package/dist/setup.js ADDED
@@ -0,0 +1,263 @@
1
+ /**
2
+ * @file setup.ts
3
+ * @description CLI setup command for injecting MCP configuration into various AI tools.
4
+ * Dynamically supports all MCP clients from the registry (14 tools).
5
+ */
6
+ import * as fs from 'fs';
7
+ import * as path from 'path';
8
+ import { createRegistry } from './mcp-registry.js';
9
+ import { mapPlatform, resolvePlatformPath } from './utils/path-resolver.js';
10
+ /** Registry cache for avoiding repeated fetches */
11
+ let registryCache = null;
12
+ /**
13
+ * Initializes the MCP registry (cached).
14
+ * @returns Initialized MCP registry
15
+ */
16
+ async function initializeRegistry() {
17
+ if (!registryCache) {
18
+ registryCache = await createRegistry();
19
+ }
20
+ return registryCache;
21
+ }
22
+ /**
23
+ * Expands environment variables and home directory in a path.
24
+ */
25
+ function expandPath(filePath) {
26
+ return path.resolve(resolvePlatformPath(filePath));
27
+ }
28
+ /**
29
+ * Gets the config file path and format for each CLI tool using the MCP registry.
30
+ * @param cli - Target CLI tool
31
+ * @param scope - User or project scope
32
+ * @returns Config file info or null if unsupported
33
+ */
34
+ async function getConfigFileInfo(cli, scope) {
35
+ const registry = await initializeRegistry();
36
+ const client = registry.getClient(cli);
37
+ if (!client) {
38
+ return null;
39
+ }
40
+ // Check if client supports the requested scope
41
+ if (!registry.supportsScope(cli, scope)) {
42
+ return null;
43
+ }
44
+ // Map Node.js platform to registry platform key
45
+ const platformKey = mapPlatform(process.platform);
46
+ const platformLocations = client.configLocations[platformKey];
47
+ if (!platformLocations) {
48
+ return null;
49
+ }
50
+ // Get path for the requested scope
51
+ // PlatformPaths has: global?, user?, project?, workspace?, local?, managed?, globalAlt?
52
+ const scopePath = platformLocations[scope];
53
+ if (!scopePath || typeof scopePath !== 'string') {
54
+ return null;
55
+ }
56
+ // Expand environment variables and home directory
57
+ const expandedPath = expandPath(scopePath);
58
+ return {
59
+ path: expandedPath,
60
+ wrapperKey: client.configFormat.wrapperKey,
61
+ serverKey: 'jira',
62
+ };
63
+ }
64
+ /**
65
+ * Creates the MCP server configuration for Jira.
66
+ * @param options - Setup options with credentials
67
+ * @returns MCP server config object
68
+ */
69
+ function createJiraServerConfig(options) {
70
+ return {
71
+ command: 'npx',
72
+ args: ['-y', '@khanglvm/jira-mcp'],
73
+ env: {
74
+ JIRA_BASE_URL: options.baseUrl,
75
+ JIRA_USERNAME: options.username,
76
+ JIRA_PASSWORD: options.password,
77
+ },
78
+ };
79
+ }
80
+ /**
81
+ * Reads existing config file or returns empty object.
82
+ * @param filePath - Path to config file
83
+ * @returns Parsed JSON object
84
+ */
85
+ function readConfigFile(filePath) {
86
+ try {
87
+ if (fs.existsSync(filePath)) {
88
+ const content = fs.readFileSync(filePath, 'utf-8');
89
+ return JSON.parse(content);
90
+ }
91
+ }
92
+ catch (error) {
93
+ console.warn(`Warning: Could not read existing config at ${filePath}`);
94
+ }
95
+ return {};
96
+ }
97
+ /**
98
+ * Ensures parent directories exist.
99
+ * @param filePath - File path to ensure directories for
100
+ */
101
+ function ensureDirectoryExists(filePath) {
102
+ const dir = path.dirname(filePath);
103
+ if (!fs.existsSync(dir)) {
104
+ fs.mkdirSync(dir, { recursive: true });
105
+ }
106
+ }
107
+ /**
108
+ * Injects MCP configuration into the target CLI tool's config file.
109
+ * @param options - Setup options
110
+ * @returns Result message
111
+ */
112
+ export async function injectMcpConfig(options) {
113
+ const configInfo = await getConfigFileInfo(options.cli, options.scope);
114
+ if (!configInfo) {
115
+ return {
116
+ success: false,
117
+ message: `Error: ${options.cli} does not support ${options.scope} scope configuration.`,
118
+ };
119
+ }
120
+ try {
121
+ // Read existing config
122
+ const config = readConfigFile(configInfo.path);
123
+ // Get or create the wrapper object (mcpServers, servers, etc.)
124
+ const wrapperKey = configInfo.wrapperKey;
125
+ if (!config[wrapperKey]) {
126
+ config[wrapperKey] = {};
127
+ }
128
+ const wrapper = config[wrapperKey];
129
+ // Check if jira config already exists
130
+ if (wrapper[configInfo.serverKey]) {
131
+ console.log(`ℹ️ Existing Jira MCP configuration found. Updating...`);
132
+ }
133
+ // Add/update Jira server config
134
+ wrapper[configInfo.serverKey] = createJiraServerConfig(options);
135
+ // Ensure directory exists and write file
136
+ ensureDirectoryExists(configInfo.path);
137
+ fs.writeFileSync(configInfo.path, JSON.stringify(config, null, 2) + '\n', 'utf-8');
138
+ return {
139
+ success: true,
140
+ message: `✅ Successfully configured Jira MCP for ${options.cli} (${options.scope} scope)\n Config file: ${configInfo.path}`,
141
+ };
142
+ }
143
+ catch (error) {
144
+ return {
145
+ success: false,
146
+ message: `Error writing config: ${error.message}`,
147
+ };
148
+ }
149
+ }
150
+ /**
151
+ * Parses CLI arguments for setup command.
152
+ * @param args - Command line arguments
153
+ * @returns Parsed options or null if invalid
154
+ */
155
+ export function parseSetupArgs(args) {
156
+ const options = {
157
+ scope: 'user', // Default scope
158
+ };
159
+ for (let i = 0; i < args.length; i++) {
160
+ const arg = args[i];
161
+ const nextArg = args[i + 1];
162
+ switch (arg) {
163
+ case '-c':
164
+ case '--cli':
165
+ options.cli = nextArg;
166
+ i++;
167
+ break;
168
+ case '-b':
169
+ case '--base-url':
170
+ case '--url':
171
+ options.baseUrl = nextArg;
172
+ i++;
173
+ break;
174
+ case '-u':
175
+ case '--username':
176
+ options.username = nextArg;
177
+ i++;
178
+ break;
179
+ case '-p':
180
+ case '--password':
181
+ options.password = nextArg;
182
+ i++;
183
+ break;
184
+ case '-s':
185
+ case '--scope':
186
+ options.scope = nextArg;
187
+ i++;
188
+ break;
189
+ }
190
+ }
191
+ // Validate required fields
192
+ const validClis = [
193
+ 'claude-code', 'claude-desktop', 'github-copilot', 'cursor',
194
+ 'windsurf', 'roo-code', 'zed', 'factory-droid', 'antigravity', 'gemini-cli',
195
+ 'opencode', 'vscode-copilot', 'jetbrains-copilot', 'codex-cli'
196
+ ];
197
+ if (!options.cli || !validClis.includes(options.cli)) {
198
+ return null;
199
+ }
200
+ if (!options.baseUrl || !options.username || !options.password) {
201
+ return null;
202
+ }
203
+ if (options.scope && !['user', 'project'].includes(options.scope)) {
204
+ return null;
205
+ }
206
+ return options;
207
+ }
208
+ /**
209
+ * Prints setup help message.
210
+ */
211
+ export function printSetupHelp() {
212
+ console.log(`
213
+ Jira MCP Setup - Inject configuration into AI tool config files
214
+
215
+ Usage:
216
+ npx @khanglvm/jira-mcp setup -c <cli> -b <url> -u <user> -p <pass> [-s <scope>]
217
+
218
+ Arguments:
219
+ -c, --cli Target CLI tool (required)
220
+ Options: claude-code, claude-desktop, github-copilot, cursor,
221
+ windsurf, roo-code, zed, factory-droid, antigravity,
222
+ gemini-cli, opencode, vscode-copilot, jetbrains-copilot,
223
+ codex-cli
224
+
225
+ -b, --base-url Jira base URL (required)
226
+ -u, --username Jira username (required)
227
+ -p, --password Jira password (required)
228
+ -s, --scope Configuration scope (optional, default: user)
229
+ Options: user, project
230
+
231
+ Examples:
232
+ npx @khanglvm/jira-mcp setup -c claude-code -b https://jira.example.com -u admin -p secret
233
+ npx @khanglvm/jira-mcp setup -c cursor -b https://jira.example.com -u admin -p secret -s project
234
+
235
+ Supported CLI Tools:
236
+ claude-code, claude-desktop, github-copilot, cursor, windsurf, roo-code, zed,
237
+ factory-droid, antigravity, gemini-cli, opencode, vscode-copilot, jetbrains-copilot,
238
+ codex-cli
239
+ `);
240
+ }
241
+ /**
242
+ * Lists all supported CLI tools.
243
+ */
244
+ export function printSupportedClis() {
245
+ console.log(`
246
+ Supported CLI tools (14):
247
+ • claude-code - Claude Code (Anthropic)
248
+ • claude-desktop - Claude Desktop App
249
+ • github-copilot - GitHub Copilot (VS Code)
250
+ • cursor - Cursor AI Editor
251
+ • windsurf - Windsurf (Codeium)
252
+ • roo-code - Roo Code
253
+ • zed - Zed Editor
254
+ • factory-droid - Factory Droid AI
255
+ • antigravity - Google Antigravity IDE
256
+ • gemini-cli - Gemini CLI (Google)
257
+ • opencode - OpenCode Editor
258
+ • vscode-copilot - VS Code Copilot Extension
259
+ • jetbrains-copilot - JetBrains IDEs
260
+ • codex-cli - Codex CLI
261
+ `);
262
+ }
263
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAe,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AA6C5E,mDAAmD;AACnD,IAAI,aAAa,GAAuB,IAAI,CAAC;AAE7C;;;GAGG;AACH,KAAK,UAAU,kBAAkB;IAC7B,IAAI,CAAC,aAAa,EAAE,CAAC;QACjB,aAAa,GAAG,MAAM,cAAc,EAAE,CAAC;IAC3C,CAAC;IACD,OAAO,aAAa,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,QAAgB;IAChC,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,iBAAiB,CAAC,GAAiB,EAAE,KAAkB;IAClE,MAAM,QAAQ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KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,OAAuB,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC1B,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Bf,CAAC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAC9B,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;CAgBf,CAAC,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file tools/index.ts
3
+ * @description Aggregates all tool exports for the Jira MCP server.
4
+ */
5
+ export * from './issues.js';
6
+ export * from './search.js';
7
+ export * from './projects.js';
8
+ export * from './transitions.js';
9
+ export * from './users.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file tools/index.ts
3
+ * @description Aggregates all tool exports for the Jira MCP server.
4
+ */
5
+ export * from './issues.js';
6
+ export * from './search.js';
7
+ export * from './projects.js';
8
+ export * from './transitions.js';
9
+ export * from './users.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,364 @@
1
+ /**
2
+ * @file tools/issues.ts
3
+ * @description Issue-related MCP tools for Jira.
4
+ * Provides tools for creating, reading, updating, and deleting issues.
5
+ */
6
+ import { z } from 'zod';
7
+ import { JiraClient } from '../client.js';
8
+ /**
9
+ * Schema for get_issue tool input.
10
+ */
11
+ export declare const getIssueSchema: z.ZodObject<{
12
+ issueKey: z.ZodString;
13
+ fields: z.ZodOptional<z.ZodString>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ issueKey: string;
16
+ fields?: string | undefined;
17
+ }, {
18
+ issueKey: string;
19
+ fields?: string | undefined;
20
+ }>;
21
+ /**
22
+ * Schema for create_issue tool input.
23
+ */
24
+ export declare const createIssueSchema: z.ZodObject<{
25
+ projectKey: z.ZodString;
26
+ summary: z.ZodString;
27
+ issueType: z.ZodDefault<z.ZodString>;
28
+ description: z.ZodOptional<z.ZodString>;
29
+ assignee: z.ZodOptional<z.ZodString>;
30
+ priority: z.ZodOptional<z.ZodString>;
31
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ summary: string;
34
+ projectKey: string;
35
+ issueType: string;
36
+ assignee?: string | undefined;
37
+ priority?: string | undefined;
38
+ description?: string | undefined;
39
+ labels?: string[] | undefined;
40
+ }, {
41
+ summary: string;
42
+ projectKey: string;
43
+ assignee?: string | undefined;
44
+ priority?: string | undefined;
45
+ description?: string | undefined;
46
+ labels?: string[] | undefined;
47
+ issueType?: string | undefined;
48
+ }>;
49
+ /**
50
+ * Schema for update_issue tool input.
51
+ */
52
+ export declare const updateIssueSchema: z.ZodObject<{
53
+ issueKey: z.ZodString;
54
+ summary: z.ZodOptional<z.ZodString>;
55
+ description: z.ZodOptional<z.ZodString>;
56
+ assignee: z.ZodNullable<z.ZodOptional<z.ZodString>>;
57
+ priority: z.ZodOptional<z.ZodString>;
58
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ issueKey: string;
61
+ summary?: string | undefined;
62
+ assignee?: string | null | undefined;
63
+ priority?: string | undefined;
64
+ description?: string | undefined;
65
+ labels?: string[] | undefined;
66
+ }, {
67
+ issueKey: string;
68
+ summary?: string | undefined;
69
+ assignee?: string | null | undefined;
70
+ priority?: string | undefined;
71
+ description?: string | undefined;
72
+ labels?: string[] | undefined;
73
+ }>;
74
+ /**
75
+ * Schema for delete_issue tool input.
76
+ */
77
+ export declare const deleteIssueSchema: z.ZodObject<{
78
+ issueKey: z.ZodString;
79
+ deleteSubtasks: z.ZodDefault<z.ZodBoolean>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ issueKey: string;
82
+ deleteSubtasks: boolean;
83
+ }, {
84
+ issueKey: string;
85
+ deleteSubtasks?: boolean | undefined;
86
+ }>;
87
+ /**
88
+ * Schema for add_comment tool input.
89
+ */
90
+ export declare const addCommentSchema: z.ZodObject<{
91
+ issueKey: z.ZodString;
92
+ body: z.ZodString;
93
+ }, "strip", z.ZodTypeAny, {
94
+ issueKey: string;
95
+ body: string;
96
+ }, {
97
+ issueKey: string;
98
+ body: string;
99
+ }>;
100
+ /**
101
+ * Schema for get_comments tool input.
102
+ */
103
+ export declare const getCommentsSchema: z.ZodObject<{
104
+ issueKey: z.ZodString;
105
+ }, "strip", z.ZodTypeAny, {
106
+ issueKey: string;
107
+ }, {
108
+ issueKey: string;
109
+ }>;
110
+ /**
111
+ * Creates issue tool handlers.
112
+ * @param client - Jira client instance
113
+ * @returns Object containing all issue tool handlers
114
+ */
115
+ export declare function createIssueTools(client: JiraClient): {
116
+ /**
117
+ * Gets an issue by key or ID.
118
+ */
119
+ jira_get_issue: (args: z.infer<typeof getIssueSchema>) => Promise<{
120
+ content: {
121
+ type: "text";
122
+ text: string;
123
+ }[];
124
+ }>;
125
+ /**
126
+ * Creates a new issue.
127
+ */
128
+ jira_create_issue: (args: z.infer<typeof createIssueSchema>) => Promise<{
129
+ content: {
130
+ type: "text";
131
+ text: string;
132
+ }[];
133
+ }>;
134
+ /**
135
+ * Updates an existing issue.
136
+ */
137
+ jira_update_issue: (args: z.infer<typeof updateIssueSchema>) => Promise<{
138
+ content: {
139
+ type: "text";
140
+ text: string;
141
+ }[];
142
+ }>;
143
+ /**
144
+ * Deletes an issue.
145
+ */
146
+ jira_delete_issue: (args: z.infer<typeof deleteIssueSchema>) => Promise<{
147
+ content: {
148
+ type: "text";
149
+ text: string;
150
+ }[];
151
+ }>;
152
+ /**
153
+ * Adds a comment to an issue.
154
+ */
155
+ jira_add_comment: (args: z.infer<typeof addCommentSchema>) => Promise<{
156
+ content: {
157
+ type: "text";
158
+ text: string;
159
+ }[];
160
+ }>;
161
+ /**
162
+ * Gets comments on an issue.
163
+ */
164
+ jira_get_comments: (args: z.infer<typeof getCommentsSchema>) => Promise<{
165
+ content: {
166
+ type: "text";
167
+ text: string;
168
+ }[];
169
+ }>;
170
+ };
171
+ /**
172
+ * Tool definitions for issue-related operations.
173
+ * Semantic descriptions help AI understand when to use each tool.
174
+ */
175
+ export declare const issueToolDefinitions: ({
176
+ name: string;
177
+ description: string;
178
+ inputSchema: {
179
+ type: "object";
180
+ properties: {
181
+ issueKey: {
182
+ type: string;
183
+ description: string;
184
+ };
185
+ fields: {
186
+ type: string;
187
+ description: string;
188
+ };
189
+ projectKey?: undefined;
190
+ summary?: undefined;
191
+ issueType?: undefined;
192
+ description?: undefined;
193
+ assignee?: undefined;
194
+ priority?: undefined;
195
+ labels?: undefined;
196
+ deleteSubtasks?: undefined;
197
+ body?: undefined;
198
+ };
199
+ required: string[];
200
+ };
201
+ } | {
202
+ name: string;
203
+ description: string;
204
+ inputSchema: {
205
+ type: "object";
206
+ properties: {
207
+ projectKey: {
208
+ type: string;
209
+ description: string;
210
+ };
211
+ summary: {
212
+ type: string;
213
+ description: string;
214
+ };
215
+ issueType: {
216
+ type: string;
217
+ description: string;
218
+ default: string;
219
+ };
220
+ description: {
221
+ type: string;
222
+ description: string;
223
+ };
224
+ assignee: {
225
+ type: string;
226
+ description: string;
227
+ };
228
+ priority: {
229
+ type: string;
230
+ description: string;
231
+ };
232
+ labels: {
233
+ type: string;
234
+ items: {
235
+ type: string;
236
+ };
237
+ description: string;
238
+ };
239
+ issueKey?: undefined;
240
+ fields?: undefined;
241
+ deleteSubtasks?: undefined;
242
+ body?: undefined;
243
+ };
244
+ required: string[];
245
+ };
246
+ } | {
247
+ name: string;
248
+ description: string;
249
+ inputSchema: {
250
+ type: "object";
251
+ properties: {
252
+ issueKey: {
253
+ type: string;
254
+ description: string;
255
+ };
256
+ summary: {
257
+ type: string;
258
+ description: string;
259
+ };
260
+ description: {
261
+ type: string;
262
+ description: string;
263
+ };
264
+ assignee: {
265
+ type: string[];
266
+ description: string;
267
+ };
268
+ priority: {
269
+ type: string;
270
+ description: string;
271
+ };
272
+ labels: {
273
+ type: string;
274
+ items: {
275
+ type: string;
276
+ };
277
+ description: string;
278
+ };
279
+ fields?: undefined;
280
+ projectKey?: undefined;
281
+ issueType?: undefined;
282
+ deleteSubtasks?: undefined;
283
+ body?: undefined;
284
+ };
285
+ required: string[];
286
+ };
287
+ } | {
288
+ name: string;
289
+ description: string;
290
+ inputSchema: {
291
+ type: "object";
292
+ properties: {
293
+ issueKey: {
294
+ type: string;
295
+ description: string;
296
+ };
297
+ deleteSubtasks: {
298
+ type: string;
299
+ description: string;
300
+ default: boolean;
301
+ };
302
+ fields?: undefined;
303
+ projectKey?: undefined;
304
+ summary?: undefined;
305
+ issueType?: undefined;
306
+ description?: undefined;
307
+ assignee?: undefined;
308
+ priority?: undefined;
309
+ labels?: undefined;
310
+ body?: undefined;
311
+ };
312
+ required: string[];
313
+ };
314
+ } | {
315
+ name: string;
316
+ description: string;
317
+ inputSchema: {
318
+ type: "object";
319
+ properties: {
320
+ issueKey: {
321
+ type: string;
322
+ description: string;
323
+ };
324
+ body: {
325
+ type: string;
326
+ description: string;
327
+ };
328
+ fields?: undefined;
329
+ projectKey?: undefined;
330
+ summary?: undefined;
331
+ issueType?: undefined;
332
+ description?: undefined;
333
+ assignee?: undefined;
334
+ priority?: undefined;
335
+ labels?: undefined;
336
+ deleteSubtasks?: undefined;
337
+ };
338
+ required: string[];
339
+ };
340
+ } | {
341
+ name: string;
342
+ description: string;
343
+ inputSchema: {
344
+ type: "object";
345
+ properties: {
346
+ issueKey: {
347
+ type: string;
348
+ description: string;
349
+ };
350
+ fields?: undefined;
351
+ projectKey?: undefined;
352
+ summary?: undefined;
353
+ issueType?: undefined;
354
+ description?: undefined;
355
+ assignee?: undefined;
356
+ priority?: undefined;
357
+ labels?: undefined;
358
+ deleteSubtasks?: undefined;
359
+ body?: undefined;
360
+ };
361
+ required: string[];
362
+ };
363
+ })[];
364
+ //# sourceMappingURL=issues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../src/tools/issues.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;EAMzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;EAW5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EAW5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;EAM5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;EAE5B,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU;IAE3C;;OAEG;2BAC0B,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC;;;;;;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