specweave 0.17.16 → 0.17.19
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.
- package/CLAUDE.md +405 -2495
- package/README.md +92 -2
- package/dist/locales/de/.gitkeep +0 -0
- package/dist/locales/de/cli.json +108 -0
- package/dist/locales/en/cli.json +287 -0
- package/dist/locales/en/errors.json +7 -0
- package/dist/locales/en/templates.json +6 -0
- package/dist/locales/es/.gitkeep +0 -0
- package/dist/locales/es/cli.json +41 -0
- package/dist/locales/fr/.gitkeep +0 -0
- package/dist/locales/fr/cli.json +108 -0
- package/dist/locales/ja/.gitkeep +0 -0
- package/dist/locales/ja/cli.json +108 -0
- package/dist/locales/ko/.gitkeep +0 -0
- package/dist/locales/ko/cli.json +108 -0
- package/dist/locales/pt/.gitkeep +0 -0
- package/dist/locales/pt/cli.json +108 -0
- package/dist/locales/ru/.gitkeep +0 -0
- package/dist/locales/ru/cli.json +269 -0
- package/dist/locales/zh/.gitkeep +0 -0
- package/dist/locales/zh/cli.json +108 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +188 -36
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.js +65 -6
- package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.js.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts +54 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.js +86 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts +25 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js +191 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts +139 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.js +389 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.js.map +1 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts +26 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +249 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts +63 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.js +216 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts +1 -1
- package/dist/plugins/specweave-github/lib/github-client.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client.js +25 -13
- package/dist/plugins/specweave-github/lib/github-client.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts +83 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.js +466 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.d.ts +43 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.js +82 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts +5 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.js +38 -2
- package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts +28 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +156 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.d.ts +66 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js +274 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts +56 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js +93 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js.map +1 -0
- package/dist/spec-parser.js +629 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +107 -3
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +48 -3
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/core/deduplication/command-deduplicator.d.ts +166 -0
- package/dist/src/core/deduplication/command-deduplicator.d.ts.map +1 -0
- package/dist/src/core/deduplication/command-deduplicator.js +254 -0
- package/dist/src/core/deduplication/command-deduplicator.js.map +1 -0
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts +142 -0
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts.map +1 -0
- package/dist/src/core/living-docs/hierarchy-mapper.js +453 -0
- package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -0
- package/dist/src/core/living-docs/index.d.ts +10 -84
- package/dist/src/core/living-docs/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/index.js +10 -164
- package/dist/src/core/living-docs/index.js.map +1 -1
- package/dist/src/core/living-docs/spec-distributor.d.ts +106 -0
- package/dist/src/core/living-docs/spec-distributor.d.ts.map +1 -0
- package/dist/src/core/living-docs/spec-distributor.js +823 -0
- package/dist/src/core/living-docs/spec-distributor.js.map +1 -0
- package/dist/src/core/living-docs/types.d.ts +201 -0
- package/dist/src/core/living-docs/types.d.ts.map +1 -0
- package/dist/src/core/living-docs/types.js +15 -0
- package/dist/src/core/living-docs/types.js.map +1 -0
- package/dist/src/core/logging/prompt-logger.d.ts +70 -0
- package/dist/src/core/logging/prompt-logger.d.ts.map +1 -0
- package/dist/src/core/logging/prompt-logger.js +247 -0
- package/dist/src/core/logging/prompt-logger.js.map +1 -0
- package/dist/src/core/status-line/status-line-manager.d.ts +15 -24
- package/dist/src/core/status-line/status-line-manager.d.ts.map +1 -1
- package/dist/src/core/status-line/status-line-manager.js +33 -70
- package/dist/src/core/status-line/status-line-manager.js.map +1 -1
- package/dist/src/core/status-line/types.d.ts +19 -31
- package/dist/src/core/status-line/types.d.ts.map +1 -1
- package/dist/src/core/status-line/types.js +5 -9
- package/dist/src/core/status-line/types.js.map +1 -1
- package/dist/src/core/sync/conflict-resolver.d.ts +66 -0
- package/dist/src/core/sync/conflict-resolver.d.ts.map +1 -0
- package/dist/src/core/sync/conflict-resolver.js +108 -0
- package/dist/src/core/sync/conflict-resolver.js.map +1 -0
- package/dist/src/core/sync/enhanced-content-builder.d.ts +55 -0
- package/dist/src/core/sync/enhanced-content-builder.d.ts.map +1 -0
- package/dist/src/core/sync/enhanced-content-builder.js +202 -0
- package/dist/src/core/sync/enhanced-content-builder.js.map +1 -0
- package/dist/src/core/sync/label-detector.d.ts +66 -0
- package/dist/src/core/sync/label-detector.d.ts.map +1 -0
- package/dist/src/core/sync/label-detector.js +211 -0
- package/dist/src/core/sync/label-detector.js.map +1 -0
- package/dist/src/core/sync/retry-logic.d.ts +64 -0
- package/dist/src/core/sync/retry-logic.d.ts.map +1 -0
- package/dist/src/core/sync/retry-logic.js +165 -0
- package/dist/src/core/sync/retry-logic.js.map +1 -0
- package/dist/src/core/sync/spec-content-sync.d.ts +88 -0
- package/dist/src/core/sync/spec-content-sync.d.ts.map +1 -0
- package/dist/src/core/sync/spec-content-sync.js +5 -0
- package/dist/src/core/sync/spec-content-sync.js.map +1 -0
- package/dist/src/core/sync/spec-increment-mapper.d.ts +100 -0
- package/dist/src/core/sync/spec-increment-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/spec-increment-mapper.js +424 -0
- package/dist/src/core/sync/spec-increment-mapper.js.map +1 -0
- package/dist/src/core/sync/status-cache.d.ts +91 -0
- package/dist/src/core/sync/status-cache.d.ts.map +1 -0
- package/dist/src/core/sync/status-cache.js +140 -0
- package/dist/src/core/sync/status-cache.js.map +1 -0
- package/dist/src/core/sync/status-mapper.d.ts +69 -0
- package/dist/src/core/sync/status-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/status-mapper.js +90 -0
- package/dist/src/core/sync/status-mapper.js.map +1 -0
- package/dist/src/core/sync/status-sync-engine.d.ts +162 -0
- package/dist/src/core/sync/status-sync-engine.d.ts.map +1 -0
- package/dist/src/core/sync/status-sync-engine.js +347 -0
- package/dist/src/core/sync/status-sync-engine.js.map +1 -0
- package/dist/src/core/sync/sync-event-logger.d.ts +99 -0
- package/dist/src/core/sync/sync-event-logger.d.ts.map +1 -0
- package/dist/src/core/sync/sync-event-logger.js +103 -0
- package/dist/src/core/sync/sync-event-logger.js.map +1 -0
- package/dist/src/core/sync/types.d.ts +52 -0
- package/dist/src/core/sync/types.d.ts.map +1 -0
- package/dist/src/core/sync/types.js +5 -0
- package/dist/src/core/sync/types.js.map +1 -0
- package/dist/src/core/sync/workflow-detector.d.ts +95 -0
- package/dist/src/core/sync/workflow-detector.d.ts.map +1 -0
- package/dist/src/core/sync/workflow-detector.js +175 -0
- package/dist/src/core/sync/workflow-detector.js.map +1 -0
- package/dist/src/core/types/config.d.ts +51 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +47 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/core/types/increment-metadata.d.ts +4 -0
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
- package/dist/src/core/types/increment-metadata.js.map +1 -1
- package/dist/src/utils/github-url.d.ts +53 -0
- package/dist/src/utils/github-url.d.ts.map +1 -0
- package/dist/src/utils/github-url.js +90 -0
- package/dist/src/utils/github-url.js.map +1 -0
- package/dist/src/utils/spec-parser.d.ts +145 -0
- package/dist/src/utils/spec-parser.d.ts.map +1 -0
- package/dist/src/utils/spec-parser.js +640 -0
- package/dist/src/utils/spec-parser.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/plugins/specweave/agents/pm/AGENT.md +160 -13
- package/plugins/specweave/agents/pm/templates/increment-spec.md +158 -0
- package/plugins/specweave/agents/pm/templates/living-docs-spec.md +113 -0
- package/plugins/specweave/commands/specweave-done.md +163 -0
- package/plugins/specweave/commands/specweave.md +70 -405
- package/plugins/specweave/hooks/hooks.json +4 -0
- package/plugins/specweave/hooks/lib/sync-spec-content.sh +2 -2
- package/plugins/specweave/hooks/lib/update-status-line.sh +79 -111
- package/plugins/specweave/hooks/post-increment-planning.sh +133 -37
- package/plugins/specweave/hooks/pre-command-deduplication.sh +86 -0
- package/plugins/specweave/lib/hooks/sync-living-docs.js +139 -34
- package/plugins/specweave/lib/hooks/sync-living-docs.ts +234 -38
- package/plugins/specweave/skills/SKILLS-INDEX.md +4 -24
- package/plugins/specweave/skills/increment-planner/SKILL.md +94 -0
- package/plugins/specweave/skills/increment-work-router/SKILL.md +466 -0
- package/plugins/specweave-ado/commands/specweave-ado-sync-spec.md +1 -1
- package/plugins/specweave-ado/lib/ado-spec-content-sync.js +49 -5
- package/plugins/specweave-ado/lib/ado-spec-content-sync.ts +72 -6
- package/plugins/specweave-ado/lib/ado-status-sync.js +80 -0
- package/plugins/specweave-ado/lib/ado-status-sync.ts +121 -0
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
- package/plugins/specweave-github/commands/specweave-github-cleanup-duplicates.md +205 -0
- package/plugins/specweave-github/commands/specweave-github-sync-epic.md +248 -0
- package/plugins/specweave-github/commands/specweave-github-sync-spec.md +1 -1
- package/plugins/specweave-github/hooks/post-task-completion.sh +32 -0
- package/plugins/specweave-github/lib/duplicate-detector.js +370 -0
- package/plugins/specweave-github/lib/duplicate-detector.ts +525 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.js +220 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.ts +322 -0
- package/plugins/specweave-github/lib/epic-content-builder.js +227 -0
- package/plugins/specweave-github/lib/epic-content-builder.ts +317 -0
- package/plugins/specweave-github/lib/github-client.js +21 -10
- package/plugins/specweave-github/lib/github-client.ts +27 -16
- package/plugins/specweave-github/lib/github-epic-sync.js +488 -0
- package/plugins/specweave-github/lib/github-epic-sync.ts +715 -0
- package/plugins/specweave-github/lib/github-status-sync.js +71 -0
- package/plugins/specweave-github/lib/github-status-sync.ts +107 -0
- package/plugins/specweave-github/lib/task-sync.js +33 -2
- package/plugins/specweave-github/lib/task-sync.ts +44 -2
- package/plugins/specweave-jira/commands/specweave-jira-sync-epic.md +267 -0
- package/plugins/specweave-jira/commands/specweave-jira-sync-spec.md +1 -1
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +134 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.ts +196 -0
- package/plugins/specweave-jira/lib/jira-epic-sync.js +304 -0
- package/plugins/specweave-jira/lib/jira-epic-sync.ts +459 -0
- package/plugins/specweave-jira/lib/jira-status-sync.js +79 -0
- package/plugins/specweave-jira/lib/jira-status-sync.ts +139 -0
- package/plugins/specweave-release/commands/specweave-release-platform.md +1 -1
- package/plugins/specweave-release/hooks/post-task-completion.sh +2 -2
- package/src/templates/AGENTS.md.template +88 -1
- package/src/templates/CLAUDE.md.template +49 -0
- package/plugins/specweave/skills/increment-quality-judge/SKILL.md +0 -524
- package/plugins/specweave/skills/plugin-installer/SKILL.md +0 -353
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Content Builder
|
|
3
|
+
*
|
|
4
|
+
* Builds rich external issue descriptions with full spec content
|
|
5
|
+
* for GitHub, JIRA, and Azure DevOps integrations.
|
|
6
|
+
*/
|
|
7
|
+
export class EnhancedContentBuilder {
|
|
8
|
+
/**
|
|
9
|
+
* Build complete external description from spec
|
|
10
|
+
*/
|
|
11
|
+
buildExternalDescription(spec) {
|
|
12
|
+
const sections = [];
|
|
13
|
+
// 1. Executive Summary
|
|
14
|
+
sections.push(this.buildSummarySection(spec));
|
|
15
|
+
// 2. User Stories (collapsible in GitHub)
|
|
16
|
+
sections.push(this.buildUserStoriesSection(spec.userStories));
|
|
17
|
+
// 3. Linked Tasks (if available)
|
|
18
|
+
if (spec.tasks && spec.tasks.length > 0) {
|
|
19
|
+
sections.push(this.buildTasksSection(spec.tasks));
|
|
20
|
+
}
|
|
21
|
+
// 4. Architecture References (if available)
|
|
22
|
+
if (spec.architectureDocs && spec.architectureDocs.length > 0) {
|
|
23
|
+
sections.push(this.buildArchitectureSection(spec.architectureDocs));
|
|
24
|
+
}
|
|
25
|
+
// 5. Source Links (if available)
|
|
26
|
+
if (spec.sourceLinks) {
|
|
27
|
+
sections.push(this.buildSourceLinksSection(spec.sourceLinks));
|
|
28
|
+
}
|
|
29
|
+
return sections.join('\n\n');
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build summary section
|
|
33
|
+
*/
|
|
34
|
+
buildSummarySection(spec) {
|
|
35
|
+
return `## Summary\n\n${spec.summary}`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build user stories section with collapsible details
|
|
39
|
+
*/
|
|
40
|
+
buildUserStoriesSection(userStories) {
|
|
41
|
+
if (!userStories || userStories.length === 0) {
|
|
42
|
+
return `## User Stories\n\nNo user stories defined.`;
|
|
43
|
+
}
|
|
44
|
+
const sections = ['## User Stories'];
|
|
45
|
+
for (const story of userStories) {
|
|
46
|
+
const storySection = this.buildUserStoryDetails(story);
|
|
47
|
+
sections.push(storySection);
|
|
48
|
+
}
|
|
49
|
+
return sections.join('\n\n');
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build individual user story with collapsible details
|
|
53
|
+
*/
|
|
54
|
+
buildUserStoryDetails(story) {
|
|
55
|
+
const lines = [];
|
|
56
|
+
// Use GitHub collapsible format
|
|
57
|
+
lines.push(`<details>`);
|
|
58
|
+
lines.push(`<summary><strong>${story.id}: ${story.title}</strong></summary>`);
|
|
59
|
+
lines.push('');
|
|
60
|
+
// Add description if available
|
|
61
|
+
if (story.description) {
|
|
62
|
+
lines.push(`**Description**: ${story.description}`);
|
|
63
|
+
lines.push('');
|
|
64
|
+
}
|
|
65
|
+
// Acceptance Criteria
|
|
66
|
+
if (story.acceptanceCriteria && story.acceptanceCriteria.length > 0) {
|
|
67
|
+
lines.push('**Acceptance Criteria**:');
|
|
68
|
+
lines.push('');
|
|
69
|
+
// Group by priority
|
|
70
|
+
const byPriority = this.groupAcceptanceCriteriaByPriority(story.acceptanceCriteria);
|
|
71
|
+
for (const priority of ['P1', 'P2', 'P3', 'OTHER']) {
|
|
72
|
+
const criteria = byPriority[priority];
|
|
73
|
+
if (criteria && criteria.length > 0) {
|
|
74
|
+
for (const ac of criteria) {
|
|
75
|
+
const priorityLabel = ac.priority ? ` (${ac.priority})` : '';
|
|
76
|
+
lines.push(`- **${ac.id}**${priorityLabel}: ${ac.description}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
lines.push('**Acceptance Criteria**: No acceptance criteria defined.');
|
|
83
|
+
}
|
|
84
|
+
lines.push('');
|
|
85
|
+
lines.push('</details>');
|
|
86
|
+
return lines.join('\n');
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Group acceptance criteria by priority
|
|
90
|
+
*/
|
|
91
|
+
groupAcceptanceCriteriaByPriority(criteria) {
|
|
92
|
+
const grouped = {
|
|
93
|
+
P1: [],
|
|
94
|
+
P2: [],
|
|
95
|
+
P3: [],
|
|
96
|
+
OTHER: [] // For criteria without priority or with other priorities
|
|
97
|
+
};
|
|
98
|
+
for (const ac of criteria) {
|
|
99
|
+
const priority = ac.priority || 'OTHER';
|
|
100
|
+
if (priority in grouped) {
|
|
101
|
+
grouped[priority].push(ac);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
grouped.OTHER.push(ac);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return grouped;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Build tasks section with GitHub issue links
|
|
111
|
+
* Supports both simple array and options object for backward compatibility
|
|
112
|
+
*/
|
|
113
|
+
buildTasksSection(tasks, ownerOrOptions, repo) {
|
|
114
|
+
// Handle both old and new signatures
|
|
115
|
+
let taskList;
|
|
116
|
+
let owner;
|
|
117
|
+
let options = {};
|
|
118
|
+
if (Array.isArray(tasks)) {
|
|
119
|
+
taskList = tasks;
|
|
120
|
+
if (typeof ownerOrOptions === 'string') {
|
|
121
|
+
owner = ownerOrOptions;
|
|
122
|
+
}
|
|
123
|
+
else if (typeof ownerOrOptions === 'object') {
|
|
124
|
+
options = ownerOrOptions;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
// tasks is actually taskMapping object
|
|
129
|
+
taskList = tasks?.tasks || [];
|
|
130
|
+
if (typeof ownerOrOptions === 'object') {
|
|
131
|
+
options = ownerOrOptions;
|
|
132
|
+
owner = tasks?.owner;
|
|
133
|
+
repo = tasks?.repo;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (!taskList || taskList.length === 0) {
|
|
137
|
+
return `## Tasks\n\nNo tasks defined.`;
|
|
138
|
+
}
|
|
139
|
+
const lines = ['## Tasks'];
|
|
140
|
+
lines.push('');
|
|
141
|
+
// Add progress bar if requested
|
|
142
|
+
if (options.showProgressBar && taskList.length > 0) {
|
|
143
|
+
const completed = taskList.filter(t => t.completed).length;
|
|
144
|
+
const total = taskList.length;
|
|
145
|
+
const percentage = Math.round((completed / total) * 100);
|
|
146
|
+
lines.push(`**Progress**: ${completed}/${total} tasks (${percentage}%)`);
|
|
147
|
+
lines.push('');
|
|
148
|
+
}
|
|
149
|
+
for (const task of taskList) {
|
|
150
|
+
let taskLine = '';
|
|
151
|
+
// Add checkbox if requested
|
|
152
|
+
if (options.showCheckboxes) {
|
|
153
|
+
taskLine += task.completed ? '- [x] ' : '- [ ] ';
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
taskLine += '- ';
|
|
157
|
+
}
|
|
158
|
+
taskLine += `**${task.id}**: ${task.title}`;
|
|
159
|
+
// Add GitHub issue link if available
|
|
160
|
+
if (task.githubIssue && owner && repo) {
|
|
161
|
+
const issueUrl = `https://github.com/${owner}/${repo}/issues/${task.githubIssue}`;
|
|
162
|
+
taskLine += ` ([#${task.githubIssue}](${issueUrl}))`;
|
|
163
|
+
}
|
|
164
|
+
// Add user story references
|
|
165
|
+
if (task.userStoryIds && task.userStoryIds.length > 0) {
|
|
166
|
+
taskLine += ` → Implements: ${task.userStoryIds.join(', ')}`;
|
|
167
|
+
}
|
|
168
|
+
// Add completion status if requested
|
|
169
|
+
if (options.showCompletionStatus && task.completed) {
|
|
170
|
+
taskLine += ' ✅';
|
|
171
|
+
}
|
|
172
|
+
lines.push(taskLine);
|
|
173
|
+
}
|
|
174
|
+
return lines.join('\n');
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Build architecture section
|
|
178
|
+
*/
|
|
179
|
+
buildArchitectureSection(docs) {
|
|
180
|
+
const lines = ['## Architecture'];
|
|
181
|
+
lines.push('');
|
|
182
|
+
lines.push('Related architecture documentation:');
|
|
183
|
+
lines.push('');
|
|
184
|
+
for (const doc of docs) {
|
|
185
|
+
const fileName = doc.split('/').pop() || doc;
|
|
186
|
+
lines.push(`- [${fileName}](${doc})`);
|
|
187
|
+
}
|
|
188
|
+
return lines.join('\n');
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Build source links section
|
|
192
|
+
*/
|
|
193
|
+
buildSourceLinksSection(sourceLinks) {
|
|
194
|
+
const lines = ['## Source Files'];
|
|
195
|
+
lines.push('');
|
|
196
|
+
lines.push(`- **Specification**: [spec.md](${sourceLinks.spec})`);
|
|
197
|
+
lines.push(`- **Technical Plan**: [plan.md](${sourceLinks.plan})`);
|
|
198
|
+
lines.push(`- **Task List**: [tasks.md](${sourceLinks.tasks})`);
|
|
199
|
+
return lines.join('\n');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=enhanced-content-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhanced-content-builder.js","sourceRoot":"","sources":["../../../../src/core/sync/enhanced-content-builder.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IACjC;;OAEG;IACI,wBAAwB,CAAC,IAAiB;QAC/C,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,uBAAuB;QACvB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC;QAE9C,0CAA0C;QAC1C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAE9D,iCAAiC;QACjC,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACpD,CAAC;QAED,4CAA4C;QAC5C,IAAI,IAAI,CAAC,gBA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IAC1B,CAAC;IAED;;OAEG;IACI,uBAAuB,CAAC,WAA0D;QACvF,MAAM,KAAK,GAAa,CAAC,iBAAiB,CAAC,CAAC;QAC5C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,kCAAkC,WAAW,CAAC,IAAI,GAAG,CAAC,CAAC;QAClE,KAAK,CAAC,IAAI,CAAC,mCAAmC,WAAW,CAAC,IAAI,GAAG,CAAC,CAAC;QACnE,KAAK,CAAC,IAAI,CAAC,+BAA+B,WAAW,CAAC,KAAK,GAAG,CAAC,CAAC;QAEhE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Label Detector
|
|
3
|
+
*
|
|
4
|
+
* Detects increment type and applies appropriate labels for external tools.
|
|
5
|
+
* Supports GitHub labels, Jira labels, and ADO tags.
|
|
6
|
+
*
|
|
7
|
+
* @author SpecWeave Team
|
|
8
|
+
* @version 1.0.0
|
|
9
|
+
*/
|
|
10
|
+
export type IncrementType = 'bug' | 'feature' | 'docs' | 'hotfix' | 'refactor' | 'chore' | 'experiment';
|
|
11
|
+
export interface LabelConfig {
|
|
12
|
+
bug: string;
|
|
13
|
+
feature: string;
|
|
14
|
+
docs: string;
|
|
15
|
+
hotfix?: string;
|
|
16
|
+
refactor?: string;
|
|
17
|
+
chore?: string;
|
|
18
|
+
experiment?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface DetectionResult {
|
|
21
|
+
type: IncrementType;
|
|
22
|
+
confidence: number;
|
|
23
|
+
labels: string[];
|
|
24
|
+
detectionMethod: 'frontmatter' | 'title' | 'content' | 'filename';
|
|
25
|
+
}
|
|
26
|
+
export declare class LabelDetector {
|
|
27
|
+
private labelConfig;
|
|
28
|
+
constructor(labelConfig?: Partial<LabelConfig>, useUserFormat?: boolean);
|
|
29
|
+
/**
|
|
30
|
+
* Detect increment type from spec content
|
|
31
|
+
*/
|
|
32
|
+
detectType(specContent: string, incrementId?: string): DetectionResult;
|
|
33
|
+
/**
|
|
34
|
+
* Detect from YAML frontmatter (type: bug, type: feature, etc.)
|
|
35
|
+
*/
|
|
36
|
+
private detectFromFrontmatter;
|
|
37
|
+
/**
|
|
38
|
+
* Detect from title/heading (# Fix: Bug Title, # Feature: New Feature, etc.)
|
|
39
|
+
*/
|
|
40
|
+
private detectFromTitle;
|
|
41
|
+
/**
|
|
42
|
+
* Detect from increment filename (0001-bugfix-auth, 0002-feature-dashboard, etc.)
|
|
43
|
+
*/
|
|
44
|
+
private detectFromFilename;
|
|
45
|
+
/**
|
|
46
|
+
* Detect from content keywords
|
|
47
|
+
*/
|
|
48
|
+
private detectFromContent;
|
|
49
|
+
/**
|
|
50
|
+
* Get labels for GitHub (standard format)
|
|
51
|
+
*/
|
|
52
|
+
getGitHubLabels(type: IncrementType): string[];
|
|
53
|
+
/**
|
|
54
|
+
* Get labels for Jira (supports labels)
|
|
55
|
+
*/
|
|
56
|
+
getJiraLabels(type: IncrementType): string[];
|
|
57
|
+
/**
|
|
58
|
+
* Get tags for Azure DevOps (supports tags)
|
|
59
|
+
*/
|
|
60
|
+
getAdoTags(type: IncrementType): string[];
|
|
61
|
+
/**
|
|
62
|
+
* Get user-friendly labels (with brackets: [Bug], [Feature], etc.)
|
|
63
|
+
*/
|
|
64
|
+
getUserLabels(type: IncrementType): string[];
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=label-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-detector.d.ts","sourceRoot":"","sources":["../../../../src/core/sync/label-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;AAExG,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,EAAE,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;CACnE;AAsBD,qBAAa,aAAa;IACxB,OAAO,CAAC,WAAW,CAAc;gBAErB,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,aAAa,GAAE,OAAc;IAK7E;;OAEG;IACH,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,eAAe;IAyBtE;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAuB7B;;OAEG;IACH,OAAO,CAAC,eAAe;IA8BvB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA6B1B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA0CzB;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,EAAE;IAc9C;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,EAAE;IAI5C;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,EAAE;IAIzC;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,EAAE;CAG7C"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Label Detector
|
|
3
|
+
*
|
|
4
|
+
* Detects increment type and applies appropriate labels for external tools.
|
|
5
|
+
* Supports GitHub labels, Jira labels, and ADO tags.
|
|
6
|
+
*
|
|
7
|
+
* @author SpecWeave Team
|
|
8
|
+
* @version 1.0.0
|
|
9
|
+
*/
|
|
10
|
+
const DEFAULT_GITHUB_LABELS = {
|
|
11
|
+
bug: 'bug',
|
|
12
|
+
feature: 'enhancement',
|
|
13
|
+
docs: 'documentation',
|
|
14
|
+
hotfix: 'hotfix',
|
|
15
|
+
refactor: 'refactor',
|
|
16
|
+
chore: 'chore',
|
|
17
|
+
experiment: 'experiment'
|
|
18
|
+
};
|
|
19
|
+
const DEFAULT_USER_LABELS = {
|
|
20
|
+
bug: '[Bug]',
|
|
21
|
+
feature: '[Feature]',
|
|
22
|
+
docs: '[Docs]',
|
|
23
|
+
hotfix: '[Hotfix]',
|
|
24
|
+
refactor: '[Refactor]',
|
|
25
|
+
chore: '[Chore]',
|
|
26
|
+
experiment: '[Experiment]'
|
|
27
|
+
};
|
|
28
|
+
export class LabelDetector {
|
|
29
|
+
constructor(labelConfig, useUserFormat = true) {
|
|
30
|
+
const defaults = useUserFormat ? DEFAULT_USER_LABELS : DEFAULT_GITHUB_LABELS;
|
|
31
|
+
this.labelConfig = { ...defaults, ...labelConfig };
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Detect increment type from spec content
|
|
35
|
+
*/
|
|
36
|
+
detectType(specContent, incrementId) {
|
|
37
|
+
// Try detection methods in order of confidence
|
|
38
|
+
const methods = [
|
|
39
|
+
() => this.detectFromFrontmatter(specContent),
|
|
40
|
+
() => this.detectFromTitle(specContent),
|
|
41
|
+
() => this.detectFromFilename(incrementId),
|
|
42
|
+
() => this.detectFromContent(specContent)
|
|
43
|
+
];
|
|
44
|
+
for (const method of methods) {
|
|
45
|
+
const result = method();
|
|
46
|
+
if (result && result.confidence >= 70) {
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Fallback: default to feature with low confidence
|
|
51
|
+
return {
|
|
52
|
+
type: 'feature',
|
|
53
|
+
confidence: 30,
|
|
54
|
+
labels: [this.labelConfig.feature],
|
|
55
|
+
detectionMethod: 'content'
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Detect from YAML frontmatter (type: bug, type: feature, etc.)
|
|
60
|
+
*/
|
|
61
|
+
detectFromFrontmatter(content) {
|
|
62
|
+
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
63
|
+
if (!frontmatterMatch)
|
|
64
|
+
return null;
|
|
65
|
+
const frontmatter = frontmatterMatch[1];
|
|
66
|
+
// Look for "type: bug" or "type: feature"
|
|
67
|
+
const typeMatch = frontmatter.match(/^type:\s*(.+)$/m);
|
|
68
|
+
if (!typeMatch)
|
|
69
|
+
return null;
|
|
70
|
+
const type = typeMatch[1].trim().toLowerCase();
|
|
71
|
+
const label = this.labelConfig[type];
|
|
72
|
+
if (!label)
|
|
73
|
+
return null;
|
|
74
|
+
return {
|
|
75
|
+
type,
|
|
76
|
+
confidence: 100,
|
|
77
|
+
labels: [label],
|
|
78
|
+
detectionMethod: 'frontmatter'
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Detect from title/heading (# Fix: Bug Title, # Feature: New Feature, etc.)
|
|
83
|
+
*/
|
|
84
|
+
detectFromTitle(content) {
|
|
85
|
+
const titleMatch = content.match(/^#\s+(?:Increment\s+\d+:\s+)?(.+)$/m);
|
|
86
|
+
if (!titleMatch)
|
|
87
|
+
return null;
|
|
88
|
+
const title = titleMatch[1].toLowerCase();
|
|
89
|
+
// Check for explicit markers
|
|
90
|
+
const markers = {
|
|
91
|
+
bug: ['fix:', 'bug:', 'bugfix:', 'hotfix:'],
|
|
92
|
+
feature: ['feature:', 'feat:', 'add:', 'implement:'],
|
|
93
|
+
docs: ['docs:', 'doc:', 'documentation:'],
|
|
94
|
+
hotfix: ['hotfix:', 'emergency:', 'critical:'],
|
|
95
|
+
refactor: ['refactor:', 'refactoring:', 'cleanup:'],
|
|
96
|
+
chore: ['chore:', 'maintenance:']
|
|
97
|
+
};
|
|
98
|
+
for (const [type, patterns] of Object.entries(markers)) {
|
|
99
|
+
if (patterns.some(p => title.startsWith(p))) {
|
|
100
|
+
return {
|
|
101
|
+
type: type,
|
|
102
|
+
confidence: 90,
|
|
103
|
+
labels: [this.labelConfig[type]],
|
|
104
|
+
detectionMethod: 'title'
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Detect from increment filename (0001-bugfix-auth, 0002-feature-dashboard, etc.)
|
|
112
|
+
*/
|
|
113
|
+
detectFromFilename(incrementId) {
|
|
114
|
+
if (!incrementId)
|
|
115
|
+
return null;
|
|
116
|
+
const filename = incrementId.toLowerCase();
|
|
117
|
+
const patterns = {
|
|
118
|
+
bug: /\b(bug|bugfix|fix)\b/,
|
|
119
|
+
feature: /\b(feature|feat)\b/,
|
|
120
|
+
docs: /\b(docs?|documentation)\b/,
|
|
121
|
+
hotfix: /\b(hotfix|emergency)\b/,
|
|
122
|
+
refactor: /\b(refactor|cleanup)\b/,
|
|
123
|
+
chore: /\b(chore|maintenance)\b/,
|
|
124
|
+
experiment: /\b(experiment|poc|spike)\b/
|
|
125
|
+
};
|
|
126
|
+
for (const [type, pattern] of Object.entries(patterns)) {
|
|
127
|
+
if (pattern.test(filename)) {
|
|
128
|
+
return {
|
|
129
|
+
type: type,
|
|
130
|
+
confidence: 80,
|
|
131
|
+
labels: [this.labelConfig[type]],
|
|
132
|
+
detectionMethod: 'filename'
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Detect from content keywords
|
|
140
|
+
*/
|
|
141
|
+
detectFromContent(content) {
|
|
142
|
+
const lower = content.toLowerCase();
|
|
143
|
+
// Bug indicators
|
|
144
|
+
const bugKeywords = ['error', 'crash', 'issue', 'problem', 'broken', 'not working'];
|
|
145
|
+
const bugCount = bugKeywords.filter(k => lower.includes(k)).length;
|
|
146
|
+
// Feature indicators
|
|
147
|
+
const featureKeywords = ['implement', 'add', 'create', 'new feature', 'enhancement'];
|
|
148
|
+
const featureCount = featureKeywords.filter(k => lower.includes(k)).length;
|
|
149
|
+
// Docs indicators
|
|
150
|
+
const docsKeywords = ['documentation', 'readme', 'guide', 'tutorial', 'docs'];
|
|
151
|
+
const docsCount = docsKeywords.filter(k => lower.includes(k)).length;
|
|
152
|
+
// Determine type by keyword frequency
|
|
153
|
+
const max = Math.max(bugCount, featureCount, docsCount);
|
|
154
|
+
if (max === 0)
|
|
155
|
+
return null;
|
|
156
|
+
let type;
|
|
157
|
+
let confidence;
|
|
158
|
+
if (bugCount === max) {
|
|
159
|
+
type = 'bug';
|
|
160
|
+
confidence = Math.min(50 + bugCount * 10, 100);
|
|
161
|
+
}
|
|
162
|
+
else if (featureCount === max) {
|
|
163
|
+
type = 'feature';
|
|
164
|
+
confidence = Math.min(50 + featureCount * 10, 100);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
type = 'docs';
|
|
168
|
+
confidence = Math.min(50 + docsCount * 10, 100);
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
type,
|
|
172
|
+
confidence,
|
|
173
|
+
labels: [this.labelConfig[type]],
|
|
174
|
+
detectionMethod: 'content'
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Get labels for GitHub (standard format)
|
|
179
|
+
*/
|
|
180
|
+
getGitHubLabels(type) {
|
|
181
|
+
const githubLabels = {
|
|
182
|
+
bug: 'bug',
|
|
183
|
+
feature: 'enhancement',
|
|
184
|
+
docs: 'documentation',
|
|
185
|
+
hotfix: 'hotfix',
|
|
186
|
+
refactor: 'refactor',
|
|
187
|
+
chore: 'chore',
|
|
188
|
+
experiment: 'experiment'
|
|
189
|
+
};
|
|
190
|
+
return [githubLabels[type]];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get labels for Jira (supports labels)
|
|
194
|
+
*/
|
|
195
|
+
getJiraLabels(type) {
|
|
196
|
+
return [type]; // Jira labels are just lowercase type names
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get tags for Azure DevOps (supports tags)
|
|
200
|
+
*/
|
|
201
|
+
getAdoTags(type) {
|
|
202
|
+
return [type]; // ADO tags are also lowercase type names
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get user-friendly labels (with brackets: [Bug], [Feature], etc.)
|
|
206
|
+
*/
|
|
207
|
+
getUserLabels(type) {
|
|
208
|
+
return [this.labelConfig[type]];
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=label-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-detector.js","sourceRoot":"","sources":["../../../../src/core/sync/label-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAqBH,MAAM,qBAAqB,GAAgB;IACzC,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;CACzB,CAAC;AAEF,MAAM,mBAAmB,GAAgB;IACvC,GAAG,EAAE,OAAO;IACZ,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,YAAY;IACtB,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,cAAc;CAC3B,CAAC;AAEF,MAAM,OAAO,aAAa;IAGxB,YAAY,WAAkC,EAAE,gBAAyB,IAAI;QAC3E,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,qBAAqB,CAAC;QAC7E,IAAI,CAAC,WAAW,GAAG,EAAE,GAAG,QAAQ,EA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,UAAU;YACV,MAAM,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAChC,eAAe,EAAE,SAAS;SAC3B,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,IAAmB;QACjC,MAAM,YAAY,GAAgB;YAChC,GAAG,EAAE,KAAK;YACV,OAAO,EAAE,aAAa;YACtB,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,QAAQ;YAChB,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,OAAO;YACd,UAAU,EAAE,YAAY;SACzB,CAAC;QAEF,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,IAAmB;QAC/B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,4CAA4C;IAC9D,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,IAAmB;QAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,yCAAyC;IAC3D,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,IAAmB;QAC/B,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry Logic
|
|
3
|
+
*
|
|
4
|
+
* Provides retry functionality with exponential backoff.
|
|
5
|
+
* Handles transient errors (network, rate limits, timeouts).
|
|
6
|
+
*
|
|
7
|
+
* Retry Strategy:
|
|
8
|
+
* - Max 3 retries
|
|
9
|
+
* - Exponential backoff: 1s, 2s, 4s
|
|
10
|
+
* - Special handling for rate limits (wait and retry)
|
|
11
|
+
*
|
|
12
|
+
* @module retry-logic
|
|
13
|
+
*/
|
|
14
|
+
export interface RetryOptions {
|
|
15
|
+
maxRetries?: number;
|
|
16
|
+
initialDelayMs?: number;
|
|
17
|
+
maxDelayMs?: number;
|
|
18
|
+
retryableErrors?: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface RetryResult<T> {
|
|
21
|
+
success: boolean;
|
|
22
|
+
result?: T;
|
|
23
|
+
error?: Error;
|
|
24
|
+
attempts: number;
|
|
25
|
+
totalDelayMs: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if error is retryable
|
|
29
|
+
*
|
|
30
|
+
* @param error - Error to check
|
|
31
|
+
* @returns True if error is retryable
|
|
32
|
+
*/
|
|
33
|
+
export declare function isRetryableError(error: Error): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Extract rate limit wait time from error
|
|
36
|
+
*
|
|
37
|
+
* @param error - Error that may contain rate limit info
|
|
38
|
+
* @returns Wait time in milliseconds, or null if not rate limit error
|
|
39
|
+
*/
|
|
40
|
+
export declare function extractRateLimitWaitTime(error: Error): number | null;
|
|
41
|
+
/**
|
|
42
|
+
* Retry function with exponential backoff
|
|
43
|
+
*
|
|
44
|
+
* @param fn - Function to retry
|
|
45
|
+
* @param options - Retry options
|
|
46
|
+
* @returns Retry result
|
|
47
|
+
*/
|
|
48
|
+
export declare function retryWithBackoff<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<RetryResult<T>>;
|
|
49
|
+
/**
|
|
50
|
+
* Create error message with retry information
|
|
51
|
+
*
|
|
52
|
+
* @param error - Original error
|
|
53
|
+
* @param attempts - Number of attempts made
|
|
54
|
+
* @returns Enhanced error message
|
|
55
|
+
*/
|
|
56
|
+
export declare function createRetryErrorMessage(error: Error, attempts: number): string;
|
|
57
|
+
/**
|
|
58
|
+
* Check if error is permanent (not worth retrying)
|
|
59
|
+
*
|
|
60
|
+
* @param error - Error to check
|
|
61
|
+
* @returns True if error is permanent
|
|
62
|
+
*/
|
|
63
|
+
export declare function isPermanentError(error: Error): boolean;
|
|
64
|
+
//# sourceMappingURL=retry-logic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry-logic.d.ts","sourceRoot":"","sources":["../../../../src/core/sync/retry-logic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAkCtD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAqBpE;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CA4DzB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAwBtD"}
|