specweave 0.32.6 → 0.32.7

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 (58) hide show
  1. package/README.md +3 -0
  2. package/dist/src/cli/commands/init.d.ts.map +1 -1
  3. package/dist/src/cli/commands/init.js +16 -0
  4. package/dist/src/cli/commands/init.js.map +1 -1
  5. package/dist/src/cli/helpers/init/bitbucket-repo-cloning.d.ts +42 -0
  6. package/dist/src/cli/helpers/init/bitbucket-repo-cloning.d.ts.map +1 -0
  7. package/dist/src/cli/helpers/init/bitbucket-repo-cloning.js +256 -0
  8. package/dist/src/cli/helpers/init/bitbucket-repo-cloning.js.map +1 -0
  9. package/dist/src/cli/helpers/init/github-repo-cloning.d.ts +40 -0
  10. package/dist/src/cli/helpers/init/github-repo-cloning.d.ts.map +1 -0
  11. package/dist/src/cli/helpers/init/github-repo-cloning.js +284 -0
  12. package/dist/src/cli/helpers/init/github-repo-cloning.js.map +1 -0
  13. package/dist/src/cli/helpers/init/repository-setup.d.ts +24 -0
  14. package/dist/src/cli/helpers/init/repository-setup.d.ts.map +1 -1
  15. package/dist/src/cli/helpers/init/repository-setup.js +196 -2
  16. package/dist/src/cli/helpers/init/repository-setup.js.map +1 -1
  17. package/dist/src/cli/helpers/issue-tracker/github.d.ts +35 -0
  18. package/dist/src/cli/helpers/issue-tracker/github.d.ts.map +1 -1
  19. package/dist/src/cli/helpers/issue-tracker/github.js +203 -0
  20. package/dist/src/cli/helpers/issue-tracker/github.js.map +1 -1
  21. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  22. package/dist/src/cli/helpers/issue-tracker/index.js +120 -12
  23. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  24. package/dist/src/cli/helpers/issue-tracker/jira.d.ts.map +1 -1
  25. package/dist/src/cli/helpers/issue-tracker/jira.js +6 -7
  26. package/dist/src/cli/helpers/issue-tracker/jira.js.map +1 -1
  27. package/dist/src/utils/validators/jira-validator.d.ts +12 -0
  28. package/dist/src/utils/validators/jira-validator.d.ts.map +1 -1
  29. package/dist/src/utils/validators/jira-validator.js +35 -11
  30. package/dist/src/utils/validators/jira-validator.js.map +1 -1
  31. package/package.json +3 -3
  32. package/plugins/specweave/commands/specweave-done.md +34 -0
  33. package/plugins/specweave/commands/specweave-increment.md +13 -5
  34. package/plugins/specweave/hooks/v2/detectors/lifecycle-detector.sh +3 -1
  35. package/plugins/specweave/hooks/docs-changed.sh.backup +0 -79
  36. package/plugins/specweave/hooks/human-input-required.sh.backup +0 -75
  37. package/plugins/specweave/hooks/post-first-increment.sh.backup +0 -61
  38. package/plugins/specweave/hooks/post-increment-change.sh.backup +0 -98
  39. package/plugins/specweave/hooks/post-increment-completion.sh.backup +0 -231
  40. package/plugins/specweave/hooks/post-increment-planning.sh.backup +0 -1048
  41. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +0 -147
  42. package/plugins/specweave/hooks/post-spec-update.sh.backup +0 -158
  43. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +0 -179
  44. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +0 -83
  45. package/plugins/specweave/hooks/pre-implementation.sh.backup +0 -67
  46. package/plugins/specweave/hooks/pre-task-completion.sh.backup +0 -194
  47. package/plugins/specweave/hooks/pre-tool-use.sh.backup +0 -133
  48. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +0 -386
  49. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +0 -353
  50. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +0 -172
  51. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
  52. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -1262
  53. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +0 -258
  54. package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -220
  55. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +0 -172
  56. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -134
  57. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -1254
  58. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +0 -110
