specweave 0.28.19 → 0.28.22

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 (96) hide show
  1. package/dist/plugins/specweave-ado/lib/ado-spec-sync.d.ts +16 -0
  2. package/dist/plugins/specweave-ado/lib/ado-spec-sync.d.ts.map +1 -1
  3. package/dist/plugins/specweave-ado/lib/ado-spec-sync.js +63 -3
  4. package/dist/plugins/specweave-ado/lib/ado-spec-sync.js.map +1 -1
  5. package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts +12 -3
  6. package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts.map +1 -1
  7. package/dist/plugins/specweave-ado/lib/ado-status-sync.js +37 -3
  8. package/dist/plugins/specweave-ado/lib/ado-status-sync.js.map +1 -1
  9. package/dist/plugins/specweave-github/lib/github-increment-sync-cli.d.ts +8 -6
  10. package/dist/plugins/specweave-github/lib/github-increment-sync-cli.d.ts.map +1 -1
  11. package/dist/plugins/specweave-github/lib/github-increment-sync-cli.js +230 -165
  12. package/dist/plugins/specweave-github/lib/github-increment-sync-cli.js.map +1 -1
  13. package/dist/plugins/specweave-github/lib/github-status-sync.d.ts +10 -0
  14. package/dist/plugins/specweave-github/lib/github-status-sync.d.ts.map +1 -1
  15. package/dist/plugins/specweave-github/lib/github-status-sync.js +40 -2
  16. package/dist/plugins/specweave-github/lib/github-status-sync.js.map +1 -1
  17. package/dist/plugins/specweave-github/lib/increment-issue-builder.d.ts +2 -0
  18. package/dist/plugins/specweave-github/lib/increment-issue-builder.d.ts.map +1 -1
  19. package/dist/plugins/specweave-github/lib/increment-issue-builder.js +25 -5
  20. package/dist/plugins/specweave-github/lib/increment-issue-builder.js.map +1 -1
  21. package/dist/plugins/specweave-jira/lib/jira-spec-sync.d.ts +12 -0
  22. package/dist/plugins/specweave-jira/lib/jira-spec-sync.d.ts.map +1 -1
  23. package/dist/plugins/specweave-jira/lib/jira-spec-sync.js +57 -5
  24. package/dist/plugins/specweave-jira/lib/jira-spec-sync.js.map +1 -1
  25. package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts +5 -1
  26. package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts.map +1 -1
  27. package/dist/plugins/specweave-jira/lib/jira-status-sync.js +12 -4
  28. package/dist/plugins/specweave-jira/lib/jira-status-sync.js.map +1 -1
  29. package/dist/src/cli/commands/init.d.ts.map +1 -1
  30. package/dist/src/cli/commands/init.js +7 -3
  31. package/dist/src/cli/commands/init.js.map +1 -1
  32. package/dist/src/cli/helpers/init/external-import.d.ts.map +1 -1
  33. package/dist/src/cli/helpers/init/external-import.js +193 -23
  34. package/dist/src/cli/helpers/init/external-import.js.map +1 -1
  35. package/dist/src/cli/helpers/init/jira-ado-auto-detect.d.ts +115 -0
  36. package/dist/src/cli/helpers/init/jira-ado-auto-detect.d.ts.map +1 -0
  37. package/dist/src/cli/helpers/init/jira-ado-auto-detect.js +590 -0
  38. package/dist/src/cli/helpers/init/jira-ado-auto-detect.js.map +1 -0
  39. package/dist/src/cli/helpers/init/language-selection.js +1 -1
  40. package/dist/src/cli/helpers/init/language-selection.js.map +1 -1
  41. package/dist/src/cli/helpers/init/repository-setup.js +1 -1
  42. package/dist/src/cli/helpers/init/repository-setup.js.map +1 -1
  43. package/dist/src/config/types.d.ts +6 -6
  44. package/dist/src/core/background/index.d.ts +11 -0
  45. package/dist/src/core/background/index.d.ts.map +1 -0
  46. package/dist/src/core/background/index.js +11 -0
  47. package/dist/src/core/background/index.js.map +1 -0
  48. package/dist/src/core/background/job-manager.d.ts +65 -0
  49. package/dist/src/core/background/job-manager.d.ts.map +1 -0
  50. package/dist/src/core/background/job-manager.js +192 -0
  51. package/dist/src/core/background/job-manager.js.map +1 -0
  52. package/dist/src/core/background/types.d.ts +59 -0
  53. package/dist/src/core/background/types.d.ts.map +1 -0
  54. package/dist/src/core/background/types.js +8 -0
  55. package/dist/src/core/background/types.js.map +1 -0
  56. package/dist/src/core/repo-structure/multi-repo-configurator.d.ts +25 -0
  57. package/dist/src/core/repo-structure/multi-repo-configurator.d.ts.map +1 -0
  58. package/dist/src/core/repo-structure/multi-repo-configurator.js +614 -0
  59. package/dist/src/core/repo-structure/multi-repo-configurator.js.map +1 -0
  60. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  61. package/dist/src/core/repo-structure/prompt-consolidator.js +6 -36
  62. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  63. package/dist/src/core/repo-structure/repo-initializer.d.ts +40 -0
  64. package/dist/src/core/repo-structure/repo-initializer.d.ts.map +1 -0
  65. package/dist/src/core/repo-structure/repo-initializer.js +260 -0
  66. package/dist/src/core/repo-structure/repo-initializer.js.map +1 -0
  67. package/dist/src/core/repo-structure/repo-structure-manager.d.ts +3 -37
  68. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  69. package/dist/src/core/repo-structure/repo-structure-manager.js +23 -803
  70. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  71. package/dist/src/core/types/spec-metadata.d.ts +2 -0
  72. package/dist/src/core/types/spec-metadata.d.ts.map +1 -1
  73. package/dist/src/importers/import-coordinator.d.ts +20 -0
  74. package/dist/src/importers/import-coordinator.d.ts.map +1 -1
  75. package/dist/src/importers/import-coordinator.js.map +1 -1
  76. package/dist/src/init/architecture/types.d.ts +2 -2
  77. package/dist/src/init/compliance/types.d.ts +1 -1
  78. package/package.json +1 -1
  79. package/plugins/specweave/commands/specweave-jobs.md +160 -0
  80. package/plugins/specweave-ado/lib/ado-spec-sync.js +59 -3
  81. package/plugins/specweave-ado/lib/ado-spec-sync.ts +72 -3
  82. package/plugins/specweave-ado/lib/ado-status-sync.js +35 -3
  83. package/plugins/specweave-ado/lib/ado-status-sync.ts +48 -4
  84. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +6 -0
  85. package/plugins/specweave-github/lib/github-increment-sync-cli.js +268 -155
  86. package/plugins/specweave-github/lib/github-increment-sync-cli.ts +313 -209
  87. package/plugins/specweave-github/lib/github-status-sync.js +37 -1
  88. package/plugins/specweave-github/lib/github-status-sync.ts +60 -4
  89. package/plugins/specweave-github/lib/increment-issue-builder.js +26 -5
  90. package/plugins/specweave-github/lib/increment-issue-builder.ts +36 -5
  91. package/plugins/specweave-jira/lib/jira-spec-sync.js +53 -5
  92. package/plugins/specweave-jira/lib/jira-spec-sync.ts +87 -7
  93. package/plugins/specweave-jira/lib/jira-status-sync.js +9 -3
  94. package/plugins/specweave-jira/lib/jira-status-sync.ts +15 -6
  95. package/plugins/specweave-release/commands/specweave-release-npm.md +187 -8
  96. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +9 -0
