specweave 0.22.13 → 0.23.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 (312) hide show
  1. package/.claude-plugin/README.md +2 -2
  2. package/CLAUDE.md +447 -52
  3. package/README.md +33 -10
  4. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts +1 -1
  5. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +1 -1
  6. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
  7. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +1 -1
  8. package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
  9. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +4 -1
  10. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
  11. package/dist/plugins/specweave-github/lib/github-spec-sync.d.ts +1 -1
  12. package/dist/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  13. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts +9 -0
  14. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts.map +1 -1
  15. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js +10 -1
  16. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js.map +1 -1
  17. package/dist/plugins/specweave-github/lib/progress-comment-builder.js +2 -2
  18. package/dist/plugins/specweave-github/lib/progress-comment-builder.js.map +1 -1
  19. package/dist/plugins/specweave-github/lib/types.d.ts +1 -1
  20. package/dist/src/cli/commands/import-external.d.ts +22 -0
  21. package/dist/src/cli/commands/import-external.d.ts.map +1 -0
  22. package/dist/src/cli/commands/import-external.js +282 -0
  23. package/dist/src/cli/commands/import-external.js.map +1 -0
  24. package/dist/src/cli/commands/init.d.ts.map +1 -1
  25. package/dist/src/cli/commands/init.js +359 -1
  26. package/dist/src/cli/commands/init.js.map +1 -1
  27. package/dist/src/cli/helpers/github-repo-selector.d.ts +59 -0
  28. package/dist/src/cli/helpers/github-repo-selector.d.ts.map +1 -0
  29. package/dist/src/cli/helpers/github-repo-selector.js +265 -0
  30. package/dist/src/cli/helpers/github-repo-selector.js.map +1 -0
  31. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  32. package/dist/src/cli/helpers/issue-tracker/index.js +41 -24
  33. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  34. package/dist/src/config/import-config.d.ts +69 -0
  35. package/dist/src/config/import-config.d.ts.map +1 -0
  36. package/dist/src/config/import-config.js +136 -0
  37. package/dist/src/config/import-config.js.map +1 -0
  38. package/dist/src/config/types.d.ts +26 -26
  39. package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -1
  40. package/dist/src/core/increment/ac-status-manager.js +4 -2
  41. package/dist/src/core/increment/ac-status-manager.js.map +1 -1
  42. package/dist/src/core/increment/completion-validator.d.ts +30 -1
  43. package/dist/src/core/increment/completion-validator.d.ts.map +1 -1
  44. package/dist/src/core/increment/completion-validator.js +151 -3
  45. package/dist/src/core/increment/completion-validator.js.map +1 -1
  46. package/dist/src/core/increment/increment-archiver.d.ts +25 -0
  47. package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
  48. package/dist/src/core/increment/increment-archiver.js +130 -3
  49. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  50. package/dist/src/core/living-docs/feature-archiver.d.ts +37 -0
  51. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
  52. package/dist/src/core/living-docs/feature-archiver.js +262 -18
  53. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  54. package/dist/src/core/living-docs/feature-id-manager.d.ts +17 -0
  55. package/dist/src/core/living-docs/feature-id-manager.d.ts.map +1 -1
  56. package/dist/src/core/living-docs/feature-id-manager.js +25 -0
  57. package/dist/src/core/living-docs/feature-id-manager.js.map +1 -1
  58. package/dist/src/core/living-docs/living-docs-sync.d.ts +16 -0
  59. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  60. package/dist/src/core/living-docs/living-docs-sync.js +56 -1
  61. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  62. package/dist/src/core/living-docs/task-project-specific-generator.d.ts +2 -2
  63. package/dist/src/core/living-docs/task-project-specific-generator.js +2 -2
  64. package/dist/src/core/repo-structure/prompt-consolidator.d.ts +2 -2
  65. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  66. package/dist/src/core/repo-structure/prompt-consolidator.js +3 -15
  67. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  68. package/dist/src/core/repo-structure/repo-structure-manager.d.ts +1 -1
  69. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  70. package/dist/src/core/repo-structure/repo-structure-manager.js +3 -6
  71. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  72. package/dist/src/core/spec-content-sync.d.ts +4 -1
  73. package/dist/src/core/spec-content-sync.d.ts.map +1 -1
  74. package/dist/src/core/spec-content-sync.js +139 -4
  75. package/dist/src/core/spec-content-sync.js.map +1 -1
  76. package/dist/src/core/spec-task-mapper.d.ts.map +1 -1
  77. package/dist/src/core/spec-task-mapper.js +9 -8
  78. package/dist/src/core/spec-task-mapper.js.map +1 -1
  79. package/dist/src/core/status-line-validator.d.ts +63 -0
  80. package/dist/src/core/status-line-validator.d.ts.map +1 -0
  81. package/dist/src/core/status-line-validator.js +253 -0
  82. package/dist/src/core/status-line-validator.js.map +1 -0
  83. package/dist/src/core/sync/bidirectional-engine.d.ts +10 -1
  84. package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
  85. package/dist/src/core/sync/bidirectional-engine.js +10 -1
  86. package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
  87. package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
  88. package/dist/src/core/sync/profile-manager.js +3 -0
  89. package/dist/src/core/sync/profile-manager.js.map +1 -1
  90. package/dist/src/core/sync/project-context.d.ts.map +1 -1
  91. package/dist/src/core/sync/project-context.js +3 -0
  92. package/dist/src/core/sync/project-context.js.map +1 -1
  93. package/dist/src/core/sync/status-sync-engine.d.ts +1 -1
  94. package/dist/src/core/sync/status-sync-engine.js +1 -1
  95. package/dist/src/core/sync/sync-event-logger.d.ts +15 -1
  96. package/dist/src/core/sync/sync-event-logger.d.ts.map +1 -1
  97. package/dist/src/core/sync/sync-event-logger.js +39 -1
  98. package/dist/src/core/sync/sync-event-logger.js.map +1 -1
  99. package/dist/src/core/types/origin-metadata.d.ts +153 -0
  100. package/dist/src/core/types/origin-metadata.d.ts.map +1 -0
  101. package/dist/src/core/types/origin-metadata.js +166 -0
  102. package/dist/src/core/types/origin-metadata.js.map +1 -0
  103. package/dist/src/core/types/sync-config-validator.d.ts +57 -0
  104. package/dist/src/core/types/sync-config-validator.d.ts.map +1 -0
  105. package/dist/src/core/types/sync-config-validator.js +116 -0
  106. package/dist/src/core/types/sync-config-validator.js.map +1 -0
  107. package/dist/src/core/types/sync-profile.d.ts +8 -2
  108. package/dist/src/core/types/sync-profile.d.ts.map +1 -1
  109. package/dist/src/core/types/sync-profile.js.map +1 -1
  110. package/dist/src/core/types/sync-settings.d.ts +73 -0
  111. package/dist/src/core/types/sync-settings.d.ts.map +1 -0
  112. package/dist/src/core/types/sync-settings.js +90 -0
  113. package/dist/src/core/types/sync-settings.js.map +1 -0
  114. package/dist/src/core/utils/permission-checker.d.ts +100 -0
  115. package/dist/src/core/utils/permission-checker.d.ts.map +1 -0
  116. package/dist/src/core/utils/permission-checker.js +166 -0
  117. package/dist/src/core/utils/permission-checker.js.map +1 -0
  118. package/dist/src/generators/spec/spec-parser.js +3 -3
  119. package/dist/src/generators/spec/spec-parser.js.map +1 -1
  120. package/dist/src/generators/spec/task-parser.js +4 -4
  121. package/dist/src/generators/spec/task-parser.js.map +1 -1
  122. package/dist/src/id-generators/task-id-generator.d.ts +96 -0
  123. package/dist/src/id-generators/task-id-generator.d.ts.map +1 -0
  124. package/dist/src/id-generators/task-id-generator.js +143 -0
  125. package/dist/src/id-generators/task-id-generator.js.map +1 -0
  126. package/dist/src/id-generators/us-id-generator.d.ts +96 -0
  127. package/dist/src/id-generators/us-id-generator.d.ts.map +1 -0
  128. package/dist/src/id-generators/us-id-generator.js +143 -0
  129. package/dist/src/id-generators/us-id-generator.js.map +1 -0
  130. package/dist/src/importers/ado-importer.d.ts +43 -0
  131. package/dist/src/importers/ado-importer.d.ts.map +1 -0
  132. package/dist/src/importers/ado-importer.js +234 -0
  133. package/dist/src/importers/ado-importer.js.map +1 -0
  134. package/dist/src/importers/duplicate-detector.d.ts +107 -0
  135. package/dist/src/importers/duplicate-detector.d.ts.map +1 -0
  136. package/dist/src/importers/duplicate-detector.js +189 -0
  137. package/dist/src/importers/duplicate-detector.js.map +1 -0
  138. package/dist/src/importers/external-importer.d.ts +96 -0
  139. package/dist/src/importers/external-importer.d.ts.map +1 -0
  140. package/dist/src/importers/external-importer.js +13 -0
  141. package/dist/src/importers/external-importer.js.map +1 -0
  142. package/dist/src/importers/github-importer.d.ts +37 -0
  143. package/dist/src/importers/github-importer.d.ts.map +1 -0
  144. package/dist/src/importers/github-importer.js +161 -0
  145. package/dist/src/importers/github-importer.js.map +1 -0
  146. package/dist/src/importers/import-coordinator.d.ts +105 -0
  147. package/dist/src/importers/import-coordinator.d.ts.map +1 -0
  148. package/dist/src/importers/import-coordinator.js +224 -0
  149. package/dist/src/importers/import-coordinator.js.map +1 -0
  150. package/dist/src/importers/item-converter.d.ts +96 -0
  151. package/dist/src/importers/item-converter.d.ts.map +1 -0
  152. package/dist/src/importers/item-converter.js +246 -0
  153. package/dist/src/importers/item-converter.js.map +1 -0
  154. package/dist/src/importers/jira-importer.d.ts +42 -0
  155. package/dist/src/importers/jira-importer.d.ts.map +1 -0
  156. package/dist/src/importers/jira-importer.js +221 -0
  157. package/dist/src/importers/jira-importer.js.map +1 -0
  158. package/dist/src/importers/rate-limiter.d.ts +128 -0
  159. package/dist/src/importers/rate-limiter.d.ts.map +1 -0
  160. package/dist/src/importers/rate-limiter.js +200 -0
  161. package/dist/src/importers/rate-limiter.js.map +1 -0
  162. package/dist/src/init/compliance/types.d.ts +2 -2
  163. package/dist/src/init/repo/types.d.ts +2 -2
  164. package/dist/src/integrations/ado/ado-client.d.ts +6 -0
  165. package/dist/src/integrations/ado/ado-client.d.ts.map +1 -1
  166. package/dist/src/integrations/ado/ado-client.js +23 -0
  167. package/dist/src/integrations/ado/ado-client.js.map +1 -1
  168. package/dist/src/integrations/jira/jira-client.d.ts +6 -0
  169. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  170. package/dist/src/integrations/jira/jira-client.js +38 -0
  171. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  172. package/dist/src/integrations/jira/jira-mapper.d.ts +1 -1
  173. package/dist/src/integrations/jira/jira-mapper.js +1 -1
  174. package/dist/src/living-docs/fs-id-allocator.d.ts +149 -0
  175. package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -0
  176. package/dist/src/living-docs/fs-id-allocator.js +325 -0
  177. package/dist/src/living-docs/fs-id-allocator.js.map +1 -0
  178. package/dist/src/living-docs/id-registry.d.ts +124 -0
  179. package/dist/src/living-docs/id-registry.d.ts.map +1 -0
  180. package/dist/src/living-docs/id-registry.js +230 -0
  181. package/dist/src/living-docs/id-registry.js.map +1 -0
  182. package/dist/src/progress/us-progress-tracker.d.ts +68 -0
  183. package/dist/src/progress/us-progress-tracker.d.ts.map +1 -0
  184. package/dist/src/progress/us-progress-tracker.js +120 -0
  185. package/dist/src/progress/us-progress-tracker.js.map +1 -0
  186. package/dist/src/sync/external-item-sync-service.d.ts +150 -0
  187. package/dist/src/sync/external-item-sync-service.d.ts.map +1 -0
  188. package/dist/src/sync/external-item-sync-service.js +241 -0
  189. package/dist/src/sync/external-item-sync-service.js.map +1 -0
  190. package/dist/src/sync/format-preservation-sync.d.ts +90 -0
  191. package/dist/src/sync/format-preservation-sync.d.ts.map +1 -0
  192. package/dist/src/sync/format-preservation-sync.js +173 -0
  193. package/dist/src/sync/format-preservation-sync.js.map +1 -0
  194. package/dist/src/sync/index.d.ts +8 -0
  195. package/dist/src/sync/index.d.ts.map +1 -0
  196. package/dist/src/sync/index.js +6 -0
  197. package/dist/src/sync/index.js.map +1 -0
  198. package/dist/src/sync/sync-coordinator.d.ts +49 -0
  199. package/dist/src/sync/sync-coordinator.d.ts.map +1 -0
  200. package/dist/src/sync/sync-coordinator.js +248 -0
  201. package/dist/src/sync/sync-coordinator.js.map +1 -0
  202. package/dist/src/sync/sync-metadata.d.ts +75 -0
  203. package/dist/src/sync/sync-metadata.d.ts.map +1 -0
  204. package/dist/src/sync/sync-metadata.js +100 -0
  205. package/dist/src/sync/sync-metadata.js.map +1 -0
  206. package/dist/src/types/living-docs-us-file.d.ts +63 -0
  207. package/dist/src/types/living-docs-us-file.d.ts.map +1 -0
  208. package/dist/src/types/living-docs-us-file.js +27 -0
  209. package/dist/src/types/living-docs-us-file.js.map +1 -0
  210. package/dist/src/validators/format-preservation-validator.d.ts +127 -0
  211. package/dist/src/validators/format-preservation-validator.d.ts.map +1 -0
  212. package/dist/src/validators/format-preservation-validator.js +187 -0
  213. package/dist/src/validators/format-preservation-validator.js.map +1 -0
  214. package/package.json +3 -2
  215. package/plugins/specweave/.claude-plugin/plugin.json +36 -2
  216. package/plugins/specweave/agents/architect/AGENT.md +11 -2
  217. package/plugins/specweave/agents/test-aware-planner/AGENT.md +81 -25
  218. package/plugins/specweave/commands/specweave-archive-features.md +11 -1
  219. package/plugins/specweave/commands/specweave-import-external.md +407 -0
  220. package/plugins/specweave/commands/specweave-progress.md +45 -97
  221. package/plugins/specweave/hooks/post-edit-spec.sh +41 -0
  222. package/plugins/specweave/hooks/post-increment-completion.sh +168 -26
  223. package/plugins/specweave/hooks/post-increment-planning.sh +148 -4
  224. package/plugins/specweave/hooks/post-spec-update.sh +0 -0
  225. package/plugins/specweave/hooks/post-task-completion.sh +75 -5
  226. package/plugins/specweave/hooks/post-write-spec.sh +37 -0
  227. package/plugins/specweave/lib/hooks/auto-transition.js +1 -1
  228. package/plugins/specweave/lib/hooks/auto-transition.ts +1 -1
  229. package/plugins/specweave/lib/hooks/invoke-translator-skill.js +1 -1
  230. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +1 -1
  231. package/plugins/specweave/lib/hooks/sync-cache.js +294 -0
  232. package/plugins/specweave/lib/hooks/sync-living-docs.js +67 -2
  233. package/plugins/specweave/lib/hooks/sync-us-tasks.js +200 -14
  234. package/plugins/specweave/lib/hooks/translate-file.js +1 -1
  235. package/plugins/specweave/lib/hooks/translate-file.ts +1 -1
  236. package/plugins/specweave/lib/hooks/update-ac-status.js +1 -1
  237. package/plugins/specweave/lib/hooks/update-ac-status.ts +1 -1
  238. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.d.ts +115 -0
  239. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +345 -0
  240. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -0
  241. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.d.ts +106 -0
  242. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +220 -0
  243. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -0
  244. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +60 -0
  245. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +192 -0
  246. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -0
  247. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.d.ts +52 -0
  248. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +276 -0
  249. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -0
  250. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.d.ts +163 -0
  251. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +541 -0
  252. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -0
  253. package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +157 -0
  254. package/plugins/specweave/lib/vendor/core/types/increment-metadata.js +191 -0
  255. package/plugins/specweave/lib/vendor/core/types/increment-metadata.js.map +1 -0
  256. package/plugins/specweave/lib/vendor/generators/spec/task-parser.d.ts +95 -0
  257. package/plugins/specweave/lib/vendor/generators/spec/task-parser.js +301 -0
  258. package/plugins/specweave/lib/vendor/generators/spec/task-parser.js.map +1 -0
  259. package/plugins/specweave/lib/vendor/utils/logger.d.ts +48 -0
  260. package/plugins/specweave/lib/vendor/utils/logger.js +53 -0
  261. package/plugins/specweave/lib/vendor/utils/logger.js.map +1 -0
  262. package/plugins/specweave/lib/vendor/utils/translation.d.ts +187 -0
  263. package/plugins/specweave/lib/vendor/utils/translation.js +414 -0
  264. package/plugins/specweave/lib/vendor/utils/translation.js.map +1 -0
  265. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  266. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +0 -1
  267. package/plugins/specweave-ado/lib/conflict-resolver.ts +1 -1
  268. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +1 -1
  269. package/plugins/specweave-backend/.claude-plugin/plugin.json +1 -1
  270. package/plugins/specweave-confluent/.claude-plugin/plugin.json +1 -1
  271. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +1 -1
  272. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  273. package/plugins/specweave-docs/.claude-plugin/plugin.json +1 -1
  274. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  275. package/plugins/specweave-figma/.claude-plugin/plugin.json +1 -1
  276. package/plugins/specweave-frontend/.claude-plugin/plugin.json +1 -1
  277. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  278. package/plugins/specweave-github/commands/specweave-github-update-user-story.md +1 -1
  279. package/plugins/specweave-github/hooks/post-task-completion.sh +37 -22
  280. package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +1 -1
  281. package/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
  282. package/plugins/specweave-github/lib/enhanced-github-sync.ts +1 -1
  283. package/plugins/specweave-github/lib/github-spec-content-sync.js +2 -1
  284. package/plugins/specweave-github/lib/github-spec-content-sync.ts +4 -1
  285. package/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  286. package/plugins/specweave-github/lib/github-spec-sync.ts +1 -1
  287. package/plugins/specweave-github/lib/github-sync-bidirectional.js +1 -1
  288. package/plugins/specweave-github/lib/github-sync-bidirectional.ts +10 -1
  289. package/plugins/specweave-github/lib/progress-comment-builder.js +1 -1
  290. package/plugins/specweave-github/lib/progress-comment-builder.ts +2 -2
  291. package/plugins/specweave-github/lib/types.ts +1 -1
  292. package/plugins/specweave-github/skills/github-issue-standard/SKILL.md +1 -1
  293. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  294. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  295. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
  296. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  297. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  298. package/plugins/specweave-kubernetes/.claude-plugin/plugin.json +1 -1
  299. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  300. package/plugins/specweave-mobile/.claude-plugin/plugin.json +1 -1
  301. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  302. package/plugins/specweave-payments/.claude-plugin/plugin.json +1 -1
  303. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  304. package/plugins/specweave-testing/.claude-plugin/plugin.json +1 -1
  305. package/plugins/specweave-tooling/.claude-plugin/plugin.json +1 -1
  306. package/plugins/specweave-ui/.claude-plugin/plugin.json +1 -1
  307. package/src/templates/.env.example +5 -0
  308. package/src/templates/config-permissions-guide.md +413 -0
  309. package/src/templates/config.json.template +68 -0
  310. package/src/templates/tasks.md.template +180 -201
  311. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
  312. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -5442
