specweave 1.0.21 → 1.0.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 (28) hide show
  1. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.d.ts.map +1 -1
  2. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.js +79 -13
  3. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.js.map +1 -1
  4. package/package.json +1 -1
  5. package/plugins/specweave/hooks/docs-changed.sh.backup +0 -79
  6. package/plugins/specweave/hooks/human-input-required.sh.backup +0 -75
  7. package/plugins/specweave/hooks/post-first-increment.sh.backup +0 -61
  8. package/plugins/specweave/hooks/post-increment-change.sh.backup +0 -98
  9. package/plugins/specweave/hooks/post-increment-completion.sh.backup +0 -231
  10. package/plugins/specweave/hooks/post-increment-planning.sh.backup +0 -1048
  11. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +0 -147
  12. package/plugins/specweave/hooks/post-spec-update.sh.backup +0 -158
  13. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +0 -179
  14. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +0 -83
  15. package/plugins/specweave/hooks/pre-implementation.sh.backup +0 -67
  16. package/plugins/specweave/hooks/pre-task-completion.sh.backup +0 -194
  17. package/plugins/specweave/hooks/pre-tool-use.sh.backup +0 -133
  18. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +0 -386
  19. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +0 -353
  20. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +0 -172
  21. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
  22. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -1262
  23. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +0 -258
  24. package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -220
  25. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +0 -172
  26. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -134
  27. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -1254
  28. 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
- };