@@ -223,6 +223,9 @@ export class AdoSpecSync {
223
223
  const featureDescription = this.generateFeatureDescription(spec);
224
224
  const tags = [`spec:${spec.metadata.id}`, `priority:${spec.metadata.priority}`].join('; ');
225
225
 
226
+ // Determine work item type (supports Bug for bug-type specs)
227
+ const workItemType = this.mapTypeToAdo(spec.metadata.type, 'Feature');
228
+
226
229
  const payload = [
227
230
  {
228
231
  op: 'add',
@@ -237,12 +240,18 @@ export class AdoSpecSync {
237
240
  {
238
241
  op: 'add',
239
242
  path: '/fields/System.WorkItemType',
240
- value: 'Feature'
243
+ value: workItemType
241
244
  },
242
245
  {
243
246
  op: 'add',
244
247
  path: '/fields/System.Tags',
245
248
  value: tags
249
+ },
250
+ {
251
+ // Set native ADO Priority field (P0→1, P1→2, P2→3, P3→4)
252
+ op: 'add',
253
+ path: '/fields/Microsoft.VSTS.Common.Priority',
254
+ value: this.mapPriorityToAdo(spec.metadata.priority)
246
255
  }
247
256
  ];
248
257
 
@@ -335,7 +344,8 @@ export class AdoSpecSync {
335
344
  title: storyTitle,
336
345
  description: storyDescription,
337
346
  parentId: featureId,
338
- tags: [`user-story`, `spec:${spec.metadata.id}`, `priority:${us.priority}`].join('; ')
347
+ tags: [`user-story`, `spec:${spec.metadata.id}`, `priority:${us.priority}`].join('; '),
348
+ priority: us.priority
339
349
  });
340
350
 
341
351
  created.push(us.id);
@@ -510,7 +520,12 @@ ${acList}
510
520
  description: string;
511
521
  parentId: number;
512
522
  tags: string;
523
+ priority?: string;
524
+ type?: string;
513
525
  }): Promise<AdoUserStory> {
526
+ // Determine work item type (supports Bug for bug-type stories)
527
+ const workItemType = this.mapTypeToAdo(story.type, 'User Story');
528
+
514
529
  const payload = [
515
530
  {
516
531
  op: 'add',
@@ -525,13 +540,19 @@ ${acList}
525
540
  {
526
541
  op: 'add',
527
542
  path: '/fields/System.WorkItemType',
528
- value: 'User Story'
543
+ value: workItemType
529
544
  },
530
545
  {
531
546
  op: 'add',
532
547
  path: '/fields/System.Tags',
533
548
  value: story.tags
534
549
  },
550
+ {
551
+ // Set native ADO Priority field
552
+ op: 'add',
553
+ path: '/fields/Microsoft.VSTS.Common.Priority',
554
+ value: this.mapPriorityToAdo(story.priority)
555
+ },
535
556
  {
536
557
  op: 'add',
537
558
  path: '/relations/-',
@@ -590,4 +611,52 @@ ${acList}
590
611
 
591
612
  await this.client.patch(`/wit/workitems/${storyId}?api-version=7.0`, payload);
592
613
  }
614
+
615
+ /**
616
+ * Map SpecWeave priority to ADO priority value
617
+ *
618
+ * ADO Priority field uses 1-4 scale:
619
+ * - 1 = Highest (P0)
620
+ * - 2 = High (P1)
621
+ * - 3 = Medium (P2)
622
+ * - 4 = Low (P3)
623
+ */
624
+ private mapPriorityToAdo(priority?: string): number {
625
+ if (!priority) return 3; // Default to Medium
626
+
627
+ const map: Record<string, number> = {
628
+ P0: 1,
629
+ P1: 2,
630
+ P2: 3,
631
+ P3: 4,
632
+ p0: 1,
633
+ p1: 2,
634
+ p2: 3,
635
+ p3: 4
636
+ };
637
+
638
+ return map[priority] || 3;
639
+ }
640
+
641
+ /**
642
+ * Map SpecWeave type to ADO work item type
643
+ *
644
+ * Supports: Feature, User Story, Bug, Task
645
+ */
646
+ private mapTypeToAdo(type?: string, defaultType: string = 'Feature'): string {
647
+ if (!type) return defaultType;
648
+
649
+ const normalizedType = type.toLowerCase();
650
+
651
+ const map: Record<string, string> = {
652
+ bug: 'Bug',
653
+ feature: 'Feature',
654
+ epic: 'Feature',
655
+ story: 'User Story',
656
+ task: 'Task',
657
+ enhancement: 'Feature'
658
+ };
659
+
660
+ return map[normalizedType] || defaultType;
661
+ }
593
662
  }
@@ -31,12 +31,13 @@ class AdoStatusSync {
31
31
  };
32
32
  }
33
33
  /**
34
- * Update ADO work item state
34
+ * Update ADO work item state and tags
35
35
  *
36
- * Uses JSON Patch format to update System.State field.
36
+ * Uses JSON Patch format to update System.State and System.Tags fields.
37
+ * Tags are appended to existing tags, not replaced.
37
38
  *
38
39
  * @param workItemId - ADO work item ID (e.g., 123)
39
- * @param status - Desired status
40
+ * @param status - Desired status with state and optional tags
40
41
  */
41
42
  async updateStatus(workItemId, status) {
42
43
  const patch = [
@@ -46,11 +47,42 @@ class AdoStatusSync {
46
47
  value: status.state
47
48
  }
48
49
  ];
50
+ if (status.tags && status.tags.length > 0) {
51
+ const currentTags = await this.getCurrentTags(workItemId);
52
+ const statusTagPatterns = ["Planning", "In Progress", "Paused", "Completed", "Abandoned", "On Hold"];
53
+ const preservedTags = currentTags.filter(
54
+ (tag) => !statusTagPatterns.some((pattern) => tag.toLowerCase() === pattern.toLowerCase())
55
+ );
56
+ const allTags = [.../* @__PURE__ */ new Set([...preservedTags, ...status.tags])];
57
+ patch.push({
58
+ op: "add",
59
+ path: "/fields/System.Tags",
60
+ value: allTags.join("; ")
61
+ });
62
+ }
49
63
  await this.client.patch(
50
64
  `/wit/workitems/${workItemId}?api-version=7.0`,
51
65
  patch
52
66
  );
53
67
  }
68
+ /**
69
+ * Get current tags from ADO work item
70
+ *
71
+ * @param workItemId - ADO work item ID
72
+ * @returns Array of current tags
73
+ */
74
+ async getCurrentTags(workItemId) {
75
+ try {
76
+ const response = await this.client.get(
77
+ `/wit/workitems/${workItemId}?api-version=7.0&$select=System.Tags`
78
+ );
79
+ const tagsString = response.data.fields?.["System.Tags"] || "";
80
+ if (!tagsString) return [];
81
+ return tagsString.split(";").map((tag) => tag.trim()).filter(Boolean);
82
+ } catch {
83
+ return [];
84
+ }
85
+ }
54
86
  /**
55
87
  * Post comment about status change to ADO work item
56
88
  *
@@ -18,6 +18,7 @@ import axios, { AxiosInstance } from 'axios';
18
18
  */
19
19
  export interface ExternalStatus {
20
20
  state: string; // e.g., "New", "Active", "Closed"
21
+ tags?: string[]; // Status tags from config (e.g., ["Planning"], ["In Progress"])
21
22
  }
22
23
 
23
24
  /**
@@ -69,16 +70,17 @@ export class AdoStatusSync {
69
70
  }
70
71
 
71
72
  /**
72
- * Update ADO work item state
73
+ * Update ADO work item state and tags
73
74
  *
74
- * Uses JSON Patch format to update System.State field.
75
+ * Uses JSON Patch format to update System.State and System.Tags fields.
76
+ * Tags are appended to existing tags, not replaced.
75
77
  *
76
78
  * @param workItemId - ADO work item ID (e.g., 123)
77
- * @param status - Desired status
79
+ * @param status - Desired status with state and optional tags
78
80
  */
79
81
  async updateStatus(workItemId: number, status: ExternalStatus): Promise<void> {
80
82
  // ADO uses JSON Patch format for updates
81
- const patch = [
83
+ const patch: Array<{ op: string; path: string; value: string }> = [
82
84
  {
83
85
  op: 'add',
84
86
  path: '/fields/System.State',
@@ -86,12 +88,54 @@ export class AdoStatusSync {
86
88
  }
87
89
  ];
88
90
 
91
+ // Add status tags if provided
92
+ if (status.tags && status.tags.length > 0) {
93
+ // Fetch current tags to preserve them
94
+ const currentTags = await this.getCurrentTags(workItemId);
95
+
96
+ // Remove old status tags (tags that match known status patterns)
97
+ const statusTagPatterns = ['Planning', 'In Progress', 'Paused', 'Completed', 'Abandoned', 'On Hold'];
98
+ const preservedTags = currentTags.filter(
99
+ tag => !statusTagPatterns.some(pattern => tag.toLowerCase() === pattern.toLowerCase())
100
+ );
101
+
102
+ // Combine preserved tags with new status tags
103
+ const allTags = [...new Set([...preservedTags, ...status.tags])];
104
+
105
+ patch.push({
106
+ op: 'add',
107
+ path: '/fields/System.Tags',
108
+ value: allTags.join('; ')
109
+ });
110
+ }
111
+
89
112
  await this.client.patch(
90
113
  `/wit/workitems/${workItemId}?api-version=7.0`,
91
114
  patch
92
115
  );
93
116
  }
94
117
 
118
+ /**
119
+ * Get current tags from ADO work item
120
+ *
121
+ * @param workItemId - ADO work item ID
122
+ * @returns Array of current tags
123
+ */
124
+ private async getCurrentTags(workItemId: number): Promise<string[]> {
125
+ try {
126
+ const response = await this.client.get(
127
+ `/wit/workitems/${workItemId}?api-version=7.0&$select=System.Tags`
128
+ );
129
+
130
+ const tagsString = response.data.fields?.['System.Tags'] || '';
131
+ if (!tagsString) return [];
132
+
133
+ return tagsString.split(';').map((tag: string) => tag.trim()).filter(Boolean);
134
+ } catch {
135
+ return [];
136
+ }
137
+ }
138
+
95
139
  /**
96
140
  * Post comment about status change to ADO work item
97
141
  *
@@ -1230,3 +1230,9 @@
1230
1230
  [Wed Nov 26 08:52:35 EST 2025] [GitHub] ⚠️ sync-spec-content CLI not found at /Users/antonabyzov/Projects/github/specweave/plugins/specweave-github/hooks/dist/src/cli/commands/sync-spec-content.js, skipping sync
1231
1231
  [Wed Nov 26 08:52:36 EST 2025] [GitHub] 🔗 GitHub sync hook fired
1232
1232
  [Wed Nov 26 08:52:36 EST 2025] [GitHub] ⚠️ sync-spec-content CLI not found at /Users/antonabyzov/Projects/github/specweave/plugins/specweave-github/hooks/dist/src/cli/commands/sync-spec-content.js, skipping sync
1233
+ [Wed Nov 26 12:29:20 EST 2025] [GitHub] 🔗 GitHub sync hook fired
1234
+ [Wed Nov 26 12:29:20 EST 2025] [GitHub] ⚠️ sync-spec-content CLI not found at /Users/antonabyzov/Projects/github/specweave/plugins/specweave-github/hooks/dist/src/cli/commands/sync-spec-content.js, skipping sync
1235
+ [Wed Nov 26 12:29:21 EST 2025] [GitHub] 🔗 GitHub sync hook fired
1236
+ [Wed Nov 26 12:29:21 EST 2025] [GitHub] ⚠️ sync-spec-content CLI not found at /Users/antonabyzov/Projects/github/specweave/plugins/specweave-github/hooks/dist/src/cli/commands/sync-spec-content.js, skipping sync
1237
+ [Wed Nov 26 12:29:21 EST 2025] [GitHub] 🔗 GitHub sync hook fired
1238
+ [Wed Nov 26 12:29:21 EST 2025] [GitHub] ⚠️ sync-spec-content CLI not found at /Users/antonabyzov/Projects/github/specweave/plugins/specweave-github/hooks/dist/src/cli/commands/sync-spec-content.js, skipping sync