@@ -0,0 +1,224 @@
1
+ /**
2
+ * Import Coordinator
3
+ *
4
+ * Orchestrates multi-platform imports from GitHub, JIRA, and Azure DevOps.
5
+ * Handles parallel execution, progress tracking, and result aggregation.
6
+ */
7
+ import { GitHubImporter } from './github-importer.js';
8
+ import { JiraImporter } from './jira-importer.js';
9
+ import { ADOImporter } from './ado-importer.js';
10
+ import { updateSyncMetadata } from '../sync/sync-metadata.js';
11
+ import { RateLimiter } from './rate-limiter.js';
12
+ /**
13
+ * Import Coordinator
14
+ */
15
+ export class ImportCoordinator {
16
+ constructor(config) {
17
+ this.importers = new Map();
18
+ this.rateLimiter = null;
19
+ this.config = {
20
+ enableSyncMetadata: true,
21
+ enableRateLimiting: true,
22
+ projectRoot: process.cwd(),
23
+ ...config,
24
+ };
25
+ this.projectRoot = this.config.projectRoot;
26
+ // Initialize rate limiter if enabled
27
+ if (this.config.enableRateLimiting) {
28
+ this.rateLimiter = new RateLimiter();
29
+ }
30
+ this.initializeImporters();
31
+ }
32
+ /**
33
+ * Initialize importers based on configuration
34
+ */
35
+ initializeImporters() {
36
+ // GitHub importer
37
+ if (this.config.github) {
38
+ try {
39
+ const importer = new GitHubImporter(this.config.github.owner, this.config.github.repo, this.config.github.token);
40
+ this.importers.set('github', importer);
41
+ }
42
+ catch (error) {
43
+ console.warn(`Failed to initialize GitHub importer: ${error.message}`);
44
+ }
45
+ }
46
+ // JIRA importer
47
+ if (this.config.jira) {
48
+ try {
49
+ const importer = new JiraImporter(this.config.jira.host, this.config.jira.email, this.config.jira.apiToken);
50
+ this.importers.set('jira', importer);
51
+ }
52
+ catch (error) {
53
+ console.warn(`Failed to initialize JIRA importer: ${error.message}`);
54
+ }
55
+ }
56
+ // Azure DevOps importer
57
+ if (this.config.ado) {
58
+ try {
59
+ const importer = new ADOImporter(this.config.ado.orgUrl, this.config.ado.project, this.config.ado.pat);
60
+ this.importers.set('ado', importer);
61
+ }
62
+ catch (error) {
63
+ console.warn(`Failed to initialize ADO importer: ${error.message}`);
64
+ }
65
+ }
66
+ if (this.importers.size === 0) {
67
+ throw new Error('No importers configured. Provide at least one platform configuration.');
68
+ }
69
+ }
70
+ /**
71
+ * Import from all configured platforms
72
+ */
73
+ async importAll() {
74
+ const parallel = this.config.parallel !== false; // Default to true
75
+ if (parallel) {
76
+ return this.importParallel();
77
+ }
78
+ else {
79
+ return this.importSequential();
80
+ }
81
+ }
82
+ /**
83
+ * Import from platforms in parallel
84
+ */
85
+ async importParallel() {
86
+ const promises = Array.from(this.importers.entries()).map(([platform, importer]) => this.importFromPlatform(platform, importer));
87
+ const results = await Promise.allSettled(promises);
88
+ return this.aggregateResults(results);
89
+ }
90
+ /**
91
+ * Import from platforms sequentially
92
+ */
93
+ async importSequential() {
94
+ const results = [];
95
+ for (const [platform, importer] of this.importers.entries()) {
96
+ try {
97
+ const result = await this.importFromPlatform(platform, importer);
98
+ results.push({ status: 'fulfilled', value: result });
99
+ }
100
+ catch (error) {
101
+ results.push({
102
+ status: 'rejected',
103
+ reason: error,
104
+ });
105
+ }
106
+ }
107
+ return this.aggregateResults(results);
108
+ }
109
+ /**
110
+ * Import from a single platform with progress tracking
111
+ */
112
+ async importFromPlatform(platform, importer) {
113
+ const errors = [];
114
+ const items = [];
115
+ try {
116
+ // Use pagination for progress tracking
117
+ for await (const page of importer.paginate(this.config.importConfig)) {
118
+ items.push(...page);
119
+ // Report progress
120
+ if (this.config.onProgress) {
121
+ this.config.onProgress(platform, items.length);
122
+ }
123
+ }
124
+ // Update sync metadata if enabled
125
+ if (this.config.enableSyncMetadata && items.length > 0) {
126
+ const metadata = {
127
+ lastImport: new Date().toISOString(),
128
+ lastImportCount: items.length,
129
+ lastSyncResult: errors.length > 0 ? 'partial' : 'success',
130
+ };
131
+ try {
132
+ updateSyncMetadata(this.projectRoot, platform, metadata);
133
+ }
134
+ catch (error) {
135
+ // Log metadata update error but don't fail the import
136
+ errors.push(`Failed to update sync metadata: ${error.message}`);
137
+ }
138
+ }
139
+ }
140
+ catch (error) {
141
+ errors.push(error.message || String(error));
142
+ // Update sync metadata with failed status
143
+ if (this.config.enableSyncMetadata) {
144
+ const metadata = {
145
+ lastImport: new Date().toISOString(),
146
+ lastImportCount: 0,
147
+ lastSyncResult: 'failed',
148
+ };
149
+ try {
150
+ updateSyncMetadata(this.projectRoot, platform, metadata);
151
+ }
152
+ catch {
153
+ // Ignore metadata update errors on failed imports
154
+ }
155
+ }
156
+ }
157
+ return {
158
+ count: items.length,
159
+ items,
160
+ errors,
161
+ platform: importer.platform,
162
+ };
163
+ }
164
+ /**
165
+ * Aggregate results from all platforms
166
+ */
167
+ aggregateResults(results) {
168
+ const allResults = [];
169
+ const allItems = [];
170
+ const errors = {};
171
+ const platforms = [];
172
+ for (const result of results) {
173
+ if (result.status === 'fulfilled') {
174
+ const importResult = result.value;
175
+ allResults.push(importResult);
176
+ allItems.push(...importResult.items);
177
+ platforms.push(importResult.platform);
178
+ if (importResult.errors.length > 0) {
179
+ errors[importResult.platform] = importResult.errors;
180
+ }
181
+ }
182
+ else {
183
+ // Rejected promise
184
+ const error = result.reason;
185
+ const errorMsg = error?.message || String(error);
186
+ // Try to determine which platform failed
187
+ const platformMatch = errorMsg.match(/(GitHub|JIRA|ADO)/i);
188
+ const platform = platformMatch ? platformMatch[1].toLowerCase() : 'unknown';
189
+ errors[platform] = errors[platform] || [];
190
+ errors[platform].push(errorMsg);
191
+ }
192
+ }
193
+ return {
194
+ results: allResults,
195
+ totalCount: allItems.length,
196
+ allItems,
197
+ errors,
198
+ platforms,
199
+ };
200
+ }
201
+ /**
202
+ * Import from a specific platform only
203
+ */
204
+ async importFrom(platform) {
205
+ const importer = this.importers.get(platform);
206
+ if (!importer) {
207
+ throw new Error(`${platform} importer not configured`);
208
+ }
209
+ return this.importFromPlatform(platform, importer);
210
+ }
211
+ /**
212
+ * Get list of configured platforms
213
+ */
214
+ getConfiguredPlatforms() {
215
+ return Array.from(this.importers.keys());
216
+ }
217
+ /**
218
+ * Check if a platform is configured
219
+ */
220
+ isPlatformConfigured(platform) {
221
+ return this.importers.has(platform);
222
+ }
223
+ }
224
+ //# sourceMappingURL=import-coordinator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-coordinator.js","sourceRoot":"","sources":["../../../src/importers/import-coordinator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAA6B,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,WAAW,EAAsB,MAAM,mBAAmB,CAAC;AAqEpE;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAM5B,YAAY,MAAyB;QAL7B,cAAS,GAA0B,IAAI,GAAG,EAAE,CAAC;QAE7C,gBAAW,GAAuB,IAAI,CAAC;QAI7C,IAAI,CAAC,MAAM,GAAG;YACZ,kBAAkB,EAAE,IAAI;YACxB,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,OAAO,CAAC,GAAG,EAAE;YAC1B,GAAG,MAAM;SACV,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAY,CAAC;QAE5C,qCAAqC;QACrC,IAAI,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;YACnC,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACK,mBAAmB;QACzB,kBAAkB;QAClB,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,IAAI,cAAc,CACjC,IAAI,CAAC,MAAM,CAAC,M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B,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAqC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,QAAmC;QACtD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;CACF"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Item Converter
3
+ *
4
+ * Converts external items (GitHub/JIRA/ADO) to SpecWeave living docs User Stories.
5
+ * CRITICAL: Does NOT create increments - only creates living docs.
6
+ */
7
+ import type { ExternalItem } from './external-importer.js';
8
+ export interface ConvertedUserStory {
9
+ /** User Story ID with E suffix (e.g., US-001E) */
10
+ id: string;
11
+ /** User Story title */
12
+ title: string;
13
+ /** User Story description */
14
+ description: string;
15
+ /** Acceptance criteria */
16
+ acceptanceCriteria: string[];
17
+ /** Priority (P0-P4) */
18
+ priority?: string;
19
+ /** Status (open, in-progress, completed) */
20
+ status: string;
21
+ /** External metadata */
22
+ metadata: {
23
+ externalId: string;
24
+ externalUrl: string;
25
+ externalPlatform: 'github' | 'jira' | 'ado';
26
+ importedAt: string;
27
+ createdAt: string;
28
+ updatedAt: string;
29
+ labels: string[];
30
+ };
31
+ /** Living docs file path */
32
+ filePath: string;
33
+ /** Living docs markdown content */
34
+ markdown: string;
35
+ }
36
+ export interface ItemConverterOptions {
37
+ /** Base directory for living docs (e.g., .specweave/docs/internal/specs) */
38
+ specsDir: string;
39
+ /** Starting US-ID number for imported items (default: 1) */
40
+ startingId?: number;
41
+ /** Project root for FS-ID allocator and ID registry */
42
+ projectRoot?: string;
43
+ /** Enable feature-level organization with FS-ID allocation */
44
+ enableFeatureAllocation?: boolean;
45
+ /** Enable duplicate detection (default: true) */
46
+ enableDuplicateDetection?: boolean;
47
+ /** Callback for skipped duplicates */
48
+ onDuplicateSkipped?: (externalId: string, existingUsId: string) => void;
49
+ }
50
+ /**
51
+ * Convert external items to living docs User Stories
52
+ *
53
+ * CRITICAL: This function ONLY creates living docs files.
54
+ * It does NOT create increments or populate .specweave/increments/.
55
+ */
56
+ export declare class ItemConverter {
57
+ private options;
58
+ private duplicateDetector;
59
+ constructor(options: ItemConverterOptions);
60
+ /**
61
+ * Convert a single external item to a User Story with E suffix
62
+ */
63
+ convertItem(item: ExternalItem, usId: number): ConvertedUserStory;
64
+ /**
65
+ * Convert multiple external items to User Stories
66
+ *
67
+ * CRITICAL: This method ONLY creates living docs files.
68
+ * It does NOT create increments.
69
+ */
70
+ convertItems(items: ExternalItem[]): Promise<ConvertedUserStory[]>;
71
+ /**
72
+ * Map external status to SpecWeave status
73
+ */
74
+ private mapStatus;
75
+ /**
76
+ * Generate origin badge for living docs
77
+ */
78
+ private generateOriginBadge;
79
+ /**
80
+ * Generate markdown content for living docs User Story
81
+ */
82
+ private generateMarkdown;
83
+ /**
84
+ * Generate file name for living docs User Story
85
+ *
86
+ * Format: us-001e-title-here.md
87
+ */
88
+ private generateFileName;
89
+ /**
90
+ * Validate that no increments were created
91
+ *
92
+ * CRITICAL: This validation ensures we're not auto-creating increments.
93
+ */
94
+ static validateNoIncrementsCreated(projectRoot: string): void;
95
+ }
96
+ //# sourceMappingURL=item-converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-converter.d.ts","sourceRoot":"","sources":["../../../src/importers/item-converter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAQ3D,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IAEX,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IAEd,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IA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kBAAkB,EAAE,CAAC;IAwCxE;;OAEG;IACH,OAAO,CAAC,SAAS;IAWjB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAsB3B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA6ExB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAexB;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CAsB9D"}
@@ -0,0 +1,246 @@
1
+ /**
2
+ * Item Converter
3
+ *
4
+ * Converts external items (GitHub/JIRA/ADO) to SpecWeave living docs User Stories.
5
+ * CRITICAL: Does NOT create increments - only creates living docs.
6
+ */
7
+ import fs from 'fs-extra';
8
+ import path from 'path';
9
+ import { DuplicateDetector } from './duplicate-detector.js';
10
+ /**
11
+ * Convert external items to living docs User Stories
12
+ *
13
+ * CRITICAL: This function ONLY creates living docs files.
14
+ * It does NOT create increments or populate .specweave/increments/.
15
+ */
16
+ export class ItemConverter {
17
+ constructor(options) {
18
+ this.duplicateDetector = null;
19
+ this.options = {
20
+ enableDuplicateDetection: true,
21
+ ...options,
22
+ };
23
+ // Initialize duplicate detector if enabled
24
+ if (this.options.enableDuplicateDetection) {
25
+ this.duplicateDetector = new DuplicateDetector({
26
+ specsDir: this.options.specsDir,
27
+ });
28
+ }
29
+ }
30
+ /**
31
+ * Convert a single external item to a User Story with E suffix
32
+ */
33
+ convertItem(item, usId) {
34
+ // Generate US-ID with E suffix
35
+ const id = `US-${String(usId).padStart(3, '0')}E`;
36
+ // Map external status to SpecWeave status
37
+ const status = this.mapStatus(item.status);
38
+ // Extract acceptance criteria
39
+ const acceptanceCriteria = item.acceptanceCriteria || [];
40
+ // Generate origin badge
41
+ const originBadge = this.generateOriginBadge(item);
42
+ // Generate markdown content for living docs
43
+ const markdown = this.generateMarkdown({
44
+ id,
45
+ title: item.title,
46
+ description: item.description,
47
+ acceptanceCriteria,
48
+ priority: item.priority,
49
+ status,
50
+ originBadge,
51
+ metadata: {
52
+ externalId: item.id,
53
+ externalUrl: item.url,
54
+ externalPlatform: item.platform,
55
+ importedAt: new Date().toISOString(),
56
+ createdAt: item.createdAt.toISOString(),
57
+ updatedAt: item.updatedAt.toISOString(),
58
+ labels: item.labels
59
+ }
60
+ });
61
+ // Generate file path
62
+ const fileName = this.generateFileName(id, item.title);
63
+ const filePath = path.join(this.options.specsDir, fileName);
64
+ return {
65
+ id,
66
+ title: item.title,
67
+ description: item.description,
68
+ acceptanceCriteria,
69
+ priority: item.priority,
70
+ status,
71
+ metadata: {
72
+ externalId: item.id,
73
+ externalUrl: item.url,
74
+ externalPlatform: item.platform,
75
+ importedAt: new Date().toISOString(),
76
+ createdAt: item.createdAt.toISOString(),
77
+ updatedAt: item.updatedAt.toISOString(),
78
+ labels: item.labels
79
+ },
80
+ filePath,
81
+ markdown
82
+ };
83
+ }
84
+ /**
85
+ * Convert multiple external items to User Stories
86
+ *
87
+ * CRITICAL: This method ONLY creates living docs files.
88
+ * It does NOT create increments.
89
+ */
90
+ async convertItems(items) {
91
+ const startingId = this.options.startingId || 1;
92
+ const converted = [];
93
+ let skippedCount = 0;
94
+ // Ensure specs directory exists
95
+ fs.mkdirSync(this.options.specsDir, { recursive: true });
96
+ // Convert each item
97
+ for (let i = 0; i < items.length; i++) {
98
+ const item = items[i];
99
+ // Check for duplicates if duplicate detection is enabled
100
+ if (this.duplicateDetector) {
101
+ const existingReference = await this.duplicateDetector.findExternalIdReference(item.id);
102
+ if (existingReference) {
103
+ skippedCount++;
104
+ // Notify callback if provided
105
+ if (this.options.onDuplicateSkipped) {
106
+ this.options.onDuplicateSkipped(item.id, existingReference.usId);
107
+ }
108
+ // Skip this item (duplicate)
109
+ continue;
110
+ }
111
+ }
112
+ const usId = startingId + (i - skippedCount);
113
+ const userStory = this.convertItem(item, usId);
114
+ converted.push(userStory);
115
+ // Write living docs file
116
+ fs.writeFileSync(userStory.filePath, userStory.markdown, 'utf-8');
117
+ }
118
+ return converted;
119
+ }
120
+ /**
121
+ * Map external status to SpecWeave status
122
+ */
123
+ mapStatus(externalStatus) {
124
+ const statusMap = {
125
+ 'open': 'Open',
126
+ 'in-progress': 'In Progress',
127
+ 'completed': 'Completed',
128
+ 'closed': 'Completed'
129
+ };
130
+ return statusMap[externalStatus] || 'Open';
131
+ }
132
+ /**
133
+ * Generate origin badge for living docs
134
+ */
135
+ generateOriginBadge(item) {
136
+ const platformEmoji = {
137
+ 'github': '🔗',
138
+ 'jira': '🔗',
139
+ 'ado': '🔗'
140
+ };
141
+ const platformName = {
142
+ 'github': 'GitHub',
143
+ 'jira': 'JIRA',
144
+ 'ado': 'Azure DevOps'
145
+ };
146
+ const emoji = platformEmoji[item.platform] || '🔗';
147
+ const name = platformName[item.platform] || item.platform;
148
+ // Extract issue/ticket number from external ID
149
+ const issueNumber = item.id.replace(/^(GITHUB|JIRA|ADO)-/, '');
150
+ return `${emoji} [${name} #${issueNumber}](${item.url})`;
151
+ }
152
+ /**
153
+ * Generate markdown content for living docs User Story
154
+ */
155
+ generateMarkdown(data) {
156
+ const parts = [];
157
+ // Title
158
+ parts.push(`# ${data.id}: ${data.title}`);
159
+ parts.push('');
160
+ // Origin badge
161
+ parts.push(`**Origin**: ${data.originBadge}`);
162
+ parts.push('');
163
+ // Status and Priority
164
+ parts.push(`**Status**: ${data.status}`);
165
+ if (data.priority) {
166
+ parts.push(`**Priority**: ${data.priority}`);
167
+ }
168
+ parts.push('');
169
+ // Description
170
+ parts.push('## Description');
171
+ parts.push('');
172
+ parts.push(data.description || 'No description provided.');
173
+ parts.push('');
174
+ // Acceptance Criteria
175
+ if (data.acceptanceCriteria.length > 0) {
176
+ parts.push('## Acceptance Criteria');
177
+ parts.push('');
178
+ data.acceptanceCriteria.forEach((ac, index) => {
179
+ const acId = `AC-${data.id.replace('E', '')}-${String(index + 1).padStart(2, '0')}`;
180
+ parts.push(`- [ ] **${acId}**: ${ac}`);
181
+ });
182
+ parts.push('');
183
+ }
184
+ // Tasks
185
+ parts.push('## Tasks');
186
+ parts.push('');
187
+ parts.push('> **Note**: This User Story was imported from an external tool.');
188
+ parts.push('> Create tasks manually when ready to implement.');
189
+ parts.push('');
190
+ // Metadata (frontmatter-style at bottom)
191
+ parts.push('---');
192
+ parts.push('');
193
+ parts.push('## External Metadata');
194
+ parts.push('');
195
+ parts.push(`- **External ID**: ${data.metadata.externalId}`);
196
+ parts.push(`- **External URL**: ${data.metadata.externalUrl}`);
197
+ parts.push(`- **Platform**: ${data.metadata.externalPlatform}`);
198
+ parts.push(`- **Imported At**: ${data.metadata.importedAt}`);
199
+ parts.push(`- **Created At**: ${data.metadata.createdAt}`);
200
+ parts.push(`- **Updated At**: ${data.metadata.updatedAt}`);
201
+ if (data.metadata.labels.length > 0) {
202
+ parts.push(`- **Labels**: ${data.metadata.labels.join(', ')}`);
203
+ }
204
+ return parts.join('\n');
205
+ }
206
+ /**
207
+ * Generate file name for living docs User Story
208
+ *
209
+ * Format: us-001e-title-here.md
210
+ */
211
+ generateFileName(usId, title) {
212
+ // Convert US-001E to us-001e
213
+ const idPart = usId.toLowerCase();
214
+ // Convert title to kebab-case
215
+ const titlePart = title
216
+ .toLowerCase()
217
+ .replace(/[^a-z0-9\s-]/g, '') // Remove special chars
218
+ .replace(/\s+/g, '-') // Replace spaces with hyphens
219
+ .replace(/-+/g, '-') // Remove duplicate hyphens
220
+ .slice(0, 50); // Limit to 50 chars
221
+ return `${idPart}-${titlePart}.md`;
222
+ }
223
+ /**
224
+ * Validate that no increments were created
225
+ *
226
+ * CRITICAL: This validation ensures we're not auto-creating increments.
227
+ */
228
+ static validateNoIncrementsCreated(projectRoot) {
229
+ const incrementsDir = path.join(projectRoot, '.specweave', 'increments');
230
+ if (!fs.existsSync(incrementsDir)) {
231
+ return; // No increments directory - that's fine
232
+ }
233
+ // Check for any numbered increment directories
234
+ const items = fs.readdirSync(incrementsDir);
235
+ const incrementDirs = items.filter(item => {
236
+ const fullPath = path.join(incrementsDir, item);
237
+ return fs.statSync(fullPath).isDirectory() && /^\d{4}-/.test(item);
238
+ });
239
+ if (incrementDirs.length > 0) {
240
+ throw new Error(`VALIDATION FAILED: Increments were auto-created during import. ` +
241
+ `Found: ${incrementDirs.join(', ')}. ` +
242
+ `Import should ONLY create living docs, not increments.`);
243
+ }
244
+ }
245
+ }
246
+ //# sourceMappingURL=item-converter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-converter.js","sourceRoot":"","sources":["../../../src/importers/item-converter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA2D5D;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAIxB,YAAY,OAA6B;QAFjC,sBAAiB,GAA6B,IAAI,CAAC;QAGzD,IAAI,CAAC,OAAO,GAAG;YACb,wBAAwB,EAAE,IAAI;YAC9B,GAAG,OAAO;SACX,CAAC;QAEF,2CAA2C;QAC3C,IAAI,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC;YAC1C,IAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,CAAC;gBAC7C,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;aAChC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,IAAkB,EAAE,IAAY;QAC1C,+BAA+B;QAC/B,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;QAElD,0CAA0C;QAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE3C,8BAA8B;QAC9B,MAAM,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,IAAI,EAAE,CAAC;QAEzD,wBAAwB;QACxB,MAAM,WAAW,GAAG,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AAI,CAAC,IAAI,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;QAEH,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,iEAAiE;gBACjE,UAAU,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;gBACtC,wDAAwD,CACzD,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * JIRA Importer
3
+ *
4
+ * Imports JIRA issues/epics as External Items with JQL support and pagination.
5
+ * Handles authentication and converts JIRA-specific data to platform-agnostic format.
6
+ */
7
+ import type { Importer, ExternalItem, ImportConfig } from './external-importer.js';
8
+ /**
9
+ * JIRA Importer Implementation
10
+ */
11
+ export declare class JiraImporter implements Importer {
12
+ readonly platform: "jira";
13
+ private host;
14
+ private email;
15
+ private apiToken;
16
+ constructor(host: string, email?: string, apiToken?: string);
17
+ /**
18
+ * Import all issues matching config
19
+ */
20
+ import(config?: ImportConfig): Promise<ExternalItem[]>;
21
+ /**
22
+ * Paginate through issues using JQL (50 per page)
23
+ */
24
+ paginate(config?: ImportConfig): AsyncGenerator<ExternalItem[], void, unknown>;
25
+ /**
26
+ * Make authenticated JIRA API request
27
+ */
28
+ private makeJiraRequest;
29
+ /**
30
+ * Convert JIRA issue to ExternalItem
31
+ */
32
+ private convertToExternalItem;
33
+ /**
34
+ * Extract acceptance criteria from description
35
+ * Looks for patterns like:
36
+ * - AC1: ...
37
+ * - Acceptance Criteria:
38
+ * - Given/When/Then
39
+ */
40
+ private extractAcceptanceCriteria;
41
+ }
42
+ //# sourceMappingURL=jira-importer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-importer.d.ts","sourceRoot":"","sources":["../../../src/importers/jira-importer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA0CnF;;GAEG;AACH,qBAAa,YAAa,YAAW,QAAQ;IAC3C,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAU;IACpC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAS;gBAEb,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAY3D;;OAEG;IACG,MAAM,CAAC,MAAM,GAAE,YAAiB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAUhE;;OAEG;IACI,QAAQ,CAAC,MAAM,GAAE,YAAiB,GAAG,cAAc,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC;IA0FzF;;OAEG;YACW,eAAe;IAgC7B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAyD7B;;;;;;OAMG;IACH,OAAO,CAAC,yBAAyB;CA2BlC"}