jira-pilot 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/README.md +54 -0
  2. package/bin/jira.ts +2 -0
  3. package/dist/bin/jira.js +2 -0
  4. package/dist/bin/jira.js.map +1 -1
  5. package/dist/src/commands/ai-actions/plan.js +1 -1
  6. package/dist/src/commands/ai-actions/plan.js.map +1 -1
  7. package/dist/src/commands/ai-actions/review.js +5 -4
  8. package/dist/src/commands/ai-actions/review.js.map +1 -1
  9. package/dist/src/commands/ai-actions/standup.js +1 -1
  10. package/dist/src/commands/ai-actions/standup.js.map +1 -1
  11. package/dist/src/commands/ai.js +1 -1
  12. package/dist/src/commands/ai.js.map +1 -1
  13. package/dist/src/commands/board.js +10 -5
  14. package/dist/src/commands/board.js.map +1 -1
  15. package/dist/src/commands/bulk.js +11 -10
  16. package/dist/src/commands/bulk.js.map +1 -1
  17. package/dist/src/commands/config.js +1 -1
  18. package/dist/src/commands/config.js.map +1 -1
  19. package/dist/src/commands/dashboard.js +19 -12
  20. package/dist/src/commands/dashboard.js.map +1 -1
  21. package/dist/src/commands/filter.js +7 -4
  22. package/dist/src/commands/filter.js.map +1 -1
  23. package/dist/src/commands/git.js +1 -1
  24. package/dist/src/commands/git.js.map +1 -1
  25. package/dist/src/commands/issue-attach.js +1 -1
  26. package/dist/src/commands/issue-attach.js.map +1 -1
  27. package/dist/src/commands/issue-pr.js +1 -1
  28. package/dist/src/commands/issue-pr.js.map +1 -1
  29. package/dist/src/commands/issue-worklog.js +10 -5
  30. package/dist/src/commands/issue-worklog.js.map +1 -1
  31. package/dist/src/commands/issue.js +173 -122
  32. package/dist/src/commands/issue.js.map +1 -1
  33. package/dist/src/commands/project.js +10 -5
  34. package/dist/src/commands/project.js.map +1 -1
  35. package/dist/src/commands/sprint.js +19 -8
  36. package/dist/src/commands/sprint.js.map +1 -1
  37. package/dist/src/commands/tui.d.ts +2 -0
  38. package/dist/src/commands/tui.js +10 -0
  39. package/dist/src/commands/tui.js.map +1 -0
  40. package/dist/src/server/mcp-server.js +209 -27
  41. package/dist/src/server/mcp-server.js.map +1 -1
  42. package/dist/src/services/ai-service.js +7 -4
  43. package/dist/src/services/ai-service.js.map +1 -1
  44. package/dist/src/services/api-service.d.ts +2 -0
  45. package/dist/src/services/api-service.js +32 -20
  46. package/dist/src/services/api-service.js.map +1 -1
  47. package/dist/src/tui/App.d.ts +1 -0
  48. package/dist/src/tui/App.js +26 -0
  49. package/dist/src/tui/App.js.map +1 -0
  50. package/dist/src/tui/index.d.ts +1 -0
  51. package/dist/src/tui/index.js +8 -0
  52. package/dist/src/tui/index.js.map +1 -0
  53. package/dist/src/tui/screens/BoardList.d.ts +1 -0
  54. package/dist/src/tui/screens/BoardList.js +71 -0
  55. package/dist/src/tui/screens/BoardList.js.map +1 -0
  56. package/dist/src/tui/screens/Dashboard.d.ts +1 -0
  57. package/dist/src/tui/screens/Dashboard.js +41 -0
  58. package/dist/src/tui/screens/Dashboard.js.map +1 -0
  59. package/dist/src/tui/screens/IssueDetail.d.ts +6 -0
  60. package/dist/src/tui/screens/IssueDetail.js +40 -0
  61. package/dist/src/tui/screens/IssueDetail.js.map +1 -0
  62. package/dist/src/tui/screens/IssueList.d.ts +1 -0
  63. package/dist/src/tui/screens/IssueList.js +72 -0
  64. package/dist/src/tui/screens/IssueList.js.map +1 -0
  65. package/dist/src/tui/screens/KanbanBoard.d.ts +6 -0
  66. package/dist/src/tui/screens/KanbanBoard.js +86 -0
  67. package/dist/src/tui/screens/KanbanBoard.js.map +1 -0
  68. package/dist/src/tui/utils/adf-render.d.ts +1 -0
  69. package/dist/src/tui/utils/adf-render.js +29 -0
  70. package/dist/src/tui/utils/adf-render.js.map +1 -0
  71. package/dist/src/utils/api-paths.d.ts +31 -0
  72. package/dist/src/utils/api-paths.js +32 -0
  73. package/dist/src/utils/api-paths.js.map +1 -0
  74. package/dist/src/utils/error-handler.d.ts +2 -2
  75. package/dist/src/utils/error-handler.js.map +1 -1
  76. package/dist/src/utils/http.d.ts +27 -0
  77. package/dist/src/utils/http.js +95 -0
  78. package/dist/src/utils/http.js.map +1 -0
  79. package/dist/src/utils/spinner.d.ts +21 -0
  80. package/dist/src/utils/spinner.js +79 -0
  81. package/dist/src/utils/spinner.js.map +1 -0
  82. package/package.json +10 -5
  83. package/src/commands/ai-actions/plan.ts +1 -1
  84. package/src/commands/ai-actions/review.ts +5 -4
  85. package/src/commands/ai-actions/standup.ts +1 -1
  86. package/src/commands/ai.ts +1 -1
  87. package/src/commands/board.ts +10 -5
  88. package/src/commands/bulk.ts +11 -10
  89. package/src/commands/config.ts +1 -1
  90. package/src/commands/dashboard.ts +20 -12
  91. package/src/commands/filter.ts +8 -5
  92. package/src/commands/git.ts +1 -1
  93. package/src/commands/issue-attach.ts +1 -1
  94. package/src/commands/issue-pr.ts +1 -1
  95. package/src/commands/issue-worklog.ts +10 -5
  96. package/src/commands/issue.ts +181 -124
  97. package/src/commands/project.ts +10 -5
  98. package/src/commands/sprint.ts +19 -8
  99. package/src/commands/tui.ts +11 -0
  100. package/src/server/mcp-server.ts +234 -27
  101. package/src/services/ai-service.ts +7 -4
  102. package/src/services/api-service.ts +34 -21
  103. package/src/tui/App.tsx +61 -0
  104. package/src/tui/index.tsx +8 -0
  105. package/src/tui/screens/BoardList.tsx +102 -0
  106. package/src/tui/screens/Dashboard.tsx +75 -0
  107. package/src/tui/screens/IssueDetail.tsx +93 -0
  108. package/src/tui/screens/IssueList.tsx +116 -0
  109. package/src/tui/screens/KanbanBoard.tsx +133 -0
  110. package/src/tui/utils/adf-render.ts +30 -0
  111. package/src/utils/api-paths.ts +32 -0
  112. package/src/utils/error-handler.ts +2 -2
  113. package/src/utils/http.ts +128 -0
  114. package/src/utils/spinner.ts +87 -0
