specweave 0.26.14 → 0.27.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 (189) hide show
  1. package/CLAUDE.md +73 -1
  2. package/README.md +111 -466
  3. package/dist/plugins/specweave-jira/lib/setup-wizard.d.ts.map +1 -1
  4. package/dist/plugins/specweave-jira/lib/setup-wizard.js +57 -78
  5. package/dist/plugins/specweave-jira/lib/setup-wizard.js.map +1 -1
  6. package/dist/src/cli/commands/import-docs.d.ts.map +1 -1
  7. package/dist/src/cli/commands/import-docs.js +23 -31
  8. package/dist/src/cli/commands/import-docs.js.map +1 -1
  9. package/dist/src/cli/commands/import-external.d.ts.map +1 -1
  10. package/dist/src/cli/commands/import-external.js +6 -10
  11. package/dist/src/cli/commands/import-external.js.map +1 -1
  12. package/dist/src/cli/commands/init-multiproject.d.ts.map +1 -1
  13. package/dist/src/cli/commands/init-multiproject.js +58 -73
  14. package/dist/src/cli/commands/init-multiproject.js.map +1 -1
  15. package/dist/src/cli/commands/init.d.ts +17 -11
  16. package/dist/src/cli/commands/init.d.ts.map +1 -1
  17. package/dist/src/cli/commands/init.js +221 -1874
  18. package/dist/src/cli/commands/init.js.map +1 -1
  19. package/dist/src/cli/commands/install.d.ts.map +1 -1
  20. package/dist/src/cli/commands/install.js +14 -22
  21. package/dist/src/cli/commands/install.js.map +1 -1
  22. package/dist/src/cli/commands/migrate-config.d.ts.map +1 -1
  23. package/dist/src/cli/commands/migrate-config.js +6 -10
  24. package/dist/src/cli/commands/migrate-config.js.map +1 -1
  25. package/dist/src/cli/commands/switch-project.d.ts.map +1 -1
  26. package/dist/src/cli/commands/switch-project.js.map +1 -1
  27. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -1
  28. package/dist/src/cli/helpers/ado-area-path-mapper.js +36 -49
  29. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -1
  30. package/dist/src/cli/helpers/github/increment-profile-selector.d.ts.map +1 -1
  31. package/dist/src/cli/helpers/github/increment-profile-selector.js.map +1 -1
  32. package/dist/src/cli/helpers/github/profile-manager.d.ts.map +1 -1
  33. package/dist/src/cli/helpers/github/profile-manager.js +8 -11
  34. package/dist/src/cli/helpers/github/profile-manager.js.map +1 -1
  35. package/dist/src/cli/helpers/github-repo-selector.d.ts.map +1 -1
  36. package/dist/src/cli/helpers/github-repo-selector.js +26 -50
  37. package/dist/src/cli/helpers/github-repo-selector.js.map +1 -1
  38. package/dist/src/cli/helpers/import-strategy-prompter.d.ts.map +1 -1
  39. package/dist/src/cli/helpers/import-strategy-prompter.js +39 -52
  40. package/dist/src/cli/helpers/import-strategy-prompter.js.map +1 -1
  41. package/dist/src/cli/helpers/init/config-detection.d.ts +40 -0
  42. package/dist/src/cli/helpers/init/config-detection.d.ts.map +1 -0
  43. package/dist/src/cli/helpers/init/config-detection.js +125 -0
  44. package/dist/src/cli/helpers/init/config-detection.js.map +1 -0
  45. package/dist/src/cli/helpers/init/directory-structure.d.ts +26 -0
  46. package/dist/src/cli/helpers/init/directory-structure.d.ts.map +1 -0
  47. package/dist/src/cli/helpers/init/directory-structure.js +190 -0
  48. package/dist/src/cli/helpers/init/directory-structure.js.map +1 -0
  49. package/dist/src/cli/helpers/init/external-import.d.ts +15 -0
  50. package/dist/src/cli/helpers/init/external-import.d.ts.map +1 -0
  51. package/dist/src/cli/helpers/init/external-import.js +251 -0
  52. package/dist/src/cli/helpers/init/external-import.js.map +1 -0
  53. package/dist/src/cli/helpers/init/index.d.ts +15 -0
  54. package/dist/src/cli/helpers/init/index.d.ts.map +1 -0
  55. package/dist/src/cli/helpers/init/index.js +26 -0
  56. package/dist/src/cli/helpers/init/index.js.map +1 -0
  57. package/dist/src/cli/helpers/init/next-steps.d.ts +15 -0
  58. package/dist/src/cli/helpers/init/next-steps.d.ts.map +1 -0
  59. package/dist/src/cli/helpers/init/next-steps.js +72 -0
  60. package/dist/src/cli/helpers/init/next-steps.js.map +1 -0
  61. package/dist/src/cli/helpers/init/path-utils.d.ts +41 -0
  62. package/dist/src/cli/helpers/init/path-utils.d.ts.map +1 -0
  63. package/dist/src/cli/helpers/init/path-utils.js +146 -0
  64. package/dist/src/cli/helpers/init/path-utils.js.map +1 -0
  65. package/dist/src/cli/helpers/init/plugin-installer.d.ts +28 -0
  66. package/dist/src/cli/helpers/init/plugin-installer.d.ts.map +1 -0
  67. package/dist/src/cli/helpers/init/plugin-installer.js +238 -0
  68. package/dist/src/cli/helpers/init/plugin-installer.js.map +1 -0
  69. package/dist/src/cli/helpers/init/repository-setup.d.ts +28 -0
  70. package/dist/src/cli/helpers/init/repository-setup.d.ts.map +1 -0
  71. package/dist/src/cli/helpers/init/repository-setup.js +78 -0
  72. package/dist/src/cli/helpers/init/repository-setup.js.map +1 -0
  73. package/dist/src/cli/helpers/init/smart-reinit.d.ts +30 -0
  74. package/dist/src/cli/helpers/init/smart-reinit.d.ts.map +1 -0
  75. package/dist/src/cli/helpers/init/smart-reinit.js +140 -0
  76. package/dist/src/cli/helpers/init/smart-reinit.js.map +1 -0
  77. package/dist/src/cli/helpers/init/testing-config.d.ts +27 -0
  78. package/dist/src/cli/helpers/init/testing-config.d.ts.map +1 -0
  79. package/dist/src/cli/helpers/init/testing-config.js +131 -0
  80. package/dist/src/cli/helpers/init/testing-config.js.map +1 -0
  81. package/dist/src/cli/helpers/init/types.d.ts +86 -0
  82. package/dist/src/cli/helpers/init/types.d.ts.map +1 -0
  83. package/dist/src/cli/helpers/init/types.js +5 -0
  84. package/dist/src/cli/helpers/init/types.js.map +1 -0
  85. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -1
  86. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +10 -12
  87. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -1
  88. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  89. package/dist/src/cli/helpers/issue-tracker/ado.js +43 -60
  90. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  91. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.d.ts.map +1 -1
  92. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js +193 -230
  93. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js.map +1 -1
  94. package/dist/src/cli/helpers/issue-tracker/github.d.ts.map +1 -1
  95. package/dist/src/cli/helpers/issue-tracker/github.js +43 -54
  96. package/dist/src/cli/helpers/issue-tracker/github.js.map +1 -1
  97. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  98. package/dist/src/cli/helpers/issue-tracker/index.js +27 -40
  99. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  100. package/dist/src/cli/helpers/issue-tracker/jira.d.ts.map +1 -1
  101. package/dist/src/cli/helpers/issue-tracker/jira.js +54 -70
  102. package/dist/src/cli/helpers/issue-tracker/jira.js.map +1 -1
  103. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -1
  104. package/dist/src/cli/helpers/smart-filter.js +62 -85
  105. package/dist/src/cli/helpers/smart-filter.js.map +1 -1
  106. package/dist/src/core/increment/auto-transition-manager.d.ts +12 -0
  107. package/dist/src/core/increment/auto-transition-manager.d.ts.map +1 -1
  108. package/dist/src/core/increment/auto-transition-manager.js +45 -0
  109. package/dist/src/core/increment/auto-transition-manager.js.map +1 -1
  110. package/dist/src/core/increment/metadata-manager.d.ts.map +1 -1
  111. package/dist/src/core/increment/metadata-manager.js +46 -0
  112. package/dist/src/core/increment/metadata-manager.js.map +1 -1
  113. package/dist/src/core/increment/status-change-sync-trigger.d.ts +12 -0
  114. package/dist/src/core/increment/status-change-sync-trigger.d.ts.map +1 -1
  115. package/dist/src/core/increment/status-change-sync-trigger.js +48 -2
  116. package/dist/src/core/increment/status-change-sync-trigger.js.map +1 -1
  117. package/dist/src/core/living-docs/living-docs-sync.d.ts +13 -0
  118. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  119. package/dist/src/core/living-docs/living-docs-sync.js +40 -0
  120. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  121. package/dist/src/core/repo-structure/repo-bulk-discovery.d.ts.map +1 -1
  122. package/dist/src/core/repo-structure/repo-bulk-discovery.js +63 -83
  123. package/dist/src/core/repo-structure/repo-bulk-discovery.js.map +1 -1
  124. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  125. package/dist/src/core/repo-structure/repo-structure-manager.js +339 -424
  126. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  127. package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
  128. package/dist/src/core/sync/bidirectional-engine.js +21 -29
  129. package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
  130. package/dist/src/init/InitFlow.js +15 -19
  131. package/dist/src/init/InitFlow.js.map +1 -1
  132. package/dist/src/init/repo/types.d.ts +1 -1
  133. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -1
  134. package/dist/src/integrations/ado/area-path-mapper.js +19 -23
  135. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -1
  136. package/dist/src/utils/external-resource-validator.d.ts.map +1 -1
  137. package/dist/src/utils/external-resource-validator.js +41 -65
  138. package/dist/src/utils/external-resource-validator.js.map +1 -1
  139. package/dist/src/utils/project-detection.d.ts.map +1 -1
  140. package/dist/src/utils/project-detection.js +19 -21
  141. package/dist/src/utils/project-detection.js.map +1 -1
  142. package/dist/src/utils/project-validator.d.ts.map +1 -1
  143. package/dist/src/utils/project-validator.js +5 -7
  144. package/dist/src/utils/project-validator.js.map +1 -1
  145. package/package.json +2 -3
  146. package/plugins/specweave/agents/tech-lead/AGENT.md +9 -0
  147. package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
  148. package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
  149. package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
  150. package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
  151. package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
  152. package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
  153. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
  154. package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
  155. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
  156. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
  157. package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
  158. package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
  159. package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
  160. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
  161. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +12 -0
  162. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +45 -0
  163. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -1
  164. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +46 -0
  165. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
  166. package/plugins/specweave/skills/increment-planner/SKILL.md +10 -5
  167. package/plugins/specweave/skills/specweave-framework/SKILL.md +6 -4
  168. package/plugins/specweave/templates/coding-standards.md.template +36 -0
  169. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
  170. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
  171. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +1 -0
  172. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
  173. package/plugins/specweave-ado/lib/project-selector.js +56 -67
  174. package/plugins/specweave-ado/lib/project-selector.ts +72 -85
  175. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +1104 -0
  176. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
  177. package/plugins/specweave-github/lib/repo-selector.js +55 -66
  178. package/plugins/specweave-github/lib/repo-selector.ts +73 -84
  179. package/plugins/specweave-jira/commands/import-projects.js +3 -5
  180. package/plugins/specweave-jira/commands/import-projects.ts +3 -5
  181. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
  182. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
  183. package/plugins/specweave-jira/lib/project-selector.js +60 -71
  184. package/plugins/specweave-jira/lib/project-selector.ts +78 -91
  185. package/plugins/specweave-jira/lib/setup-wizard.js +51 -72
  186. package/plugins/specweave-jira/lib/setup-wizard.ts +56 -74
  187. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1017 -0
  188. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
  189. package/src/templates/CLAUDE.md.template +14 -0
