specweave 0.28.68 → 0.29.1

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 (318) hide show
  1. package/CLAUDE.md +3 -2
  2. package/README.md +19 -2
  3. package/dist/src/cli/commands/discrepancies.d.ts +89 -0
  4. package/dist/src/cli/commands/discrepancies.d.ts.map +1 -0
  5. package/dist/src/cli/commands/discrepancies.js +385 -0
  6. package/dist/src/cli/commands/discrepancies.js.map +1 -0
  7. package/dist/src/cli/commands/notifications.d.ts +70 -0
  8. package/dist/src/cli/commands/notifications.d.ts.map +1 -0
  9. package/dist/src/cli/commands/notifications.js +236 -0
  10. package/dist/src/cli/commands/notifications.js.map +1 -0
  11. package/dist/src/cli/commands/sync-logs.d.ts +54 -0
  12. package/dist/src/cli/commands/sync-logs.d.ts.map +1 -0
  13. package/dist/src/cli/commands/sync-logs.js +240 -0
  14. package/dist/src/cli/commands/sync-logs.js.map +1 -0
  15. package/dist/src/cli/commands/sync-monitor.d.ts +42 -0
  16. package/dist/src/cli/commands/sync-monitor.d.ts.map +1 -0
  17. package/dist/src/cli/commands/sync-monitor.js +191 -0
  18. package/dist/src/cli/commands/sync-monitor.js.map +1 -0
  19. package/dist/src/cli/helpers/init/brownfield-analysis.d.ts +45 -0
  20. package/dist/src/cli/helpers/init/brownfield-analysis.d.ts.map +1 -0
  21. package/dist/src/cli/helpers/init/brownfield-analysis.js +431 -0
  22. package/dist/src/cli/helpers/init/brownfield-analysis.js.map +1 -0
  23. package/dist/src/cli/helpers/init/index.d.ts +1 -0
  24. package/dist/src/cli/helpers/init/index.d.ts.map +1 -1
  25. package/dist/src/cli/helpers/init/index.js +2 -0
  26. package/dist/src/cli/helpers/init/index.js.map +1 -1
  27. package/dist/src/cli/workers/brownfield-worker.d.ts +66 -0
  28. package/dist/src/cli/workers/brownfield-worker.d.ts.map +1 -0
  29. package/dist/src/cli/workers/brownfield-worker.js +417 -0
  30. package/dist/src/cli/workers/brownfield-worker.js.map +1 -0
  31. package/dist/src/core/background/brownfield-launcher.d.ts +86 -0
  32. package/dist/src/core/background/brownfield-launcher.d.ts.map +1 -0
  33. package/dist/src/core/background/brownfield-launcher.js +295 -0
  34. package/dist/src/core/background/brownfield-launcher.js.map +1 -0
  35. package/dist/src/core/background/index.d.ts +2 -0
  36. package/dist/src/core/background/index.d.ts.map +1 -1
  37. package/dist/src/core/background/index.js +2 -0
  38. package/dist/src/core/background/index.js.map +1 -1
  39. package/dist/src/core/background/types.d.ts +23 -2
  40. package/dist/src/core/background/types.d.ts.map +1 -1
  41. package/dist/src/core/config/index.d.ts +1 -0
  42. package/dist/src/core/config/index.d.ts.map +1 -1
  43. package/dist/src/core/config/index.js +1 -0
  44. package/dist/src/core/config/index.js.map +1 -1
  45. package/dist/src/core/config/types.d.ts +6 -0
  46. package/dist/src/core/config/types.d.ts.map +1 -1
  47. package/dist/src/core/config/types.js.map +1 -1
  48. package/dist/src/core/dashboard/dashboard-data.d.ts +156 -0
  49. package/dist/src/core/dashboard/dashboard-data.d.ts.map +1 -0
  50. package/dist/src/core/dashboard/dashboard-data.js +191 -0
  51. package/dist/src/core/dashboard/dashboard-data.js.map +1 -0
  52. package/dist/src/core/dashboard/index.d.ts +9 -0
  53. package/dist/src/core/dashboard/index.d.ts.map +1 -0
  54. package/dist/src/core/dashboard/index.js +9 -0
  55. package/dist/src/core/dashboard/index.js.map +1 -0
  56. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts +77 -0
  57. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts.map +1 -0
  58. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js +286 -0
  59. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js.map +1 -0
  60. package/dist/src/core/discrepancy/analyzers/index.d.ts +8 -0
  61. package/dist/src/core/discrepancy/analyzers/index.d.ts.map +1 -0
  62. package/dist/src/core/discrepancy/analyzers/index.js +8 -0
  63. package/dist/src/core/discrepancy/analyzers/index.js.map +1 -0
  64. package/dist/src/core/discrepancy/analyzers/typescript-analyzer.d.ts +96 -0
  65. package/dist/src/core/discrepancy/analyzers/typescript-analyzer.d.ts.map +1 -0
  66. package/dist/src/core/discrepancy/analyzers/typescript-analyzer.js +247 -0
  67. package/dist/src/core/discrepancy/analyzers/typescript-analyzer.js.map +1 -0
  68. package/dist/src/core/discrepancy/brownfield-manager.d.ts +88 -0
  69. package/dist/src/core/discrepancy/brownfield-manager.d.ts.map +1 -0
  70. package/dist/src/core/discrepancy/brownfield-manager.js +520 -0
  71. package/dist/src/core/discrepancy/brownfield-manager.js.map +1 -0
  72. package/dist/src/core/discrepancy/brownfield-types.d.ts +174 -0
  73. package/dist/src/core/discrepancy/brownfield-types.d.ts.map +1 -0
  74. package/dist/src/core/discrepancy/brownfield-types.js +11 -0
  75. package/dist/src/core/discrepancy/brownfield-types.js.map +1 -0
  76. package/dist/src/core/discrepancy/detector.d.ts +92 -0
  77. package/dist/src/core/discrepancy/detector.d.ts.map +1 -0
  78. package/dist/src/core/discrepancy/detector.js +346 -0
  79. package/dist/src/core/discrepancy/detector.js.map +1 -0
  80. package/dist/src/core/discrepancy/increment-generator.d.ts +51 -0
  81. package/dist/src/core/discrepancy/increment-generator.d.ts.map +1 -0
  82. package/dist/src/core/discrepancy/increment-generator.js +234 -0
  83. package/dist/src/core/discrepancy/increment-generator.js.map +1 -0
  84. package/dist/src/core/discrepancy/index.d.ts +18 -0
  85. package/dist/src/core/discrepancy/index.d.ts.map +1 -0
  86. package/dist/src/core/discrepancy/index.js +24 -0
  87. package/dist/src/core/discrepancy/index.js.map +1 -0
  88. package/dist/src/core/discrepancy/severity-classifier.d.ts +81 -0
  89. package/dist/src/core/discrepancy/severity-classifier.d.ts.map +1 -0
  90. package/dist/src/core/discrepancy/severity-classifier.js +289 -0
  91. package/dist/src/core/discrepancy/severity-classifier.js.map +1 -0
  92. package/dist/src/core/discrepancy/spec-parser.d.ts +74 -0
  93. package/dist/src/core/discrepancy/spec-parser.d.ts.map +1 -0
  94. package/dist/src/core/discrepancy/spec-parser.js +213 -0
  95. package/dist/src/core/discrepancy/spec-parser.js.map +1 -0
  96. package/dist/src/core/discrepancy/update-recommender.d.ts +77 -0
  97. package/dist/src/core/discrepancy/update-recommender.d.ts.map +1 -0
  98. package/dist/src/core/discrepancy/update-recommender.js +323 -0
  99. package/dist/src/core/discrepancy/update-recommender.js.map +1 -0
  100. package/dist/src/core/living-docs/living-docs-sync.d.ts +13 -16
  101. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  102. package/dist/src/core/living-docs/living-docs-sync.js +31 -112
  103. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  104. package/dist/src/core/logs/index.d.ts +10 -0
  105. package/dist/src/core/logs/index.d.ts.map +1 -0
  106. package/dist/src/core/logs/index.js +10 -0
  107. package/dist/src/core/logs/index.js.map +1 -0
  108. package/dist/src/core/logs/log-aggregator.d.ts +130 -0
  109. package/dist/src/core/logs/log-aggregator.d.ts.map +1 -0
  110. package/dist/src/core/logs/log-aggregator.js +206 -0
  111. package/dist/src/core/logs/log-aggregator.js.map +1 -0
  112. package/dist/src/core/logs/log-exporter.d.ts +81 -0
  113. package/dist/src/core/logs/log-exporter.d.ts.map +1 -0
  114. package/dist/src/core/logs/log-exporter.js +141 -0
  115. package/dist/src/core/logs/log-exporter.js.map +1 -0
  116. package/dist/src/core/notifications/command-integration.d.ts +82 -0
  117. package/dist/src/core/notifications/command-integration.d.ts.map +1 -0
  118. package/dist/src/core/notifications/command-integration.js +80 -0
  119. package/dist/src/core/notifications/command-integration.js.map +1 -0
  120. package/dist/src/core/notifications/index.d.ts +12 -0
  121. package/dist/src/core/notifications/index.d.ts.map +1 -0
  122. package/dist/src/core/notifications/index.js +12 -0
  123. package/dist/src/core/notifications/index.js.map +1 -0
  124. package/dist/src/core/notifications/notification-display.d.ts +70 -0
  125. package/dist/src/core/notifications/notification-display.d.ts.map +1 -0
  126. package/dist/src/core/notifications/notification-display.js +177 -0
  127. package/dist/src/core/notifications/notification-display.js.map +1 -0
  128. package/dist/src/core/notifications/notification-manager.d.ts +126 -0
  129. package/dist/src/core/notifications/notification-manager.d.ts.map +1 -0
  130. package/dist/src/core/notifications/notification-manager.js +287 -0
  131. package/dist/src/core/notifications/notification-manager.js.map +1 -0
  132. package/dist/src/core/notifications/notification-types.d.ts +159 -0
  133. package/dist/src/core/notifications/notification-types.d.ts.map +1 -0
  134. package/dist/src/core/notifications/notification-types.js +93 -0
  135. package/dist/src/core/notifications/notification-types.js.map +1 -0
  136. package/dist/src/core/scheduler/index.d.ts +11 -0
  137. package/dist/src/core/scheduler/index.d.ts.map +1 -0
  138. package/dist/src/core/scheduler/index.js +11 -0
  139. package/dist/src/core/scheduler/index.js.map +1 -0
  140. package/dist/src/core/scheduler/job-scheduler.d.ts +179 -0
  141. package/dist/src/core/scheduler/job-scheduler.d.ts.map +1 -0
  142. package/dist/src/core/scheduler/job-scheduler.js +282 -0
  143. package/dist/src/core/scheduler/job-scheduler.js.map +1 -0
  144. package/dist/src/core/scheduler/schedule-persistence.d.ts +83 -0
  145. package/dist/src/core/scheduler/schedule-persistence.d.ts.map +1 -0
  146. package/dist/src/core/scheduler/schedule-persistence.js +180 -0
  147. package/dist/src/core/scheduler/schedule-persistence.js.map +1 -0
  148. package/dist/src/core/scheduler/scheduled-job.d.ts +188 -0
  149. package/dist/src/core/scheduler/scheduled-job.d.ts.map +1 -0
  150. package/dist/src/core/scheduler/scheduled-job.js +182 -0
  151. package/dist/src/core/scheduler/scheduled-job.js.map +1 -0
  152. package/dist/src/core/sync/permission-enforcer.d.ts +206 -0
  153. package/dist/src/core/sync/permission-enforcer.d.ts.map +1 -0
  154. package/dist/src/core/sync/permission-enforcer.js +268 -0
  155. package/dist/src/core/sync/permission-enforcer.js.map +1 -0
  156. package/dist/src/core/sync/sync-audit-logger.d.ts +217 -0
  157. package/dist/src/core/sync/sync-audit-logger.d.ts.map +1 -0
  158. package/dist/src/core/sync/sync-audit-logger.js +327 -0
  159. package/dist/src/core/sync/sync-audit-logger.js.map +1 -0
  160. package/dist/src/core/sync/sync-interceptor.d.ts +190 -0
  161. package/dist/src/core/sync/sync-interceptor.d.ts.map +1 -0
  162. package/dist/src/core/sync/sync-interceptor.js +224 -0
  163. package/dist/src/core/sync/sync-interceptor.js.map +1 -0
  164. package/dist/src/core/types/increment-metadata.d.ts +5 -2
  165. package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
  166. package/dist/src/core/types/sync-config.d.ts +267 -0
  167. package/dist/src/core/types/sync-config.d.ts.map +1 -0
  168. package/dist/src/core/types/sync-config.js +304 -0
  169. package/dist/src/core/types/sync-config.js.map +1 -0
  170. package/dist/src/hooks/index.d.ts +11 -0
  171. package/dist/src/hooks/index.d.ts.map +1 -0
  172. package/dist/src/hooks/index.js +11 -0
  173. package/dist/src/hooks/index.js.map +1 -0
  174. package/dist/src/hooks/platform.d.ts +125 -0
  175. package/dist/src/hooks/platform.d.ts.map +1 -0
  176. package/dist/src/hooks/platform.js +325 -0
  177. package/dist/src/hooks/platform.js.map +1 -0
  178. package/dist/src/hooks/processor.d.ts +20 -0
  179. package/dist/src/hooks/processor.d.ts.map +1 -0
  180. package/dist/src/hooks/processor.js +317 -0
  181. package/dist/src/hooks/processor.js.map +1 -0
  182. package/dist/src/hooks/scheduler-startup.d.ts +19 -0
  183. package/dist/src/hooks/scheduler-startup.d.ts.map +1 -0
  184. package/dist/src/hooks/scheduler-startup.js +92 -0
  185. package/dist/src/hooks/scheduler-startup.js.map +1 -0
  186. package/dist/src/hooks/session-start.d.ts +16 -0
  187. package/dist/src/hooks/session-start.d.ts.map +1 -0
  188. package/dist/src/hooks/session-start.js +92 -0
  189. package/dist/src/hooks/session-start.js.map +1 -0
  190. package/dist/src/importers/duplicate-detector.d.ts +13 -2
  191. package/dist/src/importers/duplicate-detector.d.ts.map +1 -1
  192. package/dist/src/importers/duplicate-detector.js +21 -2
  193. package/dist/src/importers/duplicate-detector.js.map +1 -1
  194. package/dist/src/importers/item-converter.d.ts +41 -2
  195. package/dist/src/importers/item-converter.d.ts.map +1 -1
  196. package/dist/src/importers/item-converter.js +225 -38
  197. package/dist/src/importers/item-converter.js.map +1 -1
  198. package/dist/src/living-docs/fs-id-allocator.d.ts +7 -0
  199. package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -1
  200. package/dist/src/living-docs/fs-id-allocator.js +30 -4
  201. package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
  202. package/dist/src/sync/ado-sync-wrapper.d.ts +137 -0
  203. package/dist/src/sync/ado-sync-wrapper.d.ts.map +1 -0
  204. package/dist/src/sync/ado-sync-wrapper.js +148 -0
  205. package/dist/src/sync/ado-sync-wrapper.js.map +1 -0
  206. package/dist/src/sync/github-sync-wrapper.d.ts +195 -0
  207. package/dist/src/sync/github-sync-wrapper.d.ts.map +1 -0
  208. package/dist/src/sync/github-sync-wrapper.js +220 -0
  209. package/dist/src/sync/github-sync-wrapper.js.map +1 -0
  210. package/dist/src/sync/jira-sync-wrapper.d.ts +155 -0
  211. package/dist/src/sync/jira-sync-wrapper.d.ts.map +1 -0
  212. package/dist/src/sync/jira-sync-wrapper.js +175 -0
  213. package/dist/src/sync/jira-sync-wrapper.js.map +1 -0
  214. package/dist/src/utils/feature-id-derivation.d.ts +58 -0
  215. package/dist/src/utils/feature-id-derivation.d.ts.map +1 -0
  216. package/dist/src/utils/feature-id-derivation.js +77 -0
  217. package/dist/src/utils/feature-id-derivation.js.map +1 -0
  218. package/package.json +3 -1
  219. package/plugins/specweave/commands/specweave-discrepancies.md +141 -0
  220. package/plugins/specweave/commands/specweave-discrepancy-to-increment.md +160 -0
  221. package/plugins/specweave/commands/specweave-jobs.md +45 -2
  222. package/plugins/specweave/commands/specweave-notifications.md +92 -0
  223. package/plugins/specweave/commands/specweave-sync-logs.md +131 -0
  224. package/plugins/specweave/commands/specweave-sync-monitor.md +57 -0
  225. package/plugins/specweave/hooks/hooks.json +3 -3
  226. package/plugins/specweave/hooks/lib/scheduler-startup.sh +72 -0
  227. package/plugins/specweave/hooks/universal/dispatcher.mjs +246 -0
  228. package/plugins/specweave/hooks/universal/session-start.cmd +16 -0
  229. package/plugins/specweave/hooks/universal/session-start.ps1 +16 -0
  230. package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +14 -5
  231. package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +5 -2
  232. package/plugins/specweave/skills/discrepancy-viewer.md +154 -0
  233. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +46 -0
  234. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +69 -0
  235. package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts +0 -26
  236. package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts.map +0 -1
  237. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +0 -249
  238. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +0 -1
  239. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts +0 -28
  240. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +0 -1
  241. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -156
  242. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +0 -1
  243. package/dist/src/core/sync/bidirectional-engine.d.ts +0 -119
  244. package/dist/src/core/sync/bidirectional-engine.d.ts.map +0 -1
  245. package/dist/src/core/sync/bidirectional-engine.js +0 -359
  246. package/dist/src/core/sync/bidirectional-engine.js.map +0 -1
  247. package/dist/src/core/sync/conflict-resolver.d.ts +0 -66
  248. package/dist/src/core/sync/conflict-resolver.d.ts.map +0 -1
  249. package/dist/src/core/sync/conflict-resolver.js +0 -108
  250. package/dist/src/core/sync/conflict-resolver.js.map +0 -1
  251. package/dist/src/core/sync/enhanced-content-builder.d.ts +0 -55
  252. package/dist/src/core/sync/enhanced-content-builder.d.ts.map +0 -1
  253. package/dist/src/core/sync/enhanced-content-builder.js +0 -203
  254. package/dist/src/core/sync/enhanced-content-builder.js.map +0 -1
  255. package/dist/src/core/sync/folder-mapper.d.ts +0 -71
  256. package/dist/src/core/sync/folder-mapper.d.ts.map +0 -1
  257. package/dist/src/core/sync/folder-mapper.js +0 -203
  258. package/dist/src/core/sync/folder-mapper.js.map +0 -1
  259. package/dist/src/core/sync/label-detector.d.ts +0 -66
  260. package/dist/src/core/sync/label-detector.d.ts.map +0 -1
  261. package/dist/src/core/sync/label-detector.js +0 -224
  262. package/dist/src/core/sync/label-detector.js.map +0 -1
  263. package/dist/src/core/sync/performance-optimizer.d.ts +0 -153
  264. package/dist/src/core/sync/performance-optimizer.d.ts.map +0 -1
  265. package/dist/src/core/sync/performance-optimizer.js +0 -220
  266. package/dist/src/core/sync/performance-optimizer.js.map +0 -1
  267. package/dist/src/core/sync/profile-selector.d.ts +0 -52
  268. package/dist/src/core/sync/profile-selector.d.ts.map +0 -1
  269. package/dist/src/core/sync/profile-selector.js +0 -179
  270. package/dist/src/core/sync/profile-selector.js.map +0 -1
  271. package/dist/src/core/sync/profile-validator.d.ts +0 -52
  272. package/dist/src/core/sync/profile-validator.d.ts.map +0 -1
  273. package/dist/src/core/sync/profile-validator.js +0 -170
  274. package/dist/src/core/sync/profile-validator.js.map +0 -1
  275. package/dist/src/core/sync/rate-limiter.d.ts +0 -116
  276. package/dist/src/core/sync/rate-limiter.d.ts.map +0 -1
  277. package/dist/src/core/sync/rate-limiter.js +0 -308
  278. package/dist/src/core/sync/rate-limiter.js.map +0 -1
  279. package/dist/src/core/sync/retry-handler.d.ts +0 -98
  280. package/dist/src/core/sync/retry-handler.d.ts.map +0 -1
  281. package/dist/src/core/sync/retry-handler.js +0 -196
  282. package/dist/src/core/sync/retry-handler.js.map +0 -1
  283. package/dist/src/core/sync/retry-logic.d.ts +0 -64
  284. package/dist/src/core/sync/retry-logic.d.ts.map +0 -1
  285. package/dist/src/core/sync/retry-logic.js +0 -165
  286. package/dist/src/core/sync/retry-logic.js.map +0 -1
  287. package/dist/src/core/sync/status-cache.d.ts +0 -91
  288. package/dist/src/core/sync/status-cache.d.ts.map +0 -1
  289. package/dist/src/core/sync/status-cache.js +0 -140
  290. package/dist/src/core/sync/status-cache.js.map +0 -1
  291. package/dist/src/core/sync/status-mapper.d.ts +0 -69
  292. package/dist/src/core/sync/status-mapper.d.ts.map +0 -1
  293. package/dist/src/core/sync/status-mapper.js +0 -90
  294. package/dist/src/core/sync/status-mapper.js.map +0 -1
  295. package/dist/src/core/sync/status-sync-engine.d.ts +0 -162
  296. package/dist/src/core/sync/status-sync-engine.d.ts.map +0 -1
  297. package/dist/src/core/sync/status-sync-engine.js +0 -347
  298. package/dist/src/core/sync/status-sync-engine.js.map +0 -1
  299. package/dist/src/core/sync/sync-event-logger.d.ts +0 -113
  300. package/dist/src/core/sync/sync-event-logger.d.ts.map +0 -1
  301. package/dist/src/core/sync/sync-event-logger.js +0 -141
  302. package/dist/src/core/sync/sync-event-logger.js.map +0 -1
  303. package/dist/src/core/sync/time-range-selector.d.ts +0 -48
  304. package/dist/src/core/sync/time-range-selector.d.ts.map +0 -1
  305. package/dist/src/core/sync/time-range-selector.js +0 -224
  306. package/dist/src/core/sync/time-range-selector.js.map +0 -1
  307. package/dist/src/core/sync/types.d.ts +0 -52
  308. package/dist/src/core/sync/types.d.ts.map +0 -1
  309. package/dist/src/core/sync/types.js +0 -5
  310. package/dist/src/core/sync/types.js.map +0 -1
  311. package/dist/src/core/sync/workflow-detector.d.ts +0 -95
  312. package/dist/src/core/sync/workflow-detector.d.ts.map +0 -1
  313. package/dist/src/core/sync/workflow-detector.js +0 -175
  314. package/dist/src/core/sync/workflow-detector.js.map +0 -1
  315. package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -220
  316. package/plugins/specweave-github/lib/enhanced-github-sync.ts +0 -322
  317. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -134
  318. package/plugins/specweave-jira/lib/enhanced-jira-sync.ts +0 -196
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Cross-Platform Hook Utilities
3
+ *
4
+ * Provides platform detection and process spawning for Windows, macOS, and Linux.
5
+ * Optimized for hook execution with minimal overhead.
6
+ *
7
+ * @module hooks/platform
8
+ */
9
+ import { SpawnOptions, ChildProcess } from 'child_process';
10
+ /**
11
+ * Platform types
12
+ */
13
+ export type Platform = 'windows' | 'macos' | 'linux' | 'unknown';
14
+ /**
15
+ * WSL availability status
16
+ */
17
+ export interface WslStatus {
18
+ available: boolean;
19
+ version?: 1 | 2;
20
+ defaultDistro?: string;
21
+ }
22
+ /**
23
+ * Get normalized platform identifier
24
+ */
25
+ export declare function getPlatform(): Platform;
26
+ /**
27
+ * Check if running on Windows
28
+ */
29
+ export declare function isWindows(): boolean;
30
+ /**
31
+ * Check if running on POSIX system (macOS, Linux)
32
+ */
33
+ export declare function isPosix(): boolean;
34
+ export declare function checkWslStatus(): WslStatus;
35
+ /**
36
+ * Find project root by looking for .specweave directory
37
+ *
38
+ * @param startDir - Directory to start searching from
39
+ * @returns Project root path or null if not found
40
+ */
41
+ export declare function findProjectRoot(startDir?: string): string | null;
42
+ /**
43
+ * Spawn a detached background process (cross-platform)
44
+ *
45
+ * On Windows: Uses 'start' command or direct spawn with detached option
46
+ * On POSIX: Uses spawn with detached + unref
47
+ *
48
+ * @param command - Command to run
49
+ * @param args - Arguments
50
+ * @param options - Spawn options
51
+ * @returns ChildProcess or null if spawn failed
52
+ */
53
+ export declare function spawnDetached(command: string, args?: string[], options?: SpawnOptions): ChildProcess | null;
54
+ /**
55
+ * Spawn Node.js script in background (cross-platform)
56
+ *
57
+ * Optimized for spawning Node.js scripts as background daemons.
58
+ *
59
+ * @param scriptPath - Path to the Node.js script
60
+ * @param args - Arguments to pass to the script
61
+ * @param cwd - Working directory
62
+ * @returns ChildProcess or null if spawn failed
63
+ */
64
+ export declare function spawnNodeBackground(scriptPath: string, args?: string[], cwd?: string): ChildProcess | null;
65
+ /**
66
+ * Read JSON file safely with error handling
67
+ *
68
+ * @param filePath - Path to JSON file
69
+ * @returns Parsed JSON or null if failed
70
+ */
71
+ export declare function readJsonSafe<T = unknown>(filePath: string): T | null;
72
+ /**
73
+ * Write JSON file safely with atomic write
74
+ *
75
+ * @param filePath - Path to JSON file
76
+ * @param data - Data to write
77
+ * @returns true if successful, false otherwise
78
+ */
79
+ export declare function writeJsonSafe(filePath: string, data: unknown): boolean;
80
+ /**
81
+ * Append to log file (creates directory if needed)
82
+ *
83
+ * @param logPath - Path to log file
84
+ * @param message - Message to append
85
+ */
86
+ export declare function appendLog(logPath: string, message: string): void;
87
+ /**
88
+ * Cross-platform file locking using directory creation
89
+ *
90
+ * mkdir is atomic on all platforms (Windows, macOS, Linux)
91
+ */
92
+ export declare class FileLock {
93
+ private lockDir;
94
+ private pidFile;
95
+ private acquired;
96
+ constructor(lockPath: string);
97
+ /**
98
+ * Try to acquire lock
99
+ *
100
+ * @param staleLockSeconds - Consider lock stale after this many seconds
101
+ * @returns true if lock acquired, false if held by another process
102
+ */
103
+ acquire(staleLockSeconds?: number): boolean;
104
+ /**
105
+ * Release the lock
106
+ */
107
+ release(): void;
108
+ }
109
+ /**
110
+ * Hook result interface (matches Claude Code hook protocol)
111
+ */
112
+ export interface HookResult {
113
+ continue: boolean;
114
+ systemMessage?: string;
115
+ error?: string;
116
+ }
117
+ /**
118
+ * Output hook result to stdout
119
+ */
120
+ export declare function outputHookResult(result: HookResult): void;
121
+ /**
122
+ * Consume stdin (required for hooks that receive input)
123
+ */
124
+ export declare function consumeStdin(): Promise<string>;
125
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../src/hooks/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAS,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAEjE;;GAEG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IACH,OAAO,CAAC,gBAAgB,SAAM,GAAG,OAAO;IA2CxC;;OAEG;IACH,OAAO,IAAI,IAAI;CAUhB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAEzD;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAepD"}
@@ -0,0 +1,325 @@
1
+ /**
2
+ * Cross-Platform Hook Utilities
3
+ *
4
+ * Provides platform detection and process spawning for Windows, macOS, and Linux.
5
+ * Optimized for hook execution with minimal overhead.
6
+ *
7
+ * @module hooks/platform
8
+ */
9
+ import { spawn } from 'child_process';
10
+ import * as fs from 'fs';
11
+ import * as path from 'path';
12
+ /**
13
+ * Cached platform info (computed once at module load)
14
+ */
15
+ const platformInfo = {
16
+ platform: process.platform,
17
+ isWindows: process.platform === 'win32',
18
+ isMacOS: process.platform === 'darwin',
19
+ isLinux: process.platform === 'linux',
20
+ isPosix: process.platform !== 'win32',
21
+ };
22
+ /**
23
+ * Get normalized platform identifier
24
+ */
25
+ export function getPlatform() {
26
+ if (platformInfo.isWindows)
27
+ return 'windows';
28
+ if (platformInfo.isMacOS)
29
+ return 'macos';
30
+ if (platformInfo.isLinux)
31
+ return 'linux';
32
+ return 'unknown';
33
+ }
34
+ /**
35
+ * Check if running on Windows
36
+ */
37
+ export function isWindows() {
38
+ return platformInfo.isWindows;
39
+ }
40
+ /**
41
+ * Check if running on POSIX system (macOS, Linux)
42
+ */
43
+ export function isPosix() {
44
+ return platformInfo.isPosix;
45
+ }
46
+ /**
47
+ * Check WSL availability on Windows
48
+ *
49
+ * Checks for WSL installation without requiring it.
50
+ * Returns cached result for performance.
51
+ */
52
+ let wslStatusCache = null;
53
+ export function checkWslStatus() {
54
+ if (wslStatusCache !== null) {
55
+ return wslStatusCache;
56
+ }
57
+ if (!platformInfo.isWindows) {
58
+ wslStatusCache = { available: false };
59
+ return wslStatusCache;
60
+ }
61
+ try {
62
+ // Check if wsl.exe exists
63
+ const wslPath = path.join(process.env.SYSTEMROOT || 'C:\\Windows', 'System32', 'wsl.exe');
64
+ if (!fs.existsSync(wslPath)) {
65
+ wslStatusCache = { available: false };
66
+ return wslStatusCache;
67
+ }
68
+ // WSL exists - we could check version but keep it simple for now
69
+ wslStatusCache = { available: true };
70
+ return wslStatusCache;
71
+ }
72
+ catch {
73
+ wslStatusCache = { available: false };
74
+ return wslStatusCache;
75
+ }
76
+ }
77
+ /**
78
+ * Find project root by looking for .specweave directory
79
+ *
80
+ * @param startDir - Directory to start searching from
81
+ * @returns Project root path or null if not found
82
+ */
83
+ export function findProjectRoot(startDir = process.cwd()) {
84
+ let current = path.resolve(startDir);
85
+ const root = path.parse(current).root;
86
+ while (current !== root) {
87
+ const specweavePath = path.join(current, '.specweave');
88
+ if (fs.existsSync(specweavePath) && fs.statSync(specweavePath).isDirectory()) {
89
+ return current;
90
+ }
91
+ current = path.dirname(current);
92
+ }
93
+ return null;
94
+ }
95
+ /**
96
+ * Spawn a detached background process (cross-platform)
97
+ *
98
+ * On Windows: Uses 'start' command or direct spawn with detached option
99
+ * On POSIX: Uses spawn with detached + unref
100
+ *
101
+ * @param command - Command to run
102
+ * @param args - Arguments
103
+ * @param options - Spawn options
104
+ * @returns ChildProcess or null if spawn failed
105
+ */
106
+ export function spawnDetached(command, args = [], options = {}) {
107
+ try {
108
+ const spawnOptions = {
109
+ ...options,
110
+ detached: true,
111
+ stdio: 'ignore',
112
+ windowsHide: true,
113
+ };
114
+ // Direct spawn with detached + windowsHide works on all platforms
115
+ // On Windows: windowsHide prevents console window, detached allows orphaning
116
+ // On POSIX: detached creates new process group, unref allows parent to exit
117
+ // NOTE: Previously used cmd.exe /c start /b on Windows, but that has
118
+ // argument escaping issues and loses exit codes. Direct spawn is more reliable.
119
+ const child = spawn(command, args, spawnOptions);
120
+ child.unref();
121
+ return child;
122
+ }
123
+ catch {
124
+ return null;
125
+ }
126
+ }
127
+ /**
128
+ * Spawn Node.js script in background (cross-platform)
129
+ *
130
+ * Optimized for spawning Node.js scripts as background daemons.
131
+ *
132
+ * @param scriptPath - Path to the Node.js script
133
+ * @param args - Arguments to pass to the script
134
+ * @param cwd - Working directory
135
+ * @returns ChildProcess or null if spawn failed
136
+ */
137
+ export function spawnNodeBackground(scriptPath, args = [], cwd) {
138
+ const nodeExecutable = process.execPath; // Use same Node.js that's running this script
139
+ try {
140
+ const spawnOptions = {
141
+ cwd: cwd || process.cwd(),
142
+ detached: true,
143
+ stdio: 'ignore',
144
+ windowsHide: true,
145
+ env: {
146
+ ...process.env,
147
+ SPECWEAVE_BACKGROUND_PROCESS: '1',
148
+ },
149
+ };
150
+ if (platformInfo.isWindows) {
151
+ // On Windows, spawn node directly with detached
152
+ // The windowsHide option prevents console window
153
+ const child = spawn(nodeExecutable, [scriptPath, ...args], spawnOptions);
154
+ child.unref();
155
+ return child;
156
+ }
157
+ else {
158
+ // On POSIX, standard detached spawn
159
+ const child = spawn(nodeExecutable, [scriptPath, ...args], spawnOptions);
160
+ child.unref();
161
+ return child;
162
+ }
163
+ }
164
+ catch {
165
+ return null;
166
+ }
167
+ }
168
+ /**
169
+ * Read JSON file safely with error handling
170
+ *
171
+ * @param filePath - Path to JSON file
172
+ * @returns Parsed JSON or null if failed
173
+ */
174
+ export function readJsonSafe(filePath) {
175
+ try {
176
+ if (!fs.existsSync(filePath)) {
177
+ return null;
178
+ }
179
+ const content = fs.readFileSync(filePath, 'utf-8');
180
+ return JSON.parse(content);
181
+ }
182
+ catch {
183
+ return null;
184
+ }
185
+ }
186
+ /**
187
+ * Write JSON file safely with atomic write
188
+ *
189
+ * @param filePath - Path to JSON file
190
+ * @param data - Data to write
191
+ * @returns true if successful, false otherwise
192
+ */
193
+ export function writeJsonSafe(filePath, data) {
194
+ try {
195
+ const dir = path.dirname(filePath);
196
+ if (!fs.existsSync(dir)) {
197
+ fs.mkdirSync(dir, { recursive: true });
198
+ }
199
+ // Atomic write: write to temp file, then rename
200
+ const tempPath = `${filePath}.tmp.${process.pid}`;
201
+ fs.writeFileSync(tempPath, JSON.stringify(data, null, 2), 'utf-8');
202
+ fs.renameSync(tempPath, filePath);
203
+ return true;
204
+ }
205
+ catch {
206
+ return false;
207
+ }
208
+ }
209
+ /**
210
+ * Append to log file (creates directory if needed)
211
+ *
212
+ * @param logPath - Path to log file
213
+ * @param message - Message to append
214
+ */
215
+ export function appendLog(logPath, message) {
216
+ try {
217
+ const dir = path.dirname(logPath);
218
+ if (!fs.existsSync(dir)) {
219
+ fs.mkdirSync(dir, { recursive: true });
220
+ }
221
+ const timestamp = new Date().toISOString().substring(11, 19); // HH:MM:SS
222
+ fs.appendFileSync(logPath, `[${timestamp}] ${message}\n`, 'utf-8');
223
+ }
224
+ catch {
225
+ // Silently ignore log failures
226
+ }
227
+ }
228
+ /**
229
+ * Cross-platform file locking using directory creation
230
+ *
231
+ * mkdir is atomic on all platforms (Windows, macOS, Linux)
232
+ */
233
+ export class FileLock {
234
+ constructor(lockPath) {
235
+ this.acquired = false;
236
+ this.lockDir = lockPath + '.lock.d';
237
+ this.pidFile = path.join(this.lockDir, 'pid');
238
+ }
239
+ /**
240
+ * Try to acquire lock
241
+ *
242
+ * @param staleLockSeconds - Consider lock stale after this many seconds
243
+ * @returns true if lock acquired, false if held by another process
244
+ */
245
+ acquire(staleLockSeconds = 300) {
246
+ try {
247
+ // Try atomic mkdir
248
+ fs.mkdirSync(this.lockDir);
249
+ fs.writeFileSync(this.pidFile, String(process.pid), 'utf-8');
250
+ this.acquired = true;
251
+ return true;
252
+ }
253
+ catch (err) {
254
+ if (err.code !== 'EEXIST') {
255
+ return false;
256
+ }
257
+ // Lock exists - check if stale
258
+ try {
259
+ const lockPid = parseInt(fs.readFileSync(this.pidFile, 'utf-8').trim(), 10);
260
+ // Check if process is still running
261
+ if (!isNaN(lockPid)) {
262
+ try {
263
+ process.kill(lockPid, 0); // Signal 0 just checks existence
264
+ return false; // Process is running, lock is valid
265
+ }
266
+ catch {
267
+ // Process not running, check age
268
+ }
269
+ }
270
+ // Check lock age
271
+ const stat = fs.statSync(this.pidFile);
272
+ const ageSeconds = (Date.now() - stat.mtimeMs) / 1000;
273
+ if (ageSeconds > staleLockSeconds) {
274
+ // Stale lock - remove and retry
275
+ fs.rmSync(this.lockDir, { recursive: true, force: true });
276
+ return this.acquire(staleLockSeconds);
277
+ }
278
+ return false;
279
+ }
280
+ catch {
281
+ return false;
282
+ }
283
+ }
284
+ }
285
+ /**
286
+ * Release the lock
287
+ */
288
+ release() {
289
+ if (this.acquired) {
290
+ try {
291
+ fs.rmSync(this.lockDir, { recursive: true, force: true });
292
+ }
293
+ catch {
294
+ // Ignore cleanup errors
295
+ }
296
+ this.acquired = false;
297
+ }
298
+ }
299
+ }
300
+ /**
301
+ * Output hook result to stdout
302
+ */
303
+ export function outputHookResult(result) {
304
+ console.log(JSON.stringify(result));
305
+ }
306
+ /**
307
+ * Consume stdin (required for hooks that receive input)
308
+ */
309
+ export async function consumeStdin() {
310
+ return new Promise((resolve) => {
311
+ let data = '';
312
+ process.stdin.setEncoding('utf-8');
313
+ process.stdin.on('data', (chunk) => {
314
+ data += chunk;
315
+ });
316
+ process.stdin.on('end', () => {
317
+ resolve(data);
318
+ });
319
+ // Handle case where stdin is empty/closed
320
+ if (process.stdin.isTTY) {
321
+ resolve('');
322
+ }
323
+ });
324
+ }
325
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../../src/hooks/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAA8B,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,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jD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YACjC,IAAI,IAAI,KAAK,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,0CAA0C;QAC1C,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACxB,OAAO,CAAC,EAAE,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Background Event Processor (Cross-Platform)
4
+ *
5
+ * Processes queued events asynchronously, routes to specialized handlers.
6
+ * Works on Windows, macOS, and Linux without WSL requirement.
7
+ *
8
+ * Usage: node processor.js [--daemon]
9
+ *
10
+ * Event routing:
11
+ * - increment.created/done/archived/reopened -> living-specs-handler
12
+ * - user-story.completed/reopened -> status-line-handler
13
+ * - task.updated/spec.updated -> living-docs-handler (legacy)
14
+ *
15
+ * Self-terminates after 60s of idle
16
+ *
17
+ * @module hooks/processor
18
+ */
19
+ export {};
20
+ //# sourceMappingURL=processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../../src/hooks/processor.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG"}