@@ -1,134 +0,0 @@
1
- import { EnhancedContentBuilder } from "../../../dist/src/core/sync/enhanced-content-builder.js";
2
- import { SpecIncrementMapper } from "../../../dist/src/core/sync/spec-increment-mapper.js";
3
- import { parseSpecContent } from "../../../dist/src/core/spec-content-sync.js";
4
- import * as path from "path";
5
- import * as fs from "fs/promises";
6
- async function syncSpecToJiraWithEnhancedContent(options) {
7
- const { specPath, domain, project, dryRun = false, verbose = false } = options;
8
- try {
9
- const baseSpec = await parseSpecContent(specPath);
10
- if (!baseSpec) {
11
- return {
12
- success: false,
13
- action: "error",
14
- error: "Failed to parse spec content"
15
- };
16
- }
17
- if (verbose) {
18
- console.log(`\u{1F4C4} Parsed spec: ${baseSpec.identifier.compact}`);
19
- }
20
- const specId = baseSpec.identifier.full || baseSpec.identifier.compact;
21
- const rootDir = await findSpecWeaveRoot(specPath);
22
- const mapper = new SpecIncrementMapper(rootDir);
23
- const mapping = await mapper.mapSpecToIncrements(specId);
24
- if (verbose) {
25
- console.log(`\u{1F517} Found ${mapping.increments.length} related increments`);
26
- }
27
- const taskMapping = buildTaskMapping(mapping.increments);
28
- const architectureDocs = await findArchitectureDocs(rootDir, specId);
29
- const enhancedSpec = {
30
- ...baseSpec,
31
- summary: baseSpec.description,
32
- taskMapping,
33
- architectureDocs
34
- };
35
- const builder = new EnhancedContentBuilder();
36
- const description = builder.buildExternalDescription(enhancedSpec);
37
- if (verbose) {
38
- console.log(`\u{1F4DD} Generated description: ${description.length} characters`);
39
- }
40
- if (dryRun) {
41
- console.log("\u{1F50D} DRY RUN - Would create/update epic with:");
42
- console.log(` Summary: ${baseSpec.title}`);
43
- console.log(` Description length: ${description.length}`);
44
- return {
45
- success: true,
46
- action: "no-change",
47
- tasksLinked: taskMapping?.tasks.length || 0
48
- };
49
- }
50
- if (!dryRun && (!domain || !project)) {
51
- return {
52
- success: false,
53
- action: "error",
54
- error: "JIRA domain/project not specified (required for actual sync)"
55
- };
56
- }
57
- const result = {
58
- success: true,
59
- action: dryRun ? "no-change" : "created",
60
- // Assume create if not dry run
61
- tasksLinked: taskMapping?.tasks.length || 0
62
- };
63
- if (domain && project && !dryRun) {
64
- result.epicKey = `SPEC-001`;
65
- result.epicUrl = `https://${domain}/browse/SPEC-001`;
66
- if (verbose) {
67
- console.log(`\u26A0\uFE0F JIRA API integration not implemented in this file`);
68
- console.log(` Use jira-spec-sync.ts for actual JIRA synchronization`);
69
- }
70
- }
71
- return result;
72
- } catch (error) {
73
- return {
74
- success: false,
75
- action: "error",
76
- error: error.message
77
- };
78
- }
79
- }
80
- async function findSpecWeaveRoot(specPath) {
81
- let currentDir = path.dirname(specPath);
82
- while (true) {
83
- const specweaveDir = path.join(currentDir, ".specweave");
84
- try {
85
- await fs.access(specweaveDir);
86
- return currentDir;
87
- } catch {
88
- const parentDir = path.dirname(currentDir);
89
- if (parentDir === currentDir) {
90
- throw new Error(".specweave directory not found");
91
- }
92
- currentDir = parentDir;
93
- }
94
- }
95
- }
96
- function buildTaskMapping(increments) {
97
- if (increments.length === 0) return void 0;
98
- const firstIncrement = increments[0];
99
- const tasks = firstIncrement.tasks.map((task) => ({
100
- id: task.id,
101
- title: task.title,
102
- userStories: task.userStories
103
- }));
104
- return {
105
- incrementId: firstIncrement.id,
106
- tasks,
107
- tasksUrl: `tasks.md`
108
- // JIRA doesn't support external links in same way
109
- };
110
- }
111
- async function findArchitectureDocs(rootDir, specId) {
112
- const docs = [];
113
- const archDir = path.join(rootDir, ".specweave/docs/internal/architecture");
114
- try {
115
- const adrDir = path.join(archDir, "adr");
116
- try {
117
- const adrs = await fs.readdir(adrDir);
118
- const relatedAdrs = adrs.filter((file) => file.includes(specId.replace("spec-", "")));
119
- for (const adr of relatedAdrs) {
120
- docs.push({
121
- type: "adr",
122
- path: path.join(adrDir, adr),
123
- title: adr.replace(".md", "").replace(/-/g, " ")
124
- });
125
- }
126
- } catch {
127
- }
128
- } catch {
129
- }
130
- return docs;
131
- }
132
- export {
133
- syncSpecToJiraWithEnhancedContent
134
- };