@@ -1,10 +1,11 @@
1
1
  import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
- import Table from 'cli-table3';
4
- import ora from 'ora';
3
+ import { Table } from 'cmd-table';
4
+ import ora from '../utils/spinner.js';
5
5
  import enquirer from 'enquirer';
6
6
  import { api } from '../services/api-service.js';
7
7
  import { handleCommandError } from '../utils/error-handler.js';
8
+ import { API } from '../utils/api-paths.js';
8
9
 
9
10
  // Utility for status icons
10
11
  const getStatusIcon = (status: string) => {
@@ -67,11 +68,11 @@ export function registerDashboardCommand(program: Command) {
67
68
  console.clear();
68
69
  const spinner = ora('Loading dashboard...').start();
69
70
  try {
70
- const myself = await api.get('/myself');
71
+ const myself = await api.get(API.USER.MYSELF);
71
72
 
72
73
  // Fetch in parallel: my open issues + recently updated
73
74
  const [myIssues, recentIssues] = await Promise.all([
74
- api.post('/search/jql', {
75
+ api.post(API.SEARCH.JQL, {
75
76
  jql: 'assignee = currentUser() AND statusCategory != Done ORDER BY priority ASC, updated DESC', // Fixed Sort
76
77
  maxResults: 15,
77
78
  fields: ['summary', 'status', 'priority', 'updated', 'issuetype']
@@ -96,11 +97,17 @@ export function registerDashboardCommand(program: Command) {
96
97
 
97
98
  if (issues.length > 0) {
98
99
  const table = new Table({
99
- head: [chalk.bold('Key'), chalk.bold('Type'), chalk.bold('Summary'), chalk.bold('Status'), chalk.bold('Priority')]
100
+ columns: [
101
+ { name: chalk.bold('Key') },
102
+ { name: chalk.bold('Type') },
103
+ { name: chalk.bold('Summary') },
104
+ { name: chalk.bold('Status') },
105
+ { name: chalk.bold('Priority') }
106
+ ]
100
107
  });
101
108
 
102
109
  issues.forEach((i: any) => {
103
- table.push([
110
+ table.addRow([
104
111
  chalk.cyan(i.key),
105
112
  i.fields.issuetype?.name || '',
106
113
  i.fields.summary ? (i.fields.summary.length > 40 ? i.fields.summary.substring(0, 37) + '...' : i.fields.summary) : '',
@@ -108,7 +115,7 @@ export function registerDashboardCommand(program: Command) {
108
115
  getPriorityColor(i.fields.priority?.name || '', i.fields.priority?.name || '')
109
116
  ]);
110
117
  });
111
- console.log(table.toString());
118
+ console.log(table.render());
112
119
  } else {
113
120
  console.log(chalk.green(' 🎉 No open issues — nice work!'));
114
121
  }
@@ -168,7 +175,7 @@ export function registerDashboardCommand(program: Command) {
168
175
  if (issueAction === 'back') continue;
169
176
 
170
177
  if (issueAction === 'view') {
171
- const issue = await api.get(`/issue/${selectedKey}`);
178
+ const issue = await api.get(API.ISSUE.GET(selectedKey));
172
179
  console.log(chalk.bold(`\n${issue.key}: ${issue.fields.summary}`));
173
180
  console.log(chalk.grey('────────────────────────────────────────'));
174
181
  console.log(`${getStatusIcon(issue.fields.status.name)} ${issue.fields.status.name} | ${getPriorityColor(issue.fields.priority?.name || '', issue.fields.priority?.name || '')}`);
@@ -184,27 +191,28 @@ export function registerDashboardCommand(program: Command) {
184
191
  }) as any;
185
192
  if (inputComment) {
186
193
  const { textToADF } = await import('../utils/text-to-adf.js');
187
- await api.post(`/issue/${selectedKey}/comment`, { body: textToADF(inputComment) });
194
+ await api.post(API.ISSUE.COMMENT(selectedKey), { body: textToADF(inputComment) });
188
195
  console.log(chalk.green('Comment added.'));
189
196
  await pause();
190
197
  }
191
198
  }
192
199
 
193
200
  if (issueAction === 'transition') {
194
- const transData = await api.get(`/issue/${selectedKey}/transitions`);
201
+ const transData = await api.get(API.ISSUE.TRANSITIONS(selectedKey));
195
202
  const { transId } = await enquirer.prompt({
196
203
  type: 'select',
197
204
  name: 'transId',
198
205
  message: 'Select Status:',
199
206
  choices: transData.transitions.map((t: any) => ({ name: t.id, message: t.to.name }))
200
207
  }) as any;
201
- await api.post(`/issue/${selectedKey}/transitions`, { transition: { id: transId } });
208
+ await api.post(API.ISSUE.TRANSITIONS(selectedKey), { transition: { id: transId } });
202
209
  console.log(chalk.green('Transitioned.'));
203
210
  await pause();
204
211
  }
205
212
 
213
+
206
214
  if (issueAction === 'assign') {
207
- await api.put(`/issue/${selectedKey}/assignee`, { accountId: myself.accountId });
215
+ await api.put(API.ISSUE.ASSIGNEE(selectedKey), { accountId: myself.accountId });
208
216
  console.log(chalk.green('Assigned to you.'));
209
217
  await pause();
210
218
  }
@@ -1,8 +1,8 @@
1
1
  import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
- import Table from 'cli-table3';
3
+ import { Table } from 'cmd-table';
4
4
  import { api } from '../services/api-service.js';
5
- import ora from 'ora';
5
+ import ora from '../utils/spinner.js';
6
6
  import enquirer from 'enquirer';
7
7
  import { handleCommandError } from '../utils/error-handler.js';
8
8
  import { ConfigService } from '../services/config-service.js';
@@ -30,14 +30,17 @@ Examples:
30
30
  }
31
31
 
32
32
  const table = new Table({
33
- head: [chalk.bold('Name'), chalk.bold('JQL')]
33
+ columns: [
34
+ { name: chalk.bold('Name') },
35
+ { name: chalk.bold('JQL') }
36
+ ]
34
37
  });
35
38
 
36
39
  for (const [name, jql] of Object.entries(filters)) {
37
- table.push([chalk.cyan(name), jql as string] as any);
40
+ table.addRow([chalk.cyan(name), jql as string] as any);
38
41
  }
39
42
 
40
- console.log(table.toString());
43
+ console.log(table.render());
41
44
  });
42
45
 
43
46
  filterCmd
@@ -2,7 +2,7 @@ import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
3
  import { execSync } from 'child_process';
4
4
  import { api } from '../services/api-service.js';
5
- import ora from 'ora';
5
+ import ora from '../utils/spinner.js';
6
6
  import enquirer from 'enquirer';
7
7
  import { validateIssueKey } from '../utils/validators.js';
8
8
  import { handleCommandError } from '../utils/error-handler.js';
@@ -1,7 +1,7 @@
1
1
  import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
3
  import { api } from '../services/api-service.js';
4
- import ora from 'ora';
4
+ import ora from '../utils/spinner.js';
5
5
  import fs from 'fs';
6
6
  import path from 'path';
7
7
  import { validateIssueKey } from '../utils/validators.js';
@@ -2,7 +2,7 @@ import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
3
  import enquirer from 'enquirer';
4
4
  import { api } from '../services/api-service.js';
5
- import ora from 'ora';
5
+ import ora from '../utils/spinner.js';
6
6
  import { exec } from 'child_process';
7
7
  import { promisify } from 'util';
8
8
  import { validateIssueKey } from '../utils/validators.js';
@@ -1,8 +1,8 @@
1
1
  import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
- import Table from 'cli-table3';
3
+ import { Table } from 'cmd-table';
4
4
  import { api } from '../services/api-service.js';
5
- import ora from 'ora';
5
+ import ora from '../utils/spinner.js';
6
6
  import enquirer from 'enquirer';
7
7
  import { textToADF } from '../utils/text-to-adf.js';
8
8
  import { validateIssueKey } from '../utils/validators.js';
@@ -67,11 +67,16 @@ Examples:
67
67
  console.log(chalk.bold(`\nWorklogs for ${chalk.cyan(issueKey)}:`));
68
68
 
69
69
  const table = new Table({
70
- head: [chalk.bold('Author'), chalk.bold('Time Spent'), chalk.bold('Date'), chalk.bold('Comment')]
70
+ columns: [
71
+ { name: chalk.bold('Author') },
72
+ { name: chalk.bold('Time Spent') },
73
+ { name: chalk.bold('Date') },
74
+ { name: chalk.bold('Comment') }
75
+ ]
71
76
  });
72
77
 
73
78
  data.worklogs.forEach((w: any) => {
74
- table.push([
79
+ table.addRow([
75
80
  w.author?.displayName || 'Unknown',
76
81
  w.timeSpent,
77
82
  w.started.split('T')[0],
@@ -79,7 +84,7 @@ Examples:
79
84
  ]);
80
85
  });
81
86
 
82
- console.log(table.toString());
87
+ console.log(table.render());
83
88
 
84
89
  } catch (e: any) {
85
90
  handleCommandError(spinner, e, 'Failed to list worklogs');