specweave 0.26.14 → 0.28.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 (167) hide show
  1. package/CLAUDE.md +73 -1
  2. package/README.md +245 -446
  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 +5 -1
  122. package/dist/src/core/repo-structure/repo-bulk-discovery.d.ts.map +1 -1
  123. package/dist/src/core/repo-structure/repo-bulk-discovery.js +68 -86
  124. package/dist/src/core/repo-structure/repo-bulk-discovery.js.map +1 -1
  125. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  126. package/dist/src/core/repo-structure/repo-structure-manager.js +345 -425
  127. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  128. package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
  129. package/dist/src/core/sync/bidirectional-engine.js +21 -29
  130. package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
  131. package/dist/src/init/InitFlow.js +15 -19
  132. package/dist/src/init/InitFlow.js.map +1 -1
  133. package/dist/src/init/repo/types.d.ts +1 -1
  134. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -1
  135. package/dist/src/integrations/ado/area-path-mapper.js +19 -23
  136. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -1
  137. package/dist/src/utils/external-resource-validator.d.ts.map +1 -1
  138. package/dist/src/utils/external-resource-validator.js +41 -65
  139. package/dist/src/utils/external-resource-validator.js.map +1 -1
  140. package/dist/src/utils/project-detection.d.ts.map +1 -1
  141. package/dist/src/utils/project-detection.js +19 -21
  142. package/dist/src/utils/project-detection.js.map +1 -1
  143. package/dist/src/utils/project-validator.d.ts.map +1 -1
  144. package/dist/src/utils/project-validator.js +5 -7
  145. package/dist/src/utils/project-validator.js.map +1 -1
  146. package/package.json +2 -3
  147. package/plugins/specweave/agents/tech-lead/AGENT.md +9 -0
  148. package/plugins/specweave/hooks/post-edit-write-consolidated.sh +87 -0
  149. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +12 -0
  150. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +45 -0
  151. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -1
  152. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +46 -0
  153. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
  154. package/plugins/specweave/skills/increment-planner/SKILL.md +10 -5
  155. package/plugins/specweave/skills/specweave-framework/SKILL.md +6 -4
  156. package/plugins/specweave/templates/coding-standards.md.template +36 -0
  157. package/plugins/specweave-ado/lib/project-selector.js +56 -67
  158. package/plugins/specweave-ado/lib/project-selector.ts +72 -85
  159. package/plugins/specweave-github/lib/repo-selector.js +55 -66
  160. package/plugins/specweave-github/lib/repo-selector.ts +73 -84
  161. package/plugins/specweave-jira/commands/import-projects.js +3 -5
  162. package/plugins/specweave-jira/commands/import-projects.ts +3 -5
  163. package/plugins/specweave-jira/lib/project-selector.js +60 -71
  164. package/plugins/specweave-jira/lib/project-selector.ts +78 -91
  165. package/plugins/specweave-jira/lib/setup-wizard.js +51 -72
  166. package/plugins/specweave-jira/lib/setup-wizard.ts +56 -74
  167. package/src/templates/CLAUDE.md.template +14 -0
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Path utilities for init command
3
+ * Handles finding package root and source directories
4
+ */
5
+ import type { ParentSpecweaveFolder } from './types.js';
6
+ /**
7
+ * Find the package root by walking up the directory tree looking for package.json
8
+ * This works reliably on all platforms including Windows with UNC paths
9
+ *
10
+ * @param startDir - Directory to start searching from
11
+ * @returns Path to package root or null if not found
12
+ */
13
+ export declare function findPackageRoot(startDir: string): string | null;
14
+ /**
15
+ * Find the source directory, trying multiple possible locations
16
+ * Handles both development and installed package scenarios
17
+ * Windows-compatible with proper path normalization
18
+ *
19
+ * @param relativePath - Relative path to find (e.g., 'templates', 'plugins/specweave')
20
+ * @param dirname - Current __dirname value
21
+ * @returns Absolute path to the source directory
22
+ */
23
+ export declare function findSourceDir(relativePath: string, dirname: string): string;
24
+ /**
25
+ * Detect ALL parent directories that contain .specweave/ folders
26
+ * SpecWeave ONLY supports root-level .specweave/ folders
27
+ * Nested .specweave/ folders are NOT supported
28
+ *
29
+ * @param targetDir - Directory where user wants to initialize
30
+ * @returns Array of paths to parent .specweave/ folders with depth info, or null if none found
31
+ */
32
+ export declare function detectNestedSpecweave(targetDir: string): ParentSpecweaveFolder[] | null;
33
+ /**
34
+ * Count files recursively in a directory
35
+ * Used for logging before deletion
36
+ *
37
+ * @param dir - Directory to count files in
38
+ * @returns Total file count
39
+ */
40
+ export declare function countFilesRecursive(dir: string): number;
41
+ //# sourceMappingURL=path-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/path-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyB/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CA6C3E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB,EAAE,GAAG,IAAI,CA2BvF;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgBvD"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Path utilities for init command
3
+ * Handles finding package root and source directories
4
+ */
5
+ import * as fs from '../../../utils/fs-native.js';
6
+ import * as path from 'path';
7
+ import * as os from 'os';
8
+ /**
9
+ * Find the package root by walking up the directory tree looking for package.json
10
+ * This works reliably on all platforms including Windows with UNC paths
11
+ *
12
+ * @param startDir - Directory to start searching from
13
+ * @returns Path to package root or null if not found
14
+ */
15
+ export function findPackageRoot(startDir) {
16
+ let currentDir = startDir;
17
+ const root = path.parse(currentDir).root;
18
+ while (currentDir !== root) {
19
+ const packageJsonPath = path.join(currentDir, 'package.json');
20
+ if (fs.existsSync(packageJsonPath)) {
21
+ try {
22
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
23
+ // Verify this is the specweave package
24
+ if (packageJson.name === 'specweave') {
25
+ return currentDir;
26
+ }
27
+ }
28
+ catch {
29
+ // Not a valid package.json, continue searching
30
+ }
31
+ }
32
+ const parentDir = path.dirname(currentDir);
33
+ if (parentDir === currentDir)
34
+ break; // Reached root
35
+ currentDir = parentDir;
36
+ }
37
+ return null;
38
+ }
39
+ /**
40
+ * Find the source directory, trying multiple possible locations
41
+ * Handles both development and installed package scenarios
42
+ * Windows-compatible with proper path normalization
43
+ *
44
+ * @param relativePath - Relative path to find (e.g., 'templates', 'plugins/specweave')
45
+ * @param dirname - Current __dirname value
46
+ * @returns Absolute path to the source directory
47
+ */
48
+ export function findSourceDir(relativePath, dirname) {
49
+ // First, try to find package root by walking up from dirname
50
+ const packageRoot = findPackageRoot(dirname);
51
+ if (packageRoot) {
52
+ // Try directly in package root FIRST (for plugins/, .claude-plugin/)
53
+ // This is critical because package.json includes these folders for npm publish
54
+ const rootPath = path.normalize(path.join(packageRoot, relativePath));
55
+ if (fs.existsSync(rootPath)) {
56
+ return rootPath;
57
+ }
58
+ // Try src/ directory (for templates/, utils/, etc.)
59
+ const srcPath = path.normalize(path.join(packageRoot, 'src', relativePath));
60
+ if (fs.existsSync(srcPath)) {
61
+ return srcPath;
62
+ }
63
+ // Try dist/ directory (fallback for compiled outputs)
64
+ const distPath = path.normalize(path.join(packageRoot, 'dist', relativePath));
65
+ if (fs.existsSync(distPath)) {
66
+ return distPath;
67
+ }
68
+ }
69
+ // Fallback: Try multiple possible locations relative to dirname
70
+ const possiblePaths = [
71
+ // Development: dist/cli/commands -> src/
72
+ path.normalize(path.join(dirname, '../../..', relativePath)),
73
+ // Installed: node_modules/specweave/dist/cli/commands -> node_modules/specweave/src/
74
+ path.normalize(path.join(dirname, '../../../src', relativePath)),
75
+ // Alternative: go up from dist/ to package root, then to src/
76
+ path.normalize(path.join(dirname, '../../..', 'src', relativePath)),
77
+ // Absolute from package root (for global installs)
78
+ path.resolve(dirname, '../../../src', relativePath),
79
+ ];
80
+ for (const testPath of possiblePaths) {
81
+ if (fs.existsSync(testPath)) {
82
+ return testPath;
83
+ }
84
+ }
85
+ // If nothing found, return the first path and let the caller handle the error
86
+ return possiblePaths[0];
87
+ }
88
+ /**
89
+ * Detect ALL parent directories that contain .specweave/ folders
90
+ * SpecWeave ONLY supports root-level .specweave/ folders
91
+ * Nested .specweave/ folders are NOT supported
92
+ *
93
+ * @param targetDir - Directory where user wants to initialize
94
+ * @returns Array of paths to parent .specweave/ folders with depth info, or null if none found
95
+ */
96
+ export function detectNestedSpecweave(targetDir) {
97
+ const foundFolders = [];
98
+ const homeDir = os.homedir();
99
+ // Start from parent of target directory
100
+ let currentDir = path.dirname(path.resolve(targetDir));
101
+ const root = path.parse(currentDir).root;
102
+ let depth = 1;
103
+ // Walk up the directory tree and find ALL .specweave/ folders
104
+ while (currentDir !== root) {
105
+ const specweavePath = path.join(currentDir, '.specweave');
106
+ // Check if .specweave/ exists at this level
107
+ if (fs.existsSync(specweavePath)) {
108
+ const isHomeDir = path.resolve(currentDir) === path.resolve(homeDir);
109
+ foundFolders.push({ path: currentDir, depth, isHomeDir });
110
+ }
111
+ // Move up one level
112
+ const parentDir = path.dirname(currentDir);
113
+ if (parentDir === currentDir)
114
+ break; // Reached root
115
+ currentDir = parentDir;
116
+ depth++;
117
+ }
118
+ return foundFolders.length > 0 ? foundFolders : null;
119
+ }
120
+ /**
121
+ * Count files recursively in a directory
122
+ * Used for logging before deletion
123
+ *
124
+ * @param dir - Directory to count files in
125
+ * @returns Total file count
126
+ */
127
+ export function countFilesRecursive(dir) {
128
+ let count = 0;
129
+ try {
130
+ const items = fs.readdirSync(dir);
131
+ for (const item of items) {
132
+ const fullPath = path.join(dir, item);
133
+ if (fs.statSync(fullPath).isDirectory()) {
134
+ count += countFilesRecursive(fullPath);
135
+ }
136
+ else {
137
+ count++;
138
+ }
139
+ }
140
+ }
141
+ catch {
142
+ // Ignore errors
143
+ }
144
+ return count;
145
+ }
146
+ //# sourceMappingURL=path-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/path-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAGzB;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;IAEzC,OAAO,UAAU,KAAK,IAAI,EAAE,CAAC;QAC3B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QAE9D,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC1E,uCAAuC;gBACvC,IAAI,WAAW,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;oBACrC,OAAO,UAAU,CAAC;gBACpB,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,+CAA+C;YACjD,CAAC;QACH,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,SAAS,KAAK,UAAU;YAAE,MAAM,CAAC,eAAe;QACpD,UAAU,GAAG,SAAS,CAAC;IACzB,CAAC;I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AAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,SAAS,KAAK,UAAU;YAAE,MAAM,CAAC,eAAe;QACpD,UAAU,GAAG,SAAS,CAAC;QACvB,KAAK,EAAE,CAAC;IACV,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;AACvD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YACtC,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxC,KAAK,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YACzC,CAAC;iBAAM,CAAC;gBACN,KAAK,EAAE,CAAC;YACV,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,gBAAgB;IAClB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Plugin installation for Claude Code
3
+ * Handles marketplace registration and plugin installation
4
+ */
5
+ /**
6
+ * Options for plugin installation
7
+ */
8
+ export interface PluginInstallOptions {
9
+ dirname: string;
10
+ forceRefresh?: boolean;
11
+ }
12
+ /**
13
+ * Result of plugin installation
14
+ */
15
+ export interface PluginInstallResult {
16
+ success: boolean;
17
+ successCount: number;
18
+ failCount: number;
19
+ failedPlugins: string[];
20
+ }
21
+ /**
22
+ * Install all SpecWeave plugins via Claude CLI
23
+ *
24
+ * @param options - Installation options
25
+ * @returns Installation result
26
+ */
27
+ export declare function installAllPlugins(options: PluginInstallOptions): Promise<PluginInstallResult>;
28
+ //# sourceMappingURL=plugin-installer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-installer.d.ts","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/plugin-installer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAsLnG"}
@@ -0,0 +1,238 @@
1
+ /**
2
+ * Plugin installation for Claude Code
3
+ * Handles marketplace registration and plugin installation
4
+ */
5
+ import * as fs from '../../../utils/fs-native.js';
6
+ import * as path from 'path';
7
+ import * as os from 'os';
8
+ import chalk from 'chalk';
9
+ import ora from 'ora';
10
+ import { execFileNoThrowSync } from '../../../utils/execFileNoThrow.js';
11
+ import { detectClaudeCli, getClaudeCliDiagnostic, getClaudeCliSuggestions } from '../../../utils/claude-cli-detector.js';
12
+ import { findSourceDir } from './path-utils.js';
13
+ /**
14
+ * Install all SpecWeave plugins via Claude CLI
15
+ *
16
+ * @param options - Installation options
17
+ * @returns Installation result
18
+ */
19
+ export async function installAllPlugins(options) {
20
+ const { dirname, forceRefresh } = options;
21
+ const spinner = ora();
22
+ // Pre-flight check: Is Claude CLI available?
23
+ const claudeStatus = detectClaudeCli();
24
+ if (!claudeStatus.available) {
25
+ // Claude CLI NOT working - show diagnostics
26
+ const diagnostic = getClaudeCliDiagnostic(claudeStatus);
27
+ const suggestions = getClaudeCliSuggestions(claudeStatus);
28
+ spinner.warn(diagnostic);
29
+ console.log('');
30
+ console.log(chalk.yellow.bold('⚠️ Claude Code CLI Issue Detected'));
31
+ console.log('');
32
+ // Show detailed diagnostic info
33
+ if (claudeStatus.commandExists) {
34
+ console.log(chalk.white('Found command in PATH, but verification failed:'));
35
+ console.log('');
36
+ if (claudeStatus.commandPath) {
37
+ console.log(chalk.gray(` Path: ${claudeStatus.commandPath}`));
38
+ }
39
+ if (claudeStatus.exitCode !== undefined) {
40
+ console.log(chalk.gray(` Exit code: ${claudeStatus.exitCode}`));
41
+ }
42
+ console.log(chalk.gray(` Issue: ${claudeStatus.error}`));
43
+ console.log('');
44
+ if (claudeStatus.error === 'version_check_failed') {
45
+ console.log(chalk.yellow('⚠️ This likely means:'));
46
+ console.log(chalk.gray(' • You have a DIFFERENT tool named "claude" in PATH'));
47
+ console.log(chalk.gray(' • It\'s not the Claude Code CLI from Anthropic'));
48
+ console.log(chalk.gray(' • The command exists but doesn\'t respond to --version'));
49
+ }
50
+ }
51
+ else {
52
+ console.log(chalk.white('Claude CLI not found in PATH'));
53
+ }
54
+ console.log('');
55
+ // Show actionable suggestions
56
+ console.log(chalk.cyan('💡 How to fix:'));
57
+ console.log('');
58
+ suggestions.forEach(suggestion => {
59
+ console.log(chalk.gray(` ${suggestion}`));
60
+ });
61
+ console.log('');
62
+ // Show alternatives if CLI not found
63
+ if (claudeStatus.error === 'command_not_found') {
64
+ console.log(chalk.cyan('Alternative Options:'));
65
+ console.log('');
66
+ console.log(chalk.white('1️⃣ Use Claude Code IDE (no CLI needed):'));
67
+ console.log(chalk.gray(' → Open this project in Claude Code'));
68
+ console.log(chalk.gray(' → Run: /plugin install specweave'));
69
+ console.log(chalk.gray(' → Works immediately, no npm installation!'));
70
+ console.log('');
71
+ console.log(chalk.white('2️⃣ Use Different AI Tool:'));
72
+ console.log(chalk.gray(' → Run: specweave init --adapter cursor'));
73
+ console.log(chalk.gray(' → Works without Claude CLI'));
74
+ console.log(chalk.gray(' → Less automation but no CLI dependency'));
75
+ console.log('');
76
+ }
77
+ return { success: false, successCount: 0, failCount: 0, failedPlugins: [] };
78
+ }
79
+ // Claude CLI available - proceed with installation
80
+ try {
81
+ const marketplaceCachePath = path.join(os.homedir(), '.claude/plugins/marketplaces/specweave/.claude-plugin/marketplace.json');
82
+ // Check if cache is fresh (< 5 min old) and valid
83
+ let needsRefresh = true;
84
+ if (!forceRefresh && fs.existsSync(marketplaceCachePath)) {
85
+ const cacheStats = fs.statSync(marketplaceCachePath);
86
+ const cacheAge = Date.now() - cacheStats.mtimeMs;
87
+ const fiveMinutes = 5 * 60 * 1000;
88
+ if (cacheAge < fiveMinutes) {
89
+ try {
90
+ const cacheData = JSON.parse(fs.readFileSync(marketplaceCachePath, 'utf-8'));
91
+ const hasValidPlugins = cacheData.plugins &&
92
+ cacheData.plugins.length >= 25 &&
93
+ cacheData.plugins.every((p) => p.name && p.version && p.description);
94
+ if (hasValidPlugins) {
95
+ needsRefresh = false;
96
+ console.log(chalk.green(' ⚡ Using cached marketplace (fresh)'));
97
+ }
98
+ }
99
+ catch {
100
+ // Cache invalid, needs refresh
101
+ }
102
+ }
103
+ }
104
+ if (needsRefresh) {
105
+ await refreshMarketplace(spinner);
106
+ }
107
+ // Load marketplace.json to get ALL available plugins
108
+ spinner.start('Loading available plugins...');
109
+ const marketplaceJsonPath = findSourceDir('.claude-plugin/marketplace.json', dirname);
110
+ if (!fs.existsSync(marketplaceJsonPath)) {
111
+ throw new Error('marketplace.json not found - cannot determine plugins to install');
112
+ }
113
+ const marketplace = JSON.parse(fs.readFileSync(marketplaceJsonPath, 'utf-8'));
114
+ const allPlugins = marketplace.plugins || [];
115
+ if (allPlugins.length === 0) {
116
+ throw new Error('No plugins found in marketplace.json');
117
+ }
118
+ console.log(chalk.blue(` 📦 Found ${allPlugins.length} plugins to install`));
119
+ spinner.succeed(`Found ${allPlugins.length} plugins`);
120
+ // Install ALL plugins with retry logic
121
+ const result = await installPluginsWithRetry(allPlugins, spinner);
122
+ // Report results
123
+ console.log('');
124
+ console.log(chalk.green.bold('✅ Plugin Installation Complete'));
125
+ console.log(chalk.white(` Installed: ${result.successCount}/${allPlugins.length} plugins`));
126
+ if (result.failCount > 0) {
127
+ console.log(chalk.yellow(` Failed: ${result.failCount} plugins`));
128
+ console.log(chalk.gray(` Failed plugins: ${result.failedPlugins.join(', ')}`));
129
+ console.log(chalk.gray(' → You can install these manually later'));
130
+ }
131
+ console.log('');
132
+ console.log(chalk.cyan('📋 Available capabilities:'));
133
+ console.log(chalk.gray(' • /specweave:increment - Plan new features'));
134
+ console.log(chalk.gray(' • /specweave:do - Execute tasks'));
135
+ console.log(chalk.gray(' • /specweave-github:sync - GitHub integration'));
136
+ console.log(chalk.gray(' • /specweave-jira:sync - JIRA integration'));
137
+ console.log(chalk.gray(' • /specweave:docs preview - Documentation preview'));
138
+ console.log(chalk.gray(' • ...and more!'));
139
+ return {
140
+ success: result.successCount > 0,
141
+ successCount: result.successCount,
142
+ failCount: result.failCount,
143
+ failedPlugins: result.failedPlugins
144
+ };
145
+ }
146
+ catch (error) {
147
+ // Installation failed - provide helpful diagnostics
148
+ spinner.warn('Could not auto-install plugins');
149
+ console.log('');
150
+ const errorMessage = error instanceof Error ? error.message : String(error);
151
+ if (errorMessage.includes('not found') || errorMessage.includes('ENOENT')) {
152
+ console.log(chalk.yellow(' Reason: Claude CLI found but command failed'));
153
+ console.log(chalk.gray(' → Try manually: /plugin install specweave'));
154
+ }
155
+ else if (errorMessage.includes('EACCES') || errorMessage.includes('permission')) {
156
+ console.log(chalk.yellow(' Reason: Permission denied'));
157
+ console.log(chalk.gray(' → Check file permissions or run with appropriate access'));
158
+ }
159
+ else if (errorMessage.includes('ECONNREFUSED') || errorMessage.includes('network')) {
160
+ console.log(chalk.yellow(' Reason: Network error'));
161
+ console.log(chalk.gray(' → Check internet connection and try again'));
162
+ }
163
+ else if (process.env.DEBUG) {
164
+ console.log(chalk.gray(` Error: ${errorMessage}`));
165
+ }
166
+ console.log('');
167
+ console.log(chalk.cyan('📦 Manual installation:'));
168
+ console.log(chalk.white(' /plugin install specweave'));
169
+ console.log(chalk.white(' /plugin install specweave-github'));
170
+ console.log(chalk.white(' ...etc.'));
171
+ console.log('');
172
+ return { success: false, successCount: 0, failCount: 0, failedPlugins: [] };
173
+ }
174
+ }
175
+ /**
176
+ * Refresh the SpecWeave marketplace
177
+ */
178
+ async function refreshMarketplace(spinner) {
179
+ spinner.start('Refreshing SpecWeave marketplace...');
180
+ const listResult = execFileNoThrowSync('claude', ['plugin', 'marketplace', 'list']);
181
+ const marketplaceExists = listResult.success &&
182
+ (listResult.stdout || '').toLowerCase().includes('specweave');
183
+ if (marketplaceExists) {
184
+ execFileNoThrowSync('claude', ['plugin', 'marketplace', 'remove', 'specweave']);
185
+ console.log(chalk.blue(' 🔄 Removed existing marketplace for update'));
186
+ }
187
+ // Add marketplace from GitHub
188
+ const addResult = execFileNoThrowSync('claude', [
189
+ 'plugin',
190
+ 'marketplace',
191
+ 'add',
192
+ 'anton-abyzov/specweave'
193
+ ]);
194
+ if (!addResult.success) {
195
+ throw new Error('Failed to add marketplace from GitHub');
196
+ }
197
+ console.log(chalk.green(' ✔ Marketplace registered from GitHub'));
198
+ spinner.succeed('SpecWeave marketplace ready');
199
+ }
200
+ /**
201
+ * Install plugins with retry logic
202
+ */
203
+ async function installPluginsWithRetry(plugins, spinner) {
204
+ let successCount = 0;
205
+ let failCount = 0;
206
+ const failedPlugins = [];
207
+ for (const plugin of plugins) {
208
+ const pluginName = plugin.name;
209
+ spinner.start(`Installing ${pluginName}...`);
210
+ // Retry up to 3 times with exponential backoff
211
+ let installed = false;
212
+ for (let attempt = 1; attempt <= 3; attempt++) {
213
+ const installResult = execFileNoThrowSync('claude', ['plugin', 'install', pluginName]);
214
+ if (installResult.success) {
215
+ installed = true;
216
+ break;
217
+ }
218
+ // If "not found" error and not last attempt, wait and retry
219
+ if (installResult.stderr?.includes('not found') && attempt < 3) {
220
+ spinner.text = `Installing ${pluginName}... (retry ${attempt}/3)`;
221
+ await new Promise(resolve => setTimeout(resolve, 500 * attempt));
222
+ continue;
223
+ }
224
+ break;
225
+ }
226
+ if (installed) {
227
+ successCount++;
228
+ spinner.succeed(`${pluginName} installed`);
229
+ }
230
+ else {
231
+ failCount++;
232
+ failedPlugins.push(pluginName);
233
+ spinner.warn(`${pluginName} failed (will continue)`);
234
+ }
235
+ }
236
+ return { successCount, failCount, failedPlugins };
237
+ }
238
+ //# sourceMappingURL=plugin-installer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-installer.js","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/plugin-installer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACzH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAoBhD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAA6B;IACnE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAC1C,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC;IAEtB,6CAA6C;IAC7C,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC;QAC5B,4CAA4C;QAC5C,MAAM,UAAU,GAAG,sBAAsB,CAAC,YAAY,CAAC,CAAC;QACxD,MAAM,WAAW,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CAAC,CAAC,CAAC;YAEvF,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;gBAC1B,SAAS,GAAG,IAAI,CAAC;gBACjB,MAAM;YACR,CAAC;YAED,4DAA4D;YAC5D,IAAI,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;gBAC/D,OAAO,CAAC,IAAI,GAAG,cAAc,UAAU,cAAc,OAAO,KAAK,CAAC;gBAClE,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;gBACjE,SAAS;YACX,CAAC;YAED,MAAM;QACR,CAAC;QAED,IAAI,SAAS,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CAAC,GAAG,UAAU,YAAY,CAAC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,SAAS,EAAE,CAAC;YACZ,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC/B,OAAO,CAAC,IAAI,CAAC,GAAG,UAAU,yBAAyB,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AACpD,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Repository hosting setup
3
+ * Handles git provider detection and configuration
4
+ */
5
+ import type { RepositoryHosting, GitHubRemote } from './types.js';
6
+ /**
7
+ * Options for repository setup
8
+ */
9
+ export interface RepositorySetupOptions {
10
+ targetDir: string;
11
+ isCI: boolean;
12
+ gitHubRemote: GitHubRemote | null;
13
+ }
14
+ /**
15
+ * Result of repository setup
16
+ */
17
+ export interface RepositorySetupResult {
18
+ hosting: RepositoryHosting;
19
+ isMultiRepo: boolean;
20
+ }
21
+ /**
22
+ * Prompt user for repository hosting configuration
23
+ *
24
+ * @param options - Setup options
25
+ * @returns Repository configuration
26
+ */
27
+ export declare function setupRepositoryHosting(options: RepositorySetupOptions): Promise<RepositorySetupResult>;
28
+ //# sourceMappingURL=repository-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-setup.d.ts","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/repository-setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuE5G"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Repository hosting setup
3
+ * Handles git provider detection and configuration
4
+ */
5
+ import chalk from 'chalk';
6
+ import { select } from '@inquirer/prompts';
7
+ /**
8
+ * Prompt user for repository hosting configuration
9
+ *
10
+ * @param options - Setup options
11
+ * @returns Repository configuration
12
+ */
13
+ export async function setupRepositoryHosting(options) {
14
+ const { isCI, gitHubRemote } = options;
15
+ console.log('');
16
+ console.log(chalk.cyan.bold('📦 Repository Hosting'));
17
+ console.log('');
18
+ let repositoryHosting = 'github-single';
19
+ let isMultiRepo = false;
20
+ if (isCI) {
21
+ // CI mode: auto-detect
22
+ repositoryHosting = gitHubRemote ? 'github-single' : 'local';
23
+ console.log(chalk.gray(` → CI mode: Auto-detected ${repositoryHosting} hosting\n`));
24
+ return { hosting: repositoryHosting, isMultiRepo: false };
25
+ }
26
+ // Step 1: Ask about repository structure
27
+ const structure = await select({
28
+ message: 'What is your repository structure?',
29
+ choices: [
30
+ {
31
+ name: 'single - One repository (monorepo or standard project)',
32
+ value: 'single'
33
+ },
34
+ {
35
+ name: 'multiple - Multiple repos (microservices, EDA, parent/child)',
36
+ value: 'multirepo'
37
+ }
38
+ ],
39
+ default: 'single'
40
+ });
41
+ isMultiRepo = structure === 'multirepo';
42
+ // Step 2: Ask about git provider
43
+ const provider = await select({
44
+ message: 'Which Git provider do you use?',
45
+ choices: [
46
+ {
47
+ name: `🐙 GitHub ${gitHubRemote ? '(detected)' : '(recommended)'}`,
48
+ value: 'github'
49
+ },
50
+ {
51
+ name: '🪣 Bitbucket',
52
+ value: 'bitbucket'
53
+ },
54
+ {
55
+ name: '🔷 Azure DevOps',
56
+ value: 'ado'
57
+ },
58
+ {
59
+ name: '💻 Local (no remote)',
60
+ value: 'local'
61
+ },
62
+ {
63
+ name: '🔧 Other (GitLab, etc - coming soon)',
64
+ value: 'other'
65
+ }
66
+ ],
67
+ default: gitHubRemote ? 'github' : 'local'
68
+ });
69
+ // Combine structure + provider
70
+ if (provider === 'local') {
71
+ repositoryHosting = 'local';
72
+ }
73
+ else {
74
+ repositoryHosting = `${provider}-${structure}`;
75
+ }
76
+ return { hosting: repositoryHosting, isMultiRepo };
77
+ }
78
+ //# sourceMappingURL=repository-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-setup.js","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/repository-setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAoB3C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,OAA+B;IAC1E,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAEvC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAA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,EAAE,sCAAsC;gBAC5C,KAAK,EAAE,OAAgB;aACxB;SACF;QACD,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO;KAC3C,CAAC,CAAC;IAEH,+BAA+B;IAC/B,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,iBAAiB,GAAG,OAAO,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,iBAAiB,GAAG,GAAG,QAAQ,IAAI,SAAS,EAAuB,CAAC;IACtE,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Smart re-initialization logic
3
+ * Handles the case when .specweave/ already exists
4
+ * Consolidates duplicate logic from init.ts
5
+ */
6
+ import type { ReinitAction } from './types.js';
7
+ /**
8
+ * Options for smart re-initialization prompt
9
+ */
10
+ export interface SmartReinitOptions {
11
+ targetDir: string;
12
+ isCI: boolean;
13
+ hasForce: boolean;
14
+ }
15
+ /**
16
+ * Result of smart re-initialization
17
+ */
18
+ export interface SmartReinitResult {
19
+ action: ReinitAction;
20
+ continueExisting: boolean;
21
+ }
22
+ /**
23
+ * Prompt user for re-initialization action when .specweave/ already exists
24
+ * This consolidates the duplicate logic that appeared twice in init.ts
25
+ *
26
+ * @param options - Configuration options
27
+ * @returns The chosen action and whether to continue with existing project
28
+ */
29
+ export declare function promptSmartReinit(options: SmartReinitOptions): Promise<SmartReinitResult>;
30
+ //# sourceMappingURL=smart-reinit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smart-reinit.d.ts","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/smart-reinit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,YAAY,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA+E/F"}