@@ -1,4 +1,4 @@
1
- import inquirer from "inquirer";
1
+ import { confirm, select, input, password } from "@inquirer/prompts";
2
2
  import { credentialsManager } from "../../../src/core/credentials-manager.js";
3
3
  import { JiraCredentials as JiraCredentials2 } from "../../../src/core/credentials-manager.js";
4
4
  async function detectJiraCredentials() {
@@ -21,14 +21,10 @@ async function setupJiraCredentials() {
21
21
  console.log("\n\u{1F527} Jira Setup Wizard\n");
22
22
  const detected = await detectJiraCredentials();
23
23
  if (detected.found) {
24
- const { useExisting } = await inquirer.prompt([
25
- {
26
- type: "confirm",
27
- name: "useExisting",
28
- message: `Found credentials in ${detected.source}. Use these credentials?`,
29
- default: true
30
- }
31
- ]);
24
+ const useExisting = await confirm({
25
+ message: `Found credentials in ${detected.source}. Use these credentials?`,
26
+ default: true
27
+ });
32
28
  if (useExisting) {
33
29
  return detected.credentials;
34
30
  }
@@ -37,56 +33,47 @@ async function setupJiraCredentials() {
37
33
  console.log("\u26A0\uFE0F No Jira credentials found\n");
38
34
  console.log("\u{1F4DD} Let's set up your Jira connection:\n");
39
35
  }
40
- const answers = await inquirer.prompt([
41
- {
42
- type: "select",
43
- name: "setupType",
44
- message: "How would you like to connect to Jira?",
45
- choices: [
46
- {
47
- name: "Cloud (*.atlassian.net)",
48
- value: "cloud"
49
- },
50
- {
51
- name: "Server/Data Center (self-hosted)",
52
- value: "server"
53
- }
54
- ]
55
- },
56
- {
57
- type: "input",
58
- name: "domain",
59
- message: (answers2) => answers2.setupType === "cloud" ? "Jira domain (e.g., mycompany.atlassian.net):" : "Jira server URL (e.g., jira.mycompany.com):",
60
- validate: (value) => {
61
- if (!value) return "Domain is required";
62
- if (answers.setupType === "cloud" && !value.includes(".atlassian.net")) {
63
- return "Cloud domain must end with .atlassian.net";
64
- }
65
- return true;
66
- }
67
- },
68
- {
69
- type: "input",
70
- name: "email",
71
- message: "Email address:",
72
- validate: (value) => {
73
- if (!value) return "Email is required";
74
- if (!value.includes("@")) return "Must be a valid email";
75
- return true;
36
+ const setupType = await select({
37
+ message: "How would you like to connect to Jira?",
38
+ choices: [
39
+ {
40
+ name: "Cloud (*.atlassian.net)",
41
+ value: "cloud"
42
+ },
43
+ {
44
+ name: "Server/Data Center (self-hosted)",
45
+ value: "server"
76
46
  }
77
- },
78
- {
79
- type: "password",
80
- name: "apiToken",
81
- message: "API token:",
82
- mask: "*",
83
- validate: (value) => {
84
- if (!value) return "API token is required";
85
- if (value.length < 10) return "API token seems too short";
86
- return true;
47
+ ]
48
+ });
49
+ const domain = await input({
50
+ message: setupType === "cloud" ? "Jira domain (e.g., mycompany.atlassian.net):" : "Jira server URL (e.g., jira.mycompany.com):",
51
+ validate: (value) => {
52
+ if (!value) return "Domain is required";
53
+ if (setupType === "cloud" && !value.includes(".atlassian.net")) {
54
+ return "Cloud domain must end with .atlassian.net";
87
55
  }
56
+ return true;
57
+ }
58
+ });
59
+ const email = await input({
60
+ message: "Email address:",
61
+ validate: (value) => {
62
+ if (!value) return "Email is required";
63
+ if (!value.includes("@")) return "Must be a valid email";
64
+ return true;
88
65
  }
89
- ]);
66
+ });
67
+ const apiToken = await password({
68
+ message: "API token:",
69
+ mask: "*",
70
+ validate: (value) => {
71
+ if (!value) return "API token is required";
72
+ if (value.length < 10) return "API token seems too short";
73
+ return true;
74
+ }
75
+ });
76
+ const answers = { setupType, domain, email, apiToken };
90
77
  const credentials = {
91
78
  domain: answers.domain,
92
79
  email: answers.email,
@@ -97,14 +84,10 @@ async function setupJiraCredentials() {
97
84
  if (!isValid) {
98
85
  console.log("\u274C Failed to connect to Jira");
99
86
  console.log("\u{1F4A1} Please check your credentials and try again\n");
100
- const { retry } = await inquirer.prompt([
101
- {
102
- type: "confirm",
103
- name: "retry",
104
- message: "Would you like to try again?",
105
- default: true
106
- }
107
- ]);
87
+ const retry = await confirm({
88
+ message: "Would you like to try again?",
89
+ default: true
90
+ });
108
91
  if (retry) {
109
92
  return setupJiraCredentials();
110
93
  }
@@ -146,14 +129,10 @@ async function testJiraConnection(credentials) {
146
129
  }
147
130
  async function saveCredentialsToEnv(credentials) {
148
131
  console.log("\u{1F4A1} Save credentials to .env for future use\n");
149
- const { saveToEnv } = await inquirer.prompt([
150
- {
151
- type: "confirm",
152
- name: "saveToEnv",
153
- message: "Save credentials to .env file?",
154
- default: true
155
- }
156
- ]);
132
+ const saveToEnv = await confirm({
133
+ message: "Save credentials to .env file?",
134
+ default: true
135
+ });
157
136
  if (saveToEnv) {
158
137
  credentialsManager.saveToEnvFile({ jira: credentials });
159
138
  console.log("\u2705 Credentials saved to .env");
@@ -7,7 +7,7 @@
7
7
  * 3. Never ask twice for same credentials
8
8
  */
9
9
 
10
- import inquirer from 'inquirer';
10
+ import { confirm, select, input, password } from '@inquirer/prompts';
11
11
  import { credentialsManager, JiraCredentials } from '../../../src/core/credentials-manager.js';
12
12
 
13
13
  // ============================================================================
@@ -64,14 +64,10 @@ export async function setupJiraCredentials(): Promise<JiraCredentials> {
64
64
 
65
65
  if (detected.found) {
66
66
  // Ask user if they want to use existing or re-enter
67
- const { useExisting } = await inquirer.prompt([
68
- {
69
- type: 'confirm',
70
- name: 'useExisting',
71
- message: `Found credentials in ${detected.source}. Use these credentials?`,
72
- default: true,
73
- },
74
- ]);
67
+ const useExisting = await confirm({
68
+ message: `Found credentials in ${detected.source}. Use these credentials?`,
69
+ default: true,
70
+ });
75
71
 
76
72
  if (useExisting) {
77
73
  return detected.credentials!;
@@ -84,59 +80,53 @@ export async function setupJiraCredentials(): Promise<JiraCredentials> {
84
80
  }
85
81
 
86
82
  // Interactive credential entry
87
- const answers = await inquirer.prompt([
88
- {
89
- type: 'select',
90
- name: 'setupType',
91
- message: 'How would you like to connect to Jira?',
92
- choices: [
93
- {
94
- name: 'Cloud (*.atlassian.net)',
95
- value: 'cloud',
96
- },
97
- {
98
- name: 'Server/Data Center (self-hosted)',
99
- value: 'server',
100
- },
101
- ],
102
- },
103
- {
104
- type: 'input',
105
- name: 'domain',
106
- message: (answers: any) =>
107
- answers.setupType === 'cloud'
108
- ? 'Jira domain (e.g., mycompany.atlassian.net):'
109
- : 'Jira server URL (e.g., jira.mycompany.com):',
110
- validate: (value: string) => {
111
- if (!value) return 'Domain is required';
112
- if (answers.setupType === 'cloud' && !value.includes('.atlassian.net')) {
113
- return 'Cloud domain must end with .atlassian.net';
114
- }
115
- return true;
83
+ const setupType = await select({
84
+ message: 'How would you like to connect to Jira?',
85
+ choices: [
86
+ {
87
+ name: 'Cloud (*.atlassian.net)',
88
+ value: 'cloud',
116
89
  },
117
- },
118
- {
119
- type: 'input',
120
- name: 'email',
121
- message: 'Email address:',
122
- validate: (value: string) => {
123
- if (!value) return 'Email is required';
124
- if (!value.includes('@')) return 'Must be a valid email';
125
- return true;
90
+ {
91
+ name: 'Server/Data Center (self-hosted)',
92
+ value: 'server',
126
93
  },
94
+ ],
95
+ });
96
+
97
+ const domain = await input({
98
+ message: setupType === 'cloud'
99
+ ? 'Jira domain (e.g., mycompany.atlassian.net):'
100
+ : 'Jira server URL (e.g., jira.mycompany.com):',
101
+ validate: (value: string) => {
102
+ if (!value) return 'Domain is required';
103
+ if (setupType === 'cloud' && !value.includes('.atlassian.net')) {
104
+ return 'Cloud domain must end with .atlassian.net';
105
+ }
106
+ return true;
127
107
  },
128
- {
129
- type: 'password',
130
- name: 'apiToken',
131
- message: 'API token:',
132
- mask: '*',
133
- validate: (value: string) => {
134
- if (!value) return 'API token is required';
135
- if (value.length < 10) return 'API token seems too short';
136
- return true;
137
- },
108
+ });
109
+
110
+ const email = await input({
111
+ message: 'Email address:',
112
+ validate: (value: string) => {
113
+ if (!value) return 'Email is required';
114
+ if (!value.includes('@')) return 'Must be a valid email';
115
+ return true;
138
116
  },
139
- ]);
117
+ });
118
+
119
+ const apiToken = await password({
120
+ message: 'API token:',
121
+ mask: '*',
122
+ validate: (value: string) => {
123
+ if (!value) return 'API token is required';
124
+ if (value.length < 10) return 'API token seems too short';
125
+ return true;
126
+ },
127
+ });
128
+
129
+ const answers = { setupType, domain, email, apiToken };
140
130
 
141
131
  const credentials: JiraCredentials = {
142
132
  domain: answers.domain,
@@ -152,14 +142,10 @@ export async function setupJiraCredentials(): Promise<JiraCredentials> {
152
142
  console.log('❌ Failed to connect to Jira');
153
143
  console.log('💡 Please check your credentials and try again\n');
154
144
 
155
- const { retry } = await inquirer.prompt([
156
- {
157
- type: 'confirm',
158
- name: 'retry',
159
- message: 'Would you like to try again?',
160
- default: true,
161
- },
162
- ]);
145
+ const retry = await confirm({
146
+ message: 'Would you like to try again?',
147
+ default: true,
148
+ });
163
149
 
164
150
  if (retry) {
165
151
  return setupJiraCredentials();
@@ -219,14 +205,10 @@ async function testJiraConnection(credentials: JiraCredentials): Promise<boolean
219
205
  async function saveCredentialsToEnv(credentials: JiraCredentials): Promise<void> {
220
206
  console.log('💡 Save credentials to .env for future use\n');
221
207
 
222
- const { saveToEnv } = await inquirer.prompt([
223
- {
224
- type: 'confirm',
225
- name: 'saveToEnv',
226
- message: 'Save credentials to .env file?',
227
- default: true,
228
- },
229
- ]);
208
+ const saveToEnv = await confirm({
209
+ message: 'Save credentials to .env file?',
210
+ default: true,
211
+ });
230
212
 
231
213
  if (saveToEnv) {
232
214
  credentialsManager.saveToEnvFile({ jira: credentials });