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,221 @@
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
+ /**
8
+ * JIRA Importer Implementation
9
+ */
10
+ export class JiraImporter {
11
+ constructor(host, email, apiToken) {
12
+ this.platform = 'jira';
13
+ this.host = host.replace(/\/+$/, ''); // Remove trailing slashes
14
+ this.email = email || process.env.JIRA_EMAIL || '';
15
+ this.apiToken = apiToken || process.env.JIRA_API_TOKEN || '';
16
+ if (!this.email || !this.apiToken) {
17
+ throw new Error('JIRA authentication required: Set JIRA_EMAIL and JIRA_API_TOKEN environment variables');
18
+ }
19
+ }
20
+ /**
21
+ * Import all issues matching config
22
+ */
23
+ async import(config = {}) {
24
+ const items = [];
25
+ for await (const page of this.paginate(config)) {
26
+ items.push(...page);
27
+ }
28
+ return items;
29
+ }
30
+ /**
31
+ * Paginate through issues using JQL (50 per page)
32
+ */
33
+ async *paginate(config = {}) {
34
+ const { timeRangeMonths = 3, includeClosed = false, labels = [], milestone, // JIRA uses "fixVersion" or "epic"
35
+ maxItems = Infinity, } = config;
36
+ // Build JQL query
37
+ const jqlParts = [];
38
+ // Time range
39
+ const since = new Date();
40
+ since.setMonth(since.getMonth() - timeRangeMonths);
41
+ jqlParts.push(`created >= "${since.toISOString().split('T')[0]}"`);
42
+ // Status filter
43
+ if (!includeClosed) {
44
+ jqlParts.push('statusCategory != Done');
45
+ }
46
+ // Labels filter
47
+ if (labels.length > 0) {
48
+ const labelsCondition = labels.map((l) => `labels = "${l}"`).join(' OR ');
49
+ jqlParts.push(`(${labelsCondition})`);
50
+ }
51
+ // Epic/Milestone filter (assuming epic link custom field)
52
+ if (milestone) {
53
+ jqlParts.push(`"Epic Link" = "${milestone}"`);
54
+ }
55
+ const jql = jqlParts.join(' AND ');
56
+ let startAt = 0;
57
+ const maxResults = 50; // JIRA pagination size
58
+ let totalFetched = 0;
59
+ while (totalFetched < maxItems) {
60
+ try {
61
+ // Fetch page from JIRA API
62
+ const response = await this.makeJiraRequest('/rest/api/3/search', {
63
+ jql,
64
+ startAt,
65
+ maxResults,
66
+ fields: [
67
+ 'summary',
68
+ 'description',
69
+ 'status',
70
+ 'priority',
71
+ 'issuetype',
72
+ 'created',
73
+ 'updated',
74
+ 'labels',
75
+ 'customfield_10016', // Story points
76
+ 'subtasks',
77
+ 'parent',
78
+ ],
79
+ });
80
+ // Convert JIRA issues to ExternalItems
81
+ const items = response.issues.map((issue) => this.convertToExternalItem(issue));
82
+ // Yield page
83
+ if (items.length > 0) {
84
+ yield items.slice(0, maxItems - totalFetched);
85
+ totalFetched += items.length;
86
+ }
87
+ // Check if we've reached the end
88
+ if (startAt + maxResults >= response.total) {
89
+ break;
90
+ }
91
+ startAt += maxResults;
92
+ }
93
+ catch (error) {
94
+ if (error.status === 401) {
95
+ throw new Error(`JIRA authentication failed: ${error.message}`);
96
+ }
97
+ else if (error.status === 403) {
98
+ throw new Error(`JIRA access forbidden: ${error.message}`);
99
+ }
100
+ throw error;
101
+ }
102
+ }
103
+ }
104
+ /**
105
+ * Make authenticated JIRA API request
106
+ */
107
+ async makeJiraRequest(endpoint, params = {}) {
108
+ const url = new URL(endpoint, this.host);
109
+ // Add query params
110
+ Object.entries(params).forEach(([key, value]) => {
111
+ if (value !== undefined && value !== null) {
112
+ url.searchParams.append(key, typeof value === 'object' ? JSON.stringify(value) : String(value));
113
+ }
114
+ });
115
+ // Create Basic Auth header
116
+ const auth = Buffer.from(`${this.email}:${this.apiToken}`).toString('base64');
117
+ const response = await fetch(url.toString(), {
118
+ method: 'GET',
119
+ headers: {
120
+ 'Authorization': `Basic ${auth}`,
121
+ 'Accept': 'application/json',
122
+ 'Content-Type': 'application/json',
123
+ },
124
+ });
125
+ if (!response.ok) {
126
+ const errorText = await response.text();
127
+ const error = new Error(`JIRA API error: ${response.statusText} - ${errorText}`);
128
+ error.status = response.status;
129
+ throw error;
130
+ }
131
+ return response.json();
132
+ }
133
+ /**
134
+ * Convert JIRA issue to ExternalItem
135
+ */
136
+ convertToExternalItem(issue) {
137
+ // Map JIRA issue type to ExternalItem type
138
+ let type = 'task';
139
+ const issueTypeName = issue.fields.issuetype.name.toLowerCase();
140
+ if (issueTypeName.includes('story') || issueTypeName === 'user story') {
141
+ type = 'user-story';
142
+ }
143
+ else if (issueTypeName === 'epic') {
144
+ type = 'epic';
145
+ }
146
+ else if (issueTypeName === 'bug') {
147
+ type = 'bug';
148
+ }
149
+ else if (issueTypeName === 'feature') {
150
+ type = 'feature';
151
+ }
152
+ // Map JIRA priority to ExternalItem priority
153
+ const priorityMap = {
154
+ 'highest': 'P0',
155
+ 'high': 'P1',
156
+ 'medium': 'P2',
157
+ 'low': 'P3',
158
+ 'lowest': 'P4',
159
+ };
160
+ const priority = issue.fields.priority
161
+ ? priorityMap[issue.fields.priority.name.toLowerCase()]
162
+ : undefined;
163
+ // Extract acceptance criteria from description
164
+ const acceptanceCriteria = this.extractAcceptanceCriteria(issue.fields.description || '');
165
+ // Map JIRA status category to ExternalItem status
166
+ let status = 'open';
167
+ const statusCategory = issue.fields.status.statusCategory.key;
168
+ if (statusCategory === 'indeterminate') {
169
+ status = 'in-progress';
170
+ }
171
+ else if (statusCategory === 'done') {
172
+ status = 'completed';
173
+ }
174
+ return {
175
+ id: `JIRA-${issue.key}`,
176
+ type,
177
+ title: issue.fields.summary,
178
+ description: issue.fields.description || '',
179
+ status,
180
+ priority,
181
+ createdAt: new Date(issue.fields.created),
182
+ updatedAt: new Date(issue.fields.updated),
183
+ url: `${this.host}/browse/${issue.key}`,
184
+ labels: issue.fields.labels,
185
+ acceptanceCriteria,
186
+ parentId: issue.fields.parent ? `JIRA-${issue.fields.parent.key}` : undefined,
187
+ platform: 'jira',
188
+ };
189
+ }
190
+ /**
191
+ * Extract acceptance criteria from description
192
+ * Looks for patterns like:
193
+ * - AC1: ...
194
+ * - Acceptance Criteria:
195
+ * - Given/When/Then
196
+ */
197
+ extractAcceptanceCriteria(description) {
198
+ const criteria = [];
199
+ // Pattern 1: AC1:, AC2:, etc.
200
+ const acPattern = /AC\d+:\s*(.+)/gi;
201
+ let match;
202
+ while ((match = acPattern.exec(description)) !== null) {
203
+ criteria.push(match[1].trim());
204
+ }
205
+ // Pattern 2: Bullet points under "Acceptance Criteria:" heading
206
+ const acSectionMatch = description.match(/Acceptance Criteria:?\s*\n([\s\S]*?)(?:\n\n|\n#|$)/i);
207
+ if (acSectionMatch) {
208
+ const bullets = acSectionMatch[1].match(/^[\s*-]\s*(.+)/gm);
209
+ if (bullets) {
210
+ criteria.push(...bullets.map((b) => b.replace(/^[\s*-]\s*/, '').trim()));
211
+ }
212
+ }
213
+ // Pattern 3: Given/When/Then format
214
+ const gwtPattern = /Given\s+(.+?)\s+When\s+(.+?)\s+Then\s+(.+)/gi;
215
+ while ((match = gwtPattern.exec(description)) !== null) {
216
+ criteria.push(`Given ${match[1]} When ${match[2]} Then ${match[3]}`);
217
+ }
218
+ return criteria.length > 0 ? criteria : undefined;
219
+ }
220
+ }
221
+ //# sourceMappingURL=jira-importer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-importer.js","sourceRoot":"","sources":["../../../src/importers/jira-importer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4CH;;GAEG;AACH,MAAM,OAAO,YAAY;IAMvB,YAAY,IAAY,EAAE,KAAc,EAAE,QAAiB;QALlD,aAAQ,GAAG,MAAe,CAAC;QAMlC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,0BAA0B;QAChE,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CA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vE,CAAC;QAED,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAgB,CAAC;IAC3D,CAAC;CACF"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Rate Limiter
3
+ *
4
+ * Handles API rate limiting for external platforms (GitHub, JIRA, ADO).
5
+ * Prevents hitting rate limits and provides graceful backoff strategies.
6
+ */
7
+ /**
8
+ * Rate limit information
9
+ */
10
+ export interface RateLimitInfo {
11
+ /** Remaining requests in current window */
12
+ remaining: number;
13
+ /** Total requests allowed per window */
14
+ limit: number;
15
+ /** Timestamp when rate limit resets (ISO string) */
16
+ resetAt: string;
17
+ /** Seconds until reset */
18
+ resetInSeconds: number;
19
+ /** Platform name */
20
+ platform: 'github' | 'jira' | 'ado';
21
+ }
22
+ /**
23
+ * Rate limit thresholds
24
+ */
25
+ export interface RateLimitThresholds {
26
+ /** Warn when remaining requests drop below this (default: 100) */
27
+ warningThreshold?: number;
28
+ /** Pause when remaining requests drop below this (default: 10) */
29
+ pauseThreshold?: number;
30
+ /** Wait time in seconds when paused (default: 60) */
31
+ pauseDuration?: number;
32
+ }
33
+ /**
34
+ * Rate Limiter
35
+ *
36
+ * Monitors and manages API rate limits across platforms.
37
+ */
38
+ export declare class RateLimiter {
39
+ private thresholds;
40
+ private lastRateLimitInfo;
41
+ constructor(thresholds?: RateLimitThresholds);
42
+ /**
43
+ * Check GitHub rate limit from response headers
44
+ *
45
+ * @param headers - HTTP response headers from GitHub API
46
+ * @returns Rate limit information
47
+ */
48
+ checkGitHubRateLimit(headers: Record<string, string>): RateLimitInfo;
49
+ /**
50
+ * Check JIRA rate limit (placeholder - JIRA doesn't expose rate limits in headers)
51
+ *
52
+ * @param headers - HTTP response headers from JIRA API
53
+ * @returns Rate limit information (estimated)
54
+ */
55
+ checkJiraRateLimit(headers: Record<string, string>): RateLimitInfo;
56
+ /**
57
+ * Check Azure DevOps rate limit (placeholder - ADO has different rate limit model)
58
+ *
59
+ * @param headers - HTTP response headers from ADO API
60
+ * @returns Rate limit information (estimated)
61
+ */
62
+ checkAdoRateLimit(headers: Record<string, string>): RateLimitInfo;
63
+ /**
64
+ * Wait if rate limit is low
65
+ *
66
+ * @param platform - Platform to check
67
+ * @param onWait - Callback when waiting (receives wait duration in seconds)
68
+ * @returns True if waited, false if no wait needed
69
+ */
70
+ waitIfNeeded(platform: 'github' | 'jira' | 'ado', onWait?: (platform: string, seconds: number) => void): Promise<boolean>;
71
+ /**
72
+ * Check if rate limit warning should be shown
73
+ *
74
+ * @param platform - Platform to check
75
+ * @returns True if remaining requests are below warning threshold
76
+ */
77
+ shouldWarn(platform: 'github' | 'jira' | 'ado'): boolean;
78
+ /**
79
+ * Get last known rate limit info for a platform
80
+ *
81
+ * @param platform - Platform to query
82
+ * @returns Rate limit info or undefined if not cached
83
+ */
84
+ getLastRateLimitInfo(platform: 'github' | 'jira' | 'ado'): RateLimitInfo | undefined;
85
+ /**
86
+ * Format rate limit warning message
87
+ *
88
+ * @param rateLimitInfo - Rate limit information
89
+ * @returns Formatted warning message
90
+ */
91
+ formatWarning(rateLimitInfo: RateLimitInfo): string;
92
+ /**
93
+ * Format pause message
94
+ *
95
+ * @param platform - Platform name
96
+ * @param seconds - Wait duration in seconds
97
+ * @returns Formatted pause message
98
+ */
99
+ formatPauseMessage(platform: string, seconds: number): string;
100
+ /**
101
+ * Sleep for specified milliseconds
102
+ */
103
+ private sleep;
104
+ /**
105
+ * Clear cached rate limit info (useful for testing)
106
+ */
107
+ clearCache(): void;
108
+ /**
109
+ * Get current thresholds
110
+ */
111
+ getThresholds(): Required<RateLimitThresholds>;
112
+ }
113
+ /**
114
+ * Check if a large import should prompt for confirmation
115
+ *
116
+ * @param itemCount - Number of items to import
117
+ * @param threshold - Confirmation threshold (default: 100)
118
+ * @returns True if confirmation should be requested
119
+ */
120
+ export declare function shouldConfirmLargeImport(itemCount: number, threshold?: number): boolean;
121
+ /**
122
+ * Format large import confirmation message
123
+ *
124
+ * @param itemCount - Number of items to import
125
+ * @returns Formatted confirmation message
126
+ */
127
+ export declare function formatLargeImportMessage(itemCount: number): string;
128
+ //# sourceMappingURL=rate-limiter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limiter.d.ts","sourceRoot":"","sources":["../../../src/importers/rate-limiter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IAEd,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAEhB,0BAA0B;IAC1B,cAAc,EAAE,MAAM,CAAC;IAEvB,oBAAoB;IACpB,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAWD;;;;GAIG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,iBAAiB,CAAyC;gBAEtD,UAAU,GAAE,mBAAwB;IAOhD;;;;;OAKG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,aAAa;IA2BpE;;;;;OAKG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,aAAa;IAgBlE;;;;;OAKG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,aAAa;IAgBjE;;;;;;OAMG;IACG,YAAY,CAChB,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,EACnC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GACnD,OAAO,CAAC,OAAO,CAAC;IAyBnB;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO;IAUxD;;;;;OAKG;IACH,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,aAAa,GAAG,SAAS;IAIpF;;;;;OAKG;IACH,aAAa,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM;IAUnD;;;;;;OAMG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAI7D;;OAEG;IACH,OAAO,CAAC,KAAK;IAIb;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,aAAa,IAAI,QAAQ,CAAC,mBAAmB,CAAC;CAG/C;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,OAAO,CAE5F;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAElE"}
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Rate Limiter
3
+ *
4
+ * Handles API rate limiting for external platforms (GitHub, JIRA, ADO).
5
+ * Prevents hitting rate limits and provides graceful backoff strategies.
6
+ */
7
+ /**
8
+ * Default rate limit thresholds
9
+ */
10
+ const DEFAULT_THRESHOLDS = {
11
+ warningThreshold: 100,
12
+ pauseThreshold: 10,
13
+ pauseDuration: 60,
14
+ };
15
+ /**
16
+ * Rate Limiter
17
+ *
18
+ * Monitors and manages API rate limits across platforms.
19
+ */
20
+ export class RateLimiter {
21
+ constructor(thresholds = {}) {
22
+ this.lastRateLimitInfo = new Map();
23
+ this.thresholds = {
24
+ ...DEFAULT_THRESHOLDS,
25
+ ...thresholds,
26
+ };
27
+ }
28
+ /**
29
+ * Check GitHub rate limit from response headers
30
+ *
31
+ * @param headers - HTTP response headers from GitHub API
32
+ * @returns Rate limit information
33
+ */
34
+ checkGitHubRateLimit(headers) {
35
+ const remaining = parseInt(headers['x-ratelimit-remaining'] || '5000', 10);
36
+ const limit = parseInt(headers['x-ratelimit-limit'] || '5000', 10);
37
+ const resetTimestamp = parseInt(headers['x-ratelimit-reset'] || '0', 10);
38
+ // Handle invalid values by using defaults
39
+ const safeRemaining = isNaN(remaining) ? 5000 : remaining;
40
+ const safeLimit = isNaN(limit) ? 5000 : limit;
41
+ const safeResetTimestamp = isNaN(resetTimestamp) ? Math.floor(Date.now() / 1000) : resetTimestamp;
42
+ const resetAt = new Date(safeResetTimestamp * 1000).toISOString();
43
+ const resetInSeconds = Math.max(0, safeResetTimestamp - Math.floor(Date.now() / 1000));
44
+ const rateLimitInfo = {
45
+ remaining: safeRemaining,
46
+ limit: safeLimit,
47
+ resetAt,
48
+ resetInSeconds,
49
+ platform: 'github',
50
+ };
51
+ // Cache rate limit info
52
+ this.lastRateLimitInfo.set('github', rateLimitInfo);
53
+ return rateLimitInfo;
54
+ }
55
+ /**
56
+ * Check JIRA rate limit (placeholder - JIRA doesn't expose rate limits in headers)
57
+ *
58
+ * @param headers - HTTP response headers from JIRA API
59
+ * @returns Rate limit information (estimated)
60
+ */
61
+ checkJiraRateLimit(headers) {
62
+ // JIRA Cloud rate limits are not exposed in response headers
63
+ // We estimate based on known limits (10 requests/second for Cloud)
64
+ const rateLimitInfo = {
65
+ remaining: 1000, // Estimate
66
+ limit: 1000,
67
+ resetAt: new Date(Date.now() + 60000).toISOString(), // 1 minute
68
+ resetInSeconds: 60,
69
+ platform: 'jira',
70
+ };
71
+ this.lastRateLimitInfo.set('jira', rateLimitInfo);
72
+ return rateLimitInfo;
73
+ }
74
+ /**
75
+ * Check Azure DevOps rate limit (placeholder - ADO has different rate limit model)
76
+ *
77
+ * @param headers - HTTP response headers from ADO API
78
+ * @returns Rate limit information (estimated)
79
+ */
80
+ checkAdoRateLimit(headers) {
81
+ // Azure DevOps has rate limits but doesn't expose them in headers
82
+ // Default is 200 requests per minute
83
+ const rateLimitInfo = {
84
+ remaining: 200, // Estimate
85
+ limit: 200,
86
+ resetAt: new Date(Date.now() + 60000).toISOString(), // 1 minute
87
+ resetInSeconds: 60,
88
+ platform: 'ado',
89
+ };
90
+ this.lastRateLimitInfo.set('ado', rateLimitInfo);
91
+ return rateLimitInfo;
92
+ }
93
+ /**
94
+ * Wait if rate limit is low
95
+ *
96
+ * @param platform - Platform to check
97
+ * @param onWait - Callback when waiting (receives wait duration in seconds)
98
+ * @returns True if waited, false if no wait needed
99
+ */
100
+ async waitIfNeeded(platform, onWait) {
101
+ const rateLimitInfo = this.lastRateLimitInfo.get(platform);
102
+ if (!rateLimitInfo) {
103
+ return false; // No rate limit info available
104
+ }
105
+ // Check if remaining requests are below pause threshold
106
+ if (rateLimitInfo.remaining < this.thresholds.pauseThreshold) {
107
+ const waitSeconds = this.thresholds.pauseDuration;
108
+ // Notify caller
109
+ if (onWait) {
110
+ onWait(platform, waitSeconds);
111
+ }
112
+ // Wait for specified duration
113
+ await this.sleep(waitSeconds * 1000);
114
+ return true;
115
+ }
116
+ return false;
117
+ }
118
+ /**
119
+ * Check if rate limit warning should be shown
120
+ *
121
+ * @param platform - Platform to check
122
+ * @returns True if remaining requests are below warning threshold
123
+ */
124
+ shouldWarn(platform) {
125
+ const rateLimitInfo = this.lastRateLimitInfo.get(platform);
126
+ if (!rateLimitInfo) {
127
+ return false;
128
+ }
129
+ return rateLimitInfo.remaining < this.thresholds.warningThreshold;
130
+ }
131
+ /**
132
+ * Get last known rate limit info for a platform
133
+ *
134
+ * @param platform - Platform to query
135
+ * @returns Rate limit info or undefined if not cached
136
+ */
137
+ getLastRateLimitInfo(platform) {
138
+ return this.lastRateLimitInfo.get(platform);
139
+ }
140
+ /**
141
+ * Format rate limit warning message
142
+ *
143
+ * @param rateLimitInfo - Rate limit information
144
+ * @returns Formatted warning message
145
+ */
146
+ formatWarning(rateLimitInfo) {
147
+ const platformName = rateLimitInfo.platform.toUpperCase();
148
+ const resetTime = new Date(rateLimitInfo.resetAt).toLocaleTimeString();
149
+ return (`⚠️ ${platformName} rate limit low: ${rateLimitInfo.remaining}/${rateLimitInfo.limit} remaining. ` +
150
+ `Resets at ${resetTime} (in ${rateLimitInfo.resetInSeconds}s).`);
151
+ }
152
+ /**
153
+ * Format pause message
154
+ *
155
+ * @param platform - Platform name
156
+ * @param seconds - Wait duration in seconds
157
+ * @returns Formatted pause message
158
+ */
159
+ formatPauseMessage(platform, seconds) {
160
+ return `⚠️ ${platform.toUpperCase()} rate limit critically low. Waiting ${seconds}s before continuing...`;
161
+ }
162
+ /**
163
+ * Sleep for specified milliseconds
164
+ */
165
+ sleep(ms) {
166
+ return new Promise((resolve) => setTimeout(resolve, ms));
167
+ }
168
+ /**
169
+ * Clear cached rate limit info (useful for testing)
170
+ */
171
+ clearCache() {
172
+ this.lastRateLimitInfo.clear();
173
+ }
174
+ /**
175
+ * Get current thresholds
176
+ */
177
+ getThresholds() {
178
+ return { ...this.thresholds };
179
+ }
180
+ }
181
+ /**
182
+ * Check if a large import should prompt for confirmation
183
+ *
184
+ * @param itemCount - Number of items to import
185
+ * @param threshold - Confirmation threshold (default: 100)
186
+ * @returns True if confirmation should be requested
187
+ */
188
+ export function shouldConfirmLargeImport(itemCount, threshold = 100) {
189
+ return itemCount > threshold;
190
+ }
191
+ /**
192
+ * Format large import confirmation message
193
+ *
194
+ * @param itemCount - Number of items to import
195
+ * @returns Formatted confirmation message
196
+ */
197
+ export function formatLargeImportMessage(itemCount) {
198
+ return `⚠️ Found ${itemCount} items to import. This may take some time. Continue? (Y/n)`;
199
+ }
200
+ //# sourceMappingURL=rate-limiter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limiter.js","sourceRoot":"","sources":["../../../src/importers/rate-limiter.ts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AO,CAAC,CAAC,kBAAkB,EAAE,CAAC;QAEvE,OAAO,CACL,OAAO,YAAY,oBAAoB,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,KAAK,cAAc;YACnG,aAAa,SAAS,QAAQ,aAAa,CAAC,cAAc,KAAK,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,kBAAkB,CAAC,QAAgB,EAAE,OAAe;QAClD,OAAO,OAAO,QAAQ,CAAC,WAAW,EAAE,uCAAuC,OAAO,wBAAwB,CAAC;IAC7G,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,EAAU;QACtB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,SAAiB,EAAE,YAAoB,GAAG;IACjF,OAAO,SAAS,GAAG,SAAS,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,SAAiB;IACxD,OAAO,aAAa,SAAS,4DAA4D,CAAC;AAC5F,CAAC"}
@@ -69,7 +69,7 @@ export declare const ComplianceStandardSchema: z.ZodObject<{
69
69
  name?: string;
70
70
  description?: string;
71
71
  id?: string;
72
- dataTypes?: ("location" | "payment" | "healthcare" | "personal" | "government" | "student" | "financial" | "biometric" | "children" | "sensitive")[];
72
+ dataTypes?: ("personal" | "location" | "payment" | "healthcare" | "government" | "student" | "financial" | "biometric" | "children" | "sensitive")[];
73
73
  regions?: string[];
74
74
  teamImpact?: ("auth-team" | "data-team" | "devsecops-team" | "ciso" | "dpo" | "privacy-engineering" | "payments-team" | "compliance-team")[];
75
75
  costImpact?: string;
@@ -80,7 +80,7 @@ export declare const ComplianceStandardSchema: z.ZodObject<{
80
80
  name?: string;
81
81
  description?: string;
82
82
  id?: string;
83
- dataTypes?: ("location" | "payment" | "healthcare" | "personal" | "government" | "student" | "financial" | "biometric" | "children" | "sensitive")[];
83
+ dataTypes?: ("personal" | "location" | "payment" | "healthcare" | "government" | "student" | "financial" | "biometric" | "children" | "sensitive")[];
84
84
  regions?: string[];
85
85
  teamImpact?: ("auth-team" | "data-team" | "devsecops-team" | "ciso" | "dpo" | "privacy-engineering" | "payments-team" | "compliance-team")[];
86
86
  costImpact?: string;
@@ -77,9 +77,9 @@ export declare const RepositoryMetadataSchema: z.ZodObject<{
77
77
  language?: string;
78
78
  owner?: string;
79
79
  url?: string;
80
+ lastUpdated?: Date;
80
81
  private?: boolean;
81
82
  stars?: number;
82
- lastUpdated?: Date;
83
83
  defaultBranch?: string;
84
84
  }, {
85
85
  name?: string;
@@ -87,9 +87,9 @@ export declare const RepositoryMetadataSchema: z.ZodObject<{
87
87
  language?: string;
88
88
  owner?: string;
89
89
  url?: string;
90
+ lastUpdated?: Date;
90
91
  private?: boolean;
91
92
  stars?: number;
92
- lastUpdated?: Date;
93
93
  defaultBranch?: string;
94
94
  }>;
95
95
  //# sourceMappingURL=types.d.ts.map
@@ -123,5 +123,11 @@ export declare class AdoClient {
123
123
  * Test connection to Azure DevOps
124
124
  */
125
125
  testConnection(): Promise<boolean>;
126
+ /**
127
+ * Add comment to Azure DevOps work item (T-034C)
128
+ *
129
+ * POST /{organization}/{project}/_apis/wit/workitems/{id}/comments?api-version=7.0
130
+ */
131
+ addComment(workItemId: number, comment: string): Promise<void>;
126
132
  }
127
133
  //# sourceMappingURL=ado-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ado-client.d.ts","sourceRoot":"","sources":["../../../../src/integrations/ado/ado-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,